From 7c524bbef49841c783621be9eb251ac76266d509 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 31 Oct 2013 14:34:21 -0700 Subject: [PATCH] Cleanup. Adding const to function pointer arguments. Change-Id: I12c67c8c0fa1aa7fb3f7d6cc2ef65be29c4ea292 --- vp9/common/vp9_blockd.h | 6 +++--- vp9/common/vp9_entropy.h | 16 ++++++++-------- vp9/common/vp9_reconintra.c | 2 +- vp9/common/vp9_reconintra.h | 8 ++++---- vp9/common/vp9_scan.h | 3 +-- vp9/encoder/vp9_subexp.c | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index bac40c527..769d829fb 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -421,7 +421,7 @@ static void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize, *y = (raster_mb >> tx_cols_log2) << tx_size; } -static void extend_for_intra(MACROBLOCKD* const xd, BLOCK_SIZE plane_bsize, +static void extend_for_intra(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize, int plane, int block, TX_SIZE tx_size) { struct macroblockd_plane *const pd = &xd->plane[plane]; uint8_t *const buf = pd->dst.buf; @@ -461,7 +461,7 @@ static void extend_for_intra(MACROBLOCKD* const xd, BLOCK_SIZE plane_bsize, } } } -static void set_contexts_on_border(MACROBLOCKD *xd, +static void set_contexts_on_border(const MACROBLOCKD *xd, struct macroblockd_plane *pd, BLOCK_SIZE plane_bsize, int tx_size_in_blocks, int has_eob, @@ -499,7 +499,7 @@ static void set_contexts_on_border(MACROBLOCKD *xd, L[pt] = 0; } -static void set_contexts(MACROBLOCKD *xd, struct macroblockd_plane *pd, +static void set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, int aoff, int loff) { ENTROPY_CONTEXT *const A = pd->above_context + aoff; diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index ec7d09a00..c58e852fe 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -153,8 +153,8 @@ typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS] void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full); -static int get_entropy_context(TX_SIZE tx_size, - ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) { +static int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, + const ENTROPY_CONTEXT *l) { ENTROPY_CONTEXT above_ec = 0, left_ec = 0; switch (tx_size) { @@ -163,16 +163,16 @@ static int get_entropy_context(TX_SIZE tx_size, left_ec = l[0] != 0; break; case TX_8X8: - above_ec = !!*(uint16_t *)a; - left_ec = !!*(uint16_t *)l; + above_ec = !!*(const uint16_t *)a; + left_ec = !!*(const uint16_t *)l; break; case TX_16X16: - above_ec = !!*(uint32_t *)a; - left_ec = !!*(uint32_t *)l; + above_ec = !!*(const uint32_t *)a; + left_ec = !!*(const uint32_t *)l; break; case TX_32X32: - above_ec = !!*(uint64_t *)a; - left_ec = !!*(uint64_t *)l; + above_ec = !!*(const uint64_t *)a; + left_ec = !!*(const uint64_t *)l; break; default: assert(!"Invalid transform size."); diff --git a/vp9/common/vp9_reconintra.c b/vp9/common/vp9_reconintra.c index bd609dcf0..eb643b090 100644 --- a/vp9/common/vp9_reconintra.c +++ b/vp9/common/vp9_reconintra.c @@ -369,7 +369,7 @@ static void build_intra_predictors(const uint8_t *ref, int ref_stride, } } -void vp9_predict_intra_block(MACROBLOCKD *xd, int block_idx, int bwl_in, +void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in, TX_SIZE tx_size, int mode, const uint8_t *ref, int ref_stride, uint8_t *dst, int dst_stride) { diff --git a/vp9/common/vp9_reconintra.h b/vp9/common/vp9_reconintra.h index e9d0dbf04..6e3f55c4d 100644 --- a/vp9/common/vp9_reconintra.h +++ b/vp9/common/vp9_reconintra.h @@ -14,8 +14,8 @@ #include "vpx/vpx_integer.h" #include "vp9/common/vp9_blockd.h" -void vp9_predict_intra_block(MACROBLOCKD *xd, int block_idx, int bwl_in, - TX_SIZE tx_size, int mode, - const uint8_t *ref, int ref_stride, - uint8_t *dst, int dst_stride); +void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in, + TX_SIZE tx_size, int mode, + const uint8_t *ref, int ref_stride, + uint8_t *dst, int dst_stride); #endif // VP9_COMMON_VP9_RECONINTRA_H_ diff --git a/vp9/common/vp9_scan.h b/vp9/common/vp9_scan.h index a5c8463d5..14a1a7eb0 100644 --- a/vp9/common/vp9_scan.h +++ b/vp9/common/vp9_scan.h @@ -191,8 +191,7 @@ static INLINE const int16_t* get_iscan_16x16(TX_TYPE tx_type) { } static INLINE int get_coef_context(const int16_t *neighbors, - uint8_t *token_cache, - int c) { + const uint8_t *token_cache, int c) { return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] + token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1; } diff --git a/vp9/encoder/vp9_subexp.c b/vp9/encoder/vp9_subexp.c index eb864d96c..387fc9056 100644 --- a/vp9/encoder/vp9_subexp.c +++ b/vp9/encoder/vp9_subexp.c @@ -221,7 +221,7 @@ int vp9_prob_diff_update_savings_search_model(const unsigned int *ct, } void vp9_cond_prob_diff_update(vp9_writer *w, vp9_prob *oldp, - unsigned int *ct) { + const unsigned int ct[2]) { const vp9_prob upd = DIFF_UPDATE_PROB; vp9_prob newp = get_binary_prob(ct[0], ct[1]); const int savings = vp9_prob_diff_update_savings_search(ct, *oldp, &newp,