diff options
author | John Koleszar <jkoleszar@google.com> | 2013-02-14 18:02:55 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-02-14 18:02:55 -0800 |
commit | 716db10f0d3c1ded6125229864fe5a78e7d0c203 (patch) | |
tree | 11e857daa3f23a31fe2d9bba92d9048a34e115ad /vp9 | |
parent | 03f28c0a12141431de8076970c503ee839d2a268 (diff) | |
parent | ae886d6bffb9cd3e889aaaed90644927e3ee34c3 (diff) | |
download | libvpx-716db10f0d3c1ded6125229864fe5a78e7d0c203.tar libvpx-716db10f0d3c1ded6125229864fe5a78e7d0c203.tar.gz libvpx-716db10f0d3c1ded6125229864fe5a78e7d0c203.tar.bz2 libvpx-716db10f0d3c1ded6125229864fe5a78e7d0c203.zip |
Merge "Moved vp9_get_coef_band to header file" into experimental
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/common/vp9_entropy.c | 7 | ||||
-rw-r--r-- | vp9/common/vp9_entropy.h | 8 | ||||
-rw-r--r-- | vp9/decoder/vp9_detokenize.c | 8 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodemb.c | 8 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 8 | ||||
-rw-r--r-- | vp9/encoder/vp9_tokenize.c | 4 |
6 files changed, 21 insertions, 22 deletions
diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c index 119624a33..df0bf0083 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -244,13 +244,6 @@ int vp9_get_coef_context(int * recent_energy, int token) { return vp9_prev_token_class[token]; }; -int vp9_get_coef_band(int coef_index) { - if (coef_index < 32) - return vp9_coef_bands[coef_index]; - else - return 7; -} - void vp9_default_coef_probs(VP9_COMMON *pc) { vpx_memcpy(pc->fc.coef_probs_4x4, default_coef_probs_4x4, sizeof(pc->fc.coef_probs_4x4)); diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index 4b6902ec5..d331bbccb 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -122,6 +122,12 @@ static void vp9_reset_mb_tokens_context(MACROBLOCKD* const xd) { vpx_memset(xd->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)); } +extern const int vp9_coef_bands[32]; +static int get_coef_band(int coef_index) { + if (coef_index < 32) + return vp9_coef_bands[coef_index]; + else + return 7; +} extern int vp9_get_coef_context(int * recent_energy, int token); -extern int vp9_get_coef_band(int coef_index); #endif // VP9_COMMON_VP9_ENTROPY_H_ diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c index e0ad1ccfe..b6b6849f9 100644 --- a/vp9/decoder/vp9_detokenize.c +++ b/vp9/decoder/vp9_detokenize.c @@ -65,7 +65,7 @@ static int get_signed(BOOL_DECODER *br, int value_to_sign) { #define INCREMENT_COUNT(token) \ do { \ - coef_counts[type][vp9_get_coef_band(c)][pt][token]++; \ + coef_counts[type][get_coef_band(c)][pt][token]++; \ pt = vp9_get_coef_context(&recent_energy, token); \ } while (0) @@ -179,7 +179,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, int val; const uint8_t *cat6 = cat6_prob; if (c >= seg_eob) break; - prob = coef_probs[type][vp9_get_coef_band(c)][pt]; + prob = coef_probs[type][get_coef_band(c)][pt]; if (!vp9_read(br, prob[EOB_CONTEXT_NODE])) break; SKIP_START: @@ -187,7 +187,7 @@ SKIP_START: if (!vp9_read(br, prob[ZERO_CONTEXT_NODE])) { INCREMENT_COUNT(ZERO_TOKEN); ++c; - prob = coef_probs[type][vp9_get_coef_band(c)][pt]; + prob = coef_probs[type][get_coef_band(c)][pt]; goto SKIP_START; } // ONE_CONTEXT_NODE_0_ @@ -251,7 +251,7 @@ SKIP_START: } if (c < seg_eob) - coef_counts[type][vp9_get_coef_band(c)][pt][DCT_EOB_TOKEN]++; + coef_counts[type][get_coef_band(c)][pt][DCT_EOB_TOKEN]++; A0[aidx] = L0[lidx] = (c > !type); if (txfm_size >= TX_8X8 && type != PLANE_TYPE_Y2) { diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 459010a40..c5185dcf6 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -456,7 +456,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, t0 = (vp9_dct_value_tokens_ptr + x)->Token; /* Consider both possible successor states. */ if (next < default_eob) { - band = vp9_get_coef_band(i + 1); + band = get_coef_band(i + 1); pt = trellis_get_coeff_context(t0); rate0 += mb->token_costs[tx_size][type][band][pt][tokens[next][0].token]; @@ -503,7 +503,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, t0 = t1 = (vp9_dct_value_tokens_ptr + x)->Token; } if (next < default_eob) { - band = vp9_get_coef_band(i + 1); + band = get_coef_band(i + 1); if (t0 != DCT_EOB_TOKEN) { pt = trellis_get_coeff_context(t0); rate0 += mb->token_costs[tx_size][type][band][pt][ @@ -538,7 +538,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, * add a new trellis node, but we do need to update the costs. */ else { - band = vp9_get_coef_band(i + 1); + band = get_coef_band(i + 1); t0 = tokens[next][0].token; t1 = tokens[next][1].token; /* Update the cost of each path if we're past the EOB token. */ @@ -555,7 +555,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, } /* Now pick the best path through the whole trellis. */ - band = vp9_get_coef_band(i + 1); + band = get_coef_band(i + 1); VP9_COMBINEENTROPYCONTEXTS(pt, *a, *l); rate0 = tokens[next][0].rate; rate1 = tokens[next][1].rate; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 3864b891e..a05b52f36 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -489,24 +489,24 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, for (; c < eob; c++) { int v = qcoeff_ptr[scan[c]]; int t = vp9_dct_value_tokens_ptr[v].Token; - cost += token_costs[vp9_get_coef_band(c)][pt][t]; + cost += token_costs[get_coef_band(c)][pt][t]; cost += vp9_dct_value_cost_ptr[v]; pt = vp9_get_coef_context(&recent_energy, t); } if (c < seg_eob) - cost += mb->hybrid_token_costs[tx_size][type][vp9_get_coef_band(c)] + cost += mb->hybrid_token_costs[tx_size][type][get_coef_band(c)] [pt][DCT_EOB_TOKEN]; } else { int recent_energy = 0; for (; c < eob; c++) { int v = qcoeff_ptr[scan[c]]; int t = vp9_dct_value_tokens_ptr[v].Token; - cost += token_costs[vp9_get_coef_band(c)][pt][t]; + cost += token_costs[get_coef_band(c)][pt][t]; cost += vp9_dct_value_cost_ptr[v]; pt = vp9_get_coef_context(&recent_energy, t); } if (c < seg_eob) - cost += mb->token_costs[tx_size][type][vp9_get_coef_band(c)] + cost += mb->token_costs[tx_size][type][get_coef_band(c)] [pt][DCT_EOB_TOKEN]; } diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index d612eb0fc..98e04591b 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -219,7 +219,7 @@ static void tokenize_b(VP9_COMP *cpi, seg_eob = 0; do { - const int band = vp9_get_coef_band(c); + const int band = get_coef_band(c); int token; if (c < eob) { @@ -774,7 +774,7 @@ static INLINE void stuff_b(VP9_COMP *cpi, VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec); - band = vp9_get_coef_band((type == PLANE_TYPE_Y_NO_DC) ? 1 : 0); + band = get_coef_band((type == PLANE_TYPE_Y_NO_DC) ? 1 : 0); t->Token = DCT_EOB_TOKEN; t->context_tree = probs[type][band][pt]; t->skip_eob_node = 0; |