From c64e23832fd1841d3559ab53d2cd5cc37f734757 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Mon, 30 Sep 2013 14:50:15 -0700 Subject: [PATCH] Adding const to function arguments. Function list: tx_counts_to_branch_counts_32x32 tx_counts_to_branch_counts_8x8 tx_counts_to_branch_counts_8x8 update_ct update_ct2 update_mode_probs Change-Id: I120d8945a34378cf285d6bd415e23de1d522cf2f --- vp9/common/vp9_entropymode.c | 20 +++++++++++--------- vp9/common/vp9_entropymode.h | 6 +++--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index 93c89b03a..e17679616 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -286,7 +286,7 @@ static const struct tx_probs default_tx_probs = { { 66 } } }; -void tx_counts_to_branch_counts_32x32(unsigned int *tx_count_32x32p, +void tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p, unsigned int (*ct_32x32p)[2]) { ct_32x32p[0][0] = tx_count_32x32p[TX_4X4]; ct_32x32p[0][1] = tx_count_32x32p[TX_8X8] + @@ -299,7 +299,7 @@ void tx_counts_to_branch_counts_32x32(unsigned int *tx_count_32x32p, ct_32x32p[2][1] = tx_count_32x32p[TX_32X32]; } -void tx_counts_to_branch_counts_16x16(unsigned int *tx_count_16x16p, +void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p, unsigned int (*ct_16x16p)[2]) { ct_16x16p[0][0] = tx_count_16x16p[TX_4X4]; ct_16x16p[0][1] = tx_count_16x16p[TX_8X8] + tx_count_16x16p[TX_16X16]; @@ -307,7 +307,7 @@ void tx_counts_to_branch_counts_16x16(unsigned int *tx_count_16x16p, ct_16x16p[1][1] = tx_count_16x16p[TX_16X16]; } -void tx_counts_to_branch_counts_8x8(unsigned int *tx_count_8x8p, +void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p, unsigned int (*ct_8x8p)[2]) { ct_8x8p[0][0] = tx_count_8x8p[TX_4X4]; ct_8x8p[0][1] = tx_count_8x8p[TX_8X8]; @@ -356,17 +356,19 @@ void vp9_entropy_mode_init() { #define COUNT_SAT 20 #define MAX_UPDATE_FACTOR 128 -static int update_ct(vp9_prob pre_prob, vp9_prob prob, unsigned int ct[2]) { +static int update_ct(vp9_prob pre_prob, vp9_prob prob, + const unsigned int ct[2]) { return merge_probs(pre_prob, prob, ct, COUNT_SAT, MAX_UPDATE_FACTOR); } -static int update_ct2(vp9_prob pre_prob, unsigned int ct[2]) { +static int update_ct2(vp9_prob pre_prob, const unsigned int ct[2]) { return merge_probs2(pre_prob, ct, COUNT_SAT, MAX_UPDATE_FACTOR); } static void update_mode_probs(int n_modes, - const vp9_tree_index *tree, unsigned int *cnt, - vp9_prob *pre_probs, vp9_prob *dst_probs, + const vp9_tree_index *tree, + const unsigned int *cnt, + const vp9_prob *pre_probs, vp9_prob *dst_probs, unsigned int tok0_offset) { #define MAX_PROBS 32 vp9_prob probs[MAX_PROBS]; @@ -382,8 +384,8 @@ static void update_mode_probs(int n_modes, void vp9_adapt_mode_probs(VP9_COMMON *cm) { int i, j; FRAME_CONTEXT *fc = &cm->fc; - FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx]; - FRAME_COUNTS *counts = &cm->counts; + const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx]; + const FRAME_COUNTS *counts = &cm->counts; for (i = 0; i < INTRA_INTER_CONTEXTS; i++) fc->intra_inter_prob[i] = update_ct2(pre_fc->intra_inter_prob[i], diff --git a/vp9/common/vp9_entropymode.h b/vp9/common/vp9_entropymode.h index 31537c7f7..ccade2752 100644 --- a/vp9/common/vp9_entropymode.h +++ b/vp9/common/vp9_entropymode.h @@ -61,11 +61,11 @@ void vp9_init_mbmode_probs(struct VP9Common *cm); void vp9_adapt_mode_probs(struct VP9Common *cm); -void tx_counts_to_branch_counts_32x32(unsigned int *tx_count_32x32p, +void tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p, unsigned int (*ct_32x32p)[2]); -void tx_counts_to_branch_counts_16x16(unsigned int *tx_count_16x16p, +void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p, unsigned int (*ct_16x16p)[2]); -void tx_counts_to_branch_counts_8x8(unsigned int *tx_count_8x8p, +void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p, unsigned int (*ct_8x8p)[2]); #endif // VP9_COMMON_VP9_ENTROPYMODE_H_ -- 2.40.0