Cleanup: Remove const for params passed by value
BUG=aomedia:448
Change-Id: Ieff977fca8a5033ddef2871a194870f59301ad8f
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index c135a10..7fd96dd 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -1013,11 +1013,11 @@
void av1_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y);
-static INLINE int tx_size_to_depth(const TX_SIZE tx_size) {
+static INLINE int tx_size_to_depth(TX_SIZE tx_size) {
return (int)(tx_size - TX_4X4);
}
-static INLINE TX_SIZE depth_to_tx_size(const int depth) {
+static INLINE TX_SIZE depth_to_tx_size(int depth) {
return (TX_SIZE)(depth + TX_4X4);
}
@@ -1140,7 +1140,7 @@
is_interintra_allowed_ref(mbmi->ref_frame);
}
-static INLINE int is_interintra_allowed_bsize_group(const int group) {
+static INLINE int is_interintra_allowed_bsize_group(int group) {
int i;
for (i = 0; i < BLOCK_SIZES; i++) {
if (size_group_lookup[i] == group &&
@@ -1323,7 +1323,7 @@
}
#endif // CONFIG_GLOBAL_MOTION
-static INLINE PLANE_TYPE get_plane_type(const int plane) {
+static INLINE PLANE_TYPE get_plane_type(int plane) {
return (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
}
diff --git a/av1/common/entropy.h b/av1/common/entropy.h
index b12b171..b02d41b 100644
--- a/av1/common/entropy.h
+++ b/av1/common/entropy.h
@@ -404,22 +404,21 @@
#if CONFIG_EC_ADAPT
void av1_average_tile_coef_cdfs(struct frame_contexts *fc,
struct frame_contexts *ec_ctxs[],
- aom_cdf_prob *cdf_ptrs[], const int num_tiles);
+ aom_cdf_prob *cdf_ptrs[], int num_tiles);
void av1_average_tile_mv_cdfs(struct frame_contexts *fc,
struct frame_contexts *ec_ctxs[],
- aom_cdf_prob *cdf_ptrs[], const int num_tiles);
+ aom_cdf_prob *cdf_ptrs[], int num_tiles);
void av1_average_tile_intra_cdfs(struct frame_contexts *fc,
struct frame_contexts *ec_ctxs[],
- aom_cdf_prob *cdf_ptrs[], const int num_tiles);
+ aom_cdf_prob *cdf_ptrs[], int num_tiles);
void av1_average_tile_inter_cdfs(struct AV1Common *cm,
struct frame_contexts *fc,
struct frame_contexts *ec_ctxs[],
- aom_cdf_prob *cdf_ptrs[], const int num_tiles);
+ aom_cdf_prob *cdf_ptrs[], int num_tiles);
#if CONFIG_PVQ
void av1_default_pvq_probs(struct AV1Common *cm);
void av1_average_tile_pvq_cdfs(struct frame_contexts *fc,
- struct frame_contexts *ec_ctxs[],
- const int num_tiles);
+ struct frame_contexts *ec_ctxs[], int num_tiles);
#endif // CONFIG_PVQ
#endif // CONFIG_EC_ADAPT
#ifdef __cplusplus
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 41114c5..4d3ae11 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -736,10 +736,8 @@
}
#if CONFIG_CB4X4
-static INLINE int is_chroma_reference(const int mi_row, const int mi_col,
- const BLOCK_SIZE bsize,
- const int subsampling_x,
- const int subsampling_y) {
+static INLINE int is_chroma_reference(int mi_row, int mi_col, BLOCK_SIZE bsize,
+ int subsampling_x, int subsampling_y) {
#if CONFIG_CHROMA_2X2
return 1;
#endif
@@ -751,9 +749,8 @@
return ref_pos;
}
-static INLINE BLOCK_SIZE scale_chroma_bsize(const BLOCK_SIZE bsize,
- const int subsampling_x,
- const int subsampling_y) {
+static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x,
+ int subsampling_y) {
BLOCK_SIZE bs = bsize;
if (bs < BLOCK_8X8) {
@@ -847,8 +844,8 @@
#endif
}
-static INLINE int max_block_wide(const MACROBLOCKD *xd, const BLOCK_SIZE bsize,
- const int plane) {
+static INLINE int max_block_wide(const MACROBLOCKD *xd, BLOCK_SIZE bsize,
+ int plane) {
int max_blocks_wide = block_size_wide[bsize];
const struct macroblockd_plane *const pd = &xd->plane[plane];
@@ -859,8 +856,8 @@
return max_blocks_wide >> tx_size_wide_log2[0];
}
-static INLINE int max_block_high(const MACROBLOCKD *xd, const BLOCK_SIZE bsize,
- const int plane) {
+static INLINE int max_block_high(const MACROBLOCKD *xd, BLOCK_SIZE bsize,
+ int plane) {
int max_blocks_high = block_size_high[bsize];
const struct macroblockd_plane *const pd = &xd->plane[plane];
@@ -900,7 +897,7 @@
}
#if CONFIG_VAR_TX
-static INLINE TX_SIZE get_min_tx_size(const TX_SIZE tx_size) {
+static INLINE TX_SIZE get_min_tx_size(TX_SIZE tx_size) {
if (tx_size >= TX_SIZES_ALL) assert(0);
return txsize_sqr_map[tx_size];
}
@@ -910,8 +907,8 @@
for (i = 0; i < len; ++i) txfm_ctx[i] = txs;
}
-static INLINE void set_txfm_ctxs(TX_SIZE tx_size, int n8_w, int n8_h,
- const int skip, const MACROBLOCKD *xd) {
+static INLINE void set_txfm_ctxs(TX_SIZE tx_size, int n8_w, int n8_h, int skip,
+ const MACROBLOCKD *xd) {
uint8_t bw = tx_size_wide[tx_size];
uint8_t bh = tx_size_high[tx_size];
@@ -939,8 +936,7 @@
static INLINE int txfm_partition_context(TXFM_CONTEXT *above_ctx,
TXFM_CONTEXT *left_ctx,
- const BLOCK_SIZE bsize,
- const TX_SIZE tx_size) {
+ BLOCK_SIZE bsize, TX_SIZE tx_size) {
const uint8_t txw = tx_size_wide[tx_size];
const uint8_t txh = tx_size_high[tx_size];
const int above = *above_ctx < txw;
@@ -972,8 +968,8 @@
#endif
static INLINE PARTITION_TYPE get_partition(const AV1_COMMON *const cm,
- const int mi_row, const int mi_col,
- const BLOCK_SIZE bsize) {
+ int mi_row, int mi_col,
+ BLOCK_SIZE bsize) {
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) {
return PARTITION_INVALID;
} else {
@@ -1013,7 +1009,7 @@
}
}
-static INLINE void set_sb_size(AV1_COMMON *const cm, const BLOCK_SIZE sb_size) {
+static INLINE void set_sb_size(AV1_COMMON *const cm, BLOCK_SIZE sb_size) {
cm->sb_size = sb_size;
cm->mib_size = mi_size_wide[cm->sb_size];
#if CONFIG_CB4X4
diff --git a/av1/common/tile_common.c b/av1/common/tile_common.c
index f61acab..b8008ac 100644
--- a/av1/common/tile_common.c
+++ b/av1/common/tile_common.c
@@ -56,19 +56,19 @@
#define MAX_TILE_WIDTH_MAX_SB 64
#endif // CONFIG_EXT_PARTITION
-static int get_min_log2_tile_cols(const int max_sb_cols) {
+static int get_min_log2_tile_cols(int max_sb_cols) {
int min_log2 = 0;
while ((MAX_TILE_WIDTH_MAX_SB << min_log2) < max_sb_cols) ++min_log2;
return min_log2;
}
-static int get_max_log2_tile_cols(const int max_sb_cols) {
+static int get_max_log2_tile_cols(int max_sb_cols) {
int max_log2 = 1;
while ((max_sb_cols >> max_log2) >= MIN_TILE_WIDTH_MAX_SB) ++max_log2;
return max_log2 - 1;
}
-void av1_get_tile_n_bits(const int mi_cols, int *min_log2_tile_cols,
+void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols,
int *max_log2_tile_cols) {
const int max_sb_cols =
ALIGN_POWER_OF_TWO(mi_cols, MAX_MIB_SIZE_LOG2) >> MAX_MIB_SIZE_LOG2;
diff --git a/av1/common/tile_common.h b/av1/common/tile_common.h
index 516896a..617dda2 100644
--- a/av1/common/tile_common.h
+++ b/av1/common/tile_common.h
@@ -41,7 +41,7 @@
void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *cm,
int row, int col);
#endif
-void av1_get_tile_n_bits(const int mi_cols, int *min_log2_tile_cols,
+void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols,
int *max_log2_tile_cols);
void av1_update_boundary_info(const struct AV1Common *cm,
diff --git a/av1/common/warped_motion.c b/av1/common/warped_motion.c
index c74609d..34ae487 100644
--- a/av1/common/warped_motion.c
+++ b/av1/common/warped_motion.c
@@ -1453,7 +1453,7 @@
(((a) * (b)*4 + ((a) + (b)) * 2 * LS_STEP + LS_STEP * LS_STEP * 2) >> 2)
#if LEAST_SQUARES_ORDER == 2
-static int find_affine_int(const int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
+static int find_affine_int(int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
int mvy, int mvx, WarpedMotionParams *wm, int mi_row,
int mi_col) {
int32_t A[2][2] = { { 0, 0 }, { 0, 0 } };
@@ -1586,7 +1586,7 @@
#else
-static int find_affine_int(const int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
+static int find_affine_int(int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
int mvy, int mvx, WarpedMotionParams *wm, int mi_row,
int mi_col) {
int32_t A[3][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } };
@@ -1742,8 +1742,8 @@
}
#endif // LEAST_SQUARES_ORDER == 2
-int find_projection(const int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
- int mvy, int mvx, WarpedMotionParams *wm_params, int mi_row,
+int find_projection(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, int mvy,
+ int mvx, WarpedMotionParams *wm_params, int mi_row,
int mi_col) {
int result = 1;
switch (wm_params->wmtype) {
diff --git a/av1/common/warped_motion.h b/av1/common/warped_motion.h
index dea7cfd..72b511f 100644
--- a/av1/common/warped_motion.h
+++ b/av1/common/warped_motion.h
@@ -89,8 +89,8 @@
int p_height, int p_stride, int subsampling_x,
int subsampling_y, int x_scale, int y_scale, int ref_frm);
-int find_projection(const int np, int *pts1, int *pts2, BLOCK_SIZE bsize,
- int mvy, int mvx, WarpedMotionParams *wm_params, int mi_row,
+int find_projection(int np, int *pts1, int *pts2, BLOCK_SIZE bsize, int mvy,
+ int mvx, WarpedMotionParams *wm_params, int mi_row,
int mi_col);
int get_shear_params(WarpedMotionParams *wm);
diff --git a/av1/common/x86/av1_highbd_convolve_sse4.c b/av1/common/x86/av1_highbd_convolve_sse4.c
index c154c6b..cf6249b 100644
--- a/av1/common/x86/av1_highbd_convolve_sse4.c
+++ b/av1/common/x86/av1_highbd_convolve_sse4.c
@@ -25,7 +25,7 @@
typedef int16_t (*HbdSubpelFilterCoeffs)[8];
-typedef void (*TransposeSave)(const int width, int pixelsNum, uint32_t *src,
+typedef void (*TransposeSave)(int width, int pixelsNum, uint32_t *src,
int src_stride, uint16_t *dst, int dst_stride,
int bd);
@@ -180,14 +180,14 @@
// pixelsNum = 0 : all 4 rows of pixels will be saved.
// pixelsNum = 1/2/3 : residual 1/2/4 rows of pixels will be saved.
-void trans_save_4x4(const int width, int pixelsNum, uint32_t *src,
- int src_stride, uint16_t *dst, int dst_stride, int bd) {
+void trans_save_4x4(int width, int pixelsNum, uint32_t *src, int src_stride,
+ uint16_t *dst, int dst_stride, int bd) {
__m128i u[4];
transClipPixel(src, src_stride, u, bd);
writePixel(u, width, pixelsNum, dst, dst_stride);
}
-void trans_accum_save_4x4(const int width, int pixelsNum, uint32_t *src,
+void trans_accum_save_4x4(int width, int pixelsNum, uint32_t *src,
int src_stride, uint16_t *dst, int dst_stride,
int bd) {
__m128i u[4], v[4];
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 19a96d2..056ff6f 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -1449,8 +1449,8 @@
}
}
-static void set_segment_id_supertx(const AV1_COMMON *const cm, const int mi_row,
- const int mi_col, const BLOCK_SIZE bsize) {
+static void set_segment_id_supertx(const AV1_COMMON *const cm, int mi_row,
+ int mi_col, BLOCK_SIZE bsize) {
const struct segmentation *seg = &cm->seg;
const int miw = AOMMIN(mi_size_wide[bsize], cm->mi_cols - mi_col);
const int mih = AOMMIN(mi_size_high[bsize], cm->mi_rows - mi_row);
@@ -3065,7 +3065,7 @@
#endif
}
-static int mem_get_varsize(const uint8_t *src, const int sz) {
+static int mem_get_varsize(const uint8_t *src, int sz) {
switch (sz) {
case 1: return src[0];
case 2: return mem_get_le16(src);
@@ -4859,9 +4859,8 @@
}
#if CONFIG_EC_ADAPT
-static void make_update_tile_list_dec(AV1Decoder *pbi, const int tile_rows,
- const int tile_cols,
- FRAME_CONTEXT *ec_ctxs[]) {
+static void make_update_tile_list_dec(AV1Decoder *pbi, int tile_rows,
+ int tile_cols, FRAME_CONTEXT *ec_ctxs[]) {
int i;
for (i = 0; i < tile_rows * tile_cols; ++i)
ec_ctxs[i] = &pbi->tile_data[i].tctx;
diff --git a/av1/encoder/encodemb.h b/av1/encoder/encodemb.h
index fe54690..73fde1d 100644
--- a/av1/encoder/encodemb.h
+++ b/av1/encoder/encodemb.h
@@ -43,8 +43,8 @@
AV1_XFORM_QUANT_TYPES,
} AV1_XFORM_QUANT;
-void av1_encode_sb(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize,
- const int mi_row, const int mi_col);
+void av1_encode_sb(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row,
+ int mi_col);
#if CONFIG_SUPERTX
void av1_encode_sb_supertx(AV1_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE bsize);
#endif // CONFIG_SUPERTX
@@ -69,8 +69,8 @@
void av1_encode_intra_block_plane(AV1_COMMON *cm, MACROBLOCK *x,
BLOCK_SIZE bsize, int plane,
- int enable_optimize_b, const int mi_row,
- const int mi_col);
+ int enable_optimize_b, int mi_row,
+ int mi_col);
#if CONFIG_PVQ
PVQ_SKIP_TYPE av1_pvq_encode_helper(MACROBLOCK *x, tran_low_t *const coeff,
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 7e5a661..d746264 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -848,7 +848,7 @@
&cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME : 0];
}
-static INLINE int get_chessboard_index(const int frame_index) {
+static INLINE int get_chessboard_index(int frame_index) {
return frame_index & 0x1;
}
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index d0ce9a6..3f71a44 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -560,7 +560,7 @@
void av1_update_txb_context(const AV1_COMP *cpi, ThreadData *td,
RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate,
- const int mi_row, const int mi_col) {
+ int mi_row, int mi_col) {
const AV1_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd;
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index d8fab61..f5745f2 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -362,7 +362,7 @@
return besterr;
}
-static INLINE int divide_and_round(const int n, const int d) {
+static INLINE int divide_and_round(int n, int d) {
return ((n < 0) ^ (d < 0)) ? ((n - d / 2) / d) : ((n + d / 2) / d);
}
diff --git a/av1/encoder/ransac.c b/av1/encoder/ransac.c
index 198bc39..976e52d 100644
--- a/av1/encoder/ransac.c
+++ b/av1/encoder/ransac.c
@@ -569,8 +569,7 @@
params[6] = params[7] = 0;
}
-static int find_translation(const int np, double *pts1, double *pts2,
- double *mat) {
+static int find_translation(int np, double *pts1, double *pts2, double *mat) {
int i;
double sx, sy, dx, dy;
double sumx, sumy;
@@ -596,7 +595,7 @@
return 0;
}
-static int find_rotzoom(const int np, double *pts1, double *pts2, double *mat) {
+static int find_rotzoom(int np, double *pts1, double *pts2, double *mat) {
const int np2 = np * 2;
double *a = (double *)aom_malloc(sizeof(*a) * np2 * 9);
double *b = a + np2 * 4;
@@ -636,7 +635,7 @@
return 0;
}
-static int find_affine(const int np, double *pts1, double *pts2, double *mat) {
+static int find_affine(int np, double *pts1, double *pts2, double *mat) {
const int np2 = np * 2;
double *a = (double *)aom_malloc(sizeof(*a) * np2 * 13);
double *b = a + np2 * 6;
@@ -680,8 +679,7 @@
return 0;
}
-static int find_vertrapezoid(const int np, double *pts1, double *pts2,
- double *mat) {
+static int find_vertrapezoid(int np, double *pts1, double *pts2, double *mat) {
const int np3 = np * 3;
double *a = (double *)aom_malloc(sizeof(*a) * np3 * 14);
double *U = a + np3 * 7;
@@ -750,8 +748,7 @@
return 0;
}
-static int find_hortrapezoid(const int np, double *pts1, double *pts2,
- double *mat) {
+static int find_hortrapezoid(int np, double *pts1, double *pts2, double *mat) {
const int np3 = np * 3;
double *a = (double *)aom_malloc(sizeof(*a) * np3 * 14);
double *U = a + np3 * 7;
@@ -820,8 +817,7 @@
return 0;
}
-static int find_homography(const int np, double *pts1, double *pts2,
- double *mat) {
+static int find_homography(int np, double *pts1, double *pts2, double *mat) {
// Implemented from Peter Kovesi's normalized implementation
const int np3 = np * 3;
double *a = (double *)aom_malloc(sizeof(*a) * np3 * 18);
diff --git a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
index 53e970f..198e4e4 100644
--- a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
+++ b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
@@ -1535,7 +1535,7 @@
load_buffer_16x16(botR, stride, flipud, fliplr, in1 + 16);
}
-static INLINE void right_shift_32x32_16col(const int bit, __m256i *in) {
+static INLINE void right_shift_32x32_16col(int bit, __m256i *in) {
int i = 0;
const __m256i rounding = _mm256_set1_epi16((1 << bit) >> 1);
__m256i sign;