diff options
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_encodemb.c | 13 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 15 | ||||
-rw-r--r-- | vp9/encoder/vp9_tokenize.c | 16 |
3 files changed, 13 insertions, 31 deletions
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 12082a88d..459010a40 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -386,13 +386,12 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, int best, band, pt; int err_mult = plane_rd_mult[type]; int default_eob; - int const *scan, *bands; + int const *scan; switch (tx_size) { default: case TX_4X4: scan = vp9_default_zig_zag1d_4x4; - bands = vp9_coef_bands_4x4; default_eob = 16; // TODO: this isn't called (for intra4x4 modes), but will be left in // since it could be used later @@ -419,12 +418,10 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, break; case TX_8X8: scan = vp9_default_zig_zag1d_8x8; - bands = vp9_coef_bands_8x8; default_eob = 64; break; case TX_16X16: scan = vp9_default_zig_zag1d_16x16; - bands = vp9_coef_bands_16x16; default_eob = 256; break; } @@ -459,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 = bands[i + 1]; + band = vp9_get_coef_band(i + 1); pt = trellis_get_coeff_context(t0); rate0 += mb->token_costs[tx_size][type][band][pt][tokens[next][0].token]; @@ -506,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 = bands[i + 1]; + band = vp9_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][ @@ -541,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 = bands[i + 1]; + band = vp9_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. */ @@ -558,7 +555,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type, } /* Now pick the best path through the whole trellis. */ - band = bands[i + 1]; + band = vp9_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 8385a1872..3864b891e 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -431,7 +431,7 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, int c = (type == PLANE_TYPE_Y_NO_DC) ? 1 : 0; int cost = 0, seg_eob; const int segment_id = xd->mode_info_context->mbmi.segment_id; - const int *scan, *band; + const int *scan; int16_t *qcoeff_ptr = b->qcoeff; const TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ? get_tx_type(xd, b) : DCT_DCT; @@ -443,7 +443,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, switch (tx_size) { case TX_4X4: scan = vp9_default_zig_zag1d_4x4; - band = vp9_coef_bands_4x4; seg_eob = 16; if (type == PLANE_TYPE_Y_WITH_DC) { if (tx_type == ADST_DCT) { @@ -456,17 +455,14 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, case TX_8X8: if (type == PLANE_TYPE_Y2) { scan = vp9_default_zig_zag1d_4x4; - band = vp9_coef_bands_4x4; seg_eob = 4; } else { scan = vp9_default_zig_zag1d_8x8; - band = vp9_coef_bands_8x8; seg_eob = 64; } break; case TX_16X16: scan = vp9_default_zig_zag1d_16x16; - band = vp9_coef_bands_16x16; seg_eob = 256; if (type == PLANE_TYPE_UV) { const int uv_idx = ib - 16; @@ -475,7 +471,6 @@ static INLINE int cost_coeffs(MACROBLOCK *mb, break; case TX_32X32: scan = vp9_default_zig_zag1d_32x32; - band = vp9_coef_bands_32x32; seg_eob = 1024; qcoeff_ptr = xd->sb_coeff_data.qcoeff; break; @@ -494,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[band[c]][pt][t]; + cost += token_costs[vp9_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][band[c]] + cost += mb->hybrid_token_costs[tx_size][type][vp9_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[band[c]][pt][t]; + cost += token_costs[vp9_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][band[c]] + cost += mb->token_costs[tx_size][type][vp9_get_coef_band(c)] [pt][DCT_EOB_TOKEN]; } diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index 12fee9037..d612eb0fc 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -116,7 +116,7 @@ static void tokenize_b(VP9_COMP *cpi, int16_t *qcoeff_ptr = b->qcoeff; int seg_eob; const int segment_id = xd->mode_info_context->mbmi.segment_id; - const int *bands, *scan; + const int *scan; vp9_coeff_count *counts; vp9_coeff_probs *probs; const TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ? @@ -138,7 +138,6 @@ static void tokenize_b(VP9_COMP *cpi, default: case TX_4X4: seg_eob = 16; - bands = vp9_coef_bands_4x4; scan = vp9_default_zig_zag1d_4x4; if (tx_type != DCT_DCT) { counts = cpi->hybrid_coef_counts_4x4; @@ -156,7 +155,6 @@ static void tokenize_b(VP9_COMP *cpi, case TX_8X8: if (type == PLANE_TYPE_Y2) { seg_eob = 4; - bands = vp9_coef_bands_4x4; scan = vp9_default_zig_zag1d_4x4; } else { #if CONFIG_CNVCONTEXT @@ -164,7 +162,6 @@ static void tokenize_b(VP9_COMP *cpi, l_ec = (l[0] + l[1]) != 0; #endif seg_eob = 64; - bands = vp9_coef_bands_8x8; scan = vp9_default_zig_zag1d_8x8; } if (tx_type != DCT_DCT) { @@ -186,7 +183,6 @@ static void tokenize_b(VP9_COMP *cpi, } #endif seg_eob = 256; - bands = vp9_coef_bands_16x16; scan = vp9_default_zig_zag1d_16x16; if (tx_type != DCT_DCT) { counts = cpi->hybrid_coef_counts_16x16; @@ -210,7 +206,6 @@ static void tokenize_b(VP9_COMP *cpi, l_ec = l_ec != 0; #endif seg_eob = 1024; - bands = vp9_coef_bands_32x32; scan = vp9_default_zig_zag1d_32x32; counts = cpi->coef_counts_32x32; probs = cpi->common.fc.coef_probs_32x32; @@ -224,7 +219,7 @@ static void tokenize_b(VP9_COMP *cpi, seg_eob = 0; do { - const int band = bands[c]; + const int band = vp9_get_coef_band(c); int token; if (c < eob) { @@ -703,7 +698,6 @@ static INLINE void stuff_b(VP9_COMP *cpi, TX_SIZE tx_size, int dry_run) { const BLOCKD * const b = xd->block + ib; - const int *bands; vp9_coeff_count *counts; vp9_coeff_probs *probs; int pt, band; @@ -723,7 +717,6 @@ static INLINE void stuff_b(VP9_COMP *cpi, switch (tx_size) { default: case TX_4X4: - bands = vp9_coef_bands_4x4; if (tx_type != DCT_DCT) { counts = cpi->hybrid_coef_counts_4x4; probs = cpi->common.fc.hybrid_coef_probs_4x4; @@ -739,7 +732,6 @@ static INLINE void stuff_b(VP9_COMP *cpi, l_ec = (l[0] + l[1]) != 0; } #endif - bands = vp9_coef_bands_8x8; if (tx_type != DCT_DCT) { counts = cpi->hybrid_coef_counts_8x8; probs = cpi->common.fc.hybrid_coef_probs_8x8; @@ -758,7 +750,6 @@ static INLINE void stuff_b(VP9_COMP *cpi, l_ec = (l[0] + l[1] + l1[0] + l1[1]) != 0; } #endif - bands = vp9_coef_bands_16x16; if (tx_type != DCT_DCT) { counts = cpi->hybrid_coef_counts_16x16; probs = cpi->common.fc.hybrid_coef_probs_16x16; @@ -776,7 +767,6 @@ static INLINE void stuff_b(VP9_COMP *cpi, a_ec = a_ec != 0; l_ec = l_ec != 0; #endif - bands = vp9_coef_bands_32x32; counts = cpi->coef_counts_32x32; probs = cpi->common.fc.coef_probs_32x32; break; @@ -784,7 +774,7 @@ static INLINE void stuff_b(VP9_COMP *cpi, VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec); - band = bands[(type == PLANE_TYPE_Y_NO_DC) ? 1 : 0]; + band = vp9_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; |