From 209c6cbf8f8ffcd0a43a9deaad0516aca8d59a9f Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Fri, 27 Sep 2013 14:11:13 -0700 Subject: Removing vp9_get_coef_neighbors_handle function. Change-Id: I6be72c8b048d1ccc7ef43764cf84c32360098970 --- vp9/common/vp9_entropy.c | 25 ------------------------- vp9/common/vp9_entropy.h | 11 +++++------ vp9/decoder/vp9_detokenize.c | 3 +-- vp9/encoder/vp9_encodemb.c | 3 +-- vp9/encoder/vp9_rdopt.c | 7 ++++--- vp9/encoder/vp9_tokenize.c | 3 +-- 6 files changed, 12 insertions(+), 40 deletions(-) (limited to 'vp9') diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c index 32d9e0cf7..f171c317f 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -569,31 +569,6 @@ void vp9_init_neighbors() { vp9_default_scan_32x32_neighbors); } -const int16_t *vp9_get_coef_neighbors_handle(const int16_t *scan) { - if (scan == vp9_default_scan_4x4) { - return vp9_default_scan_4x4_neighbors; - } else if (scan == vp9_row_scan_4x4) { - return vp9_row_scan_4x4_neighbors; - } else if (scan == vp9_col_scan_4x4) { - return vp9_col_scan_4x4_neighbors; - } else if (scan == vp9_default_scan_8x8) { - return vp9_default_scan_8x8_neighbors; - } else if (scan == vp9_row_scan_8x8) { - return vp9_row_scan_8x8_neighbors; - } else if (scan == vp9_col_scan_8x8) { - return vp9_col_scan_8x8_neighbors; - } else if (scan == vp9_default_scan_16x16) { - return vp9_default_scan_16x16_neighbors; - } else if (scan == vp9_row_scan_16x16) { - return vp9_row_scan_16x16_neighbors; - } else if (scan == vp9_col_scan_16x16) { - return vp9_col_scan_16x16_neighbors; - } else { - assert(scan == vp9_default_scan_32x32); - return vp9_default_scan_32x32_neighbors; - } -} - void vp9_coef_tree_initialize() { vp9_init_neighbors(); init_bit_trees(); diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index c1f2d782b..4ed94815b 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -190,9 +190,6 @@ static INLINE int get_coef_context(const int16_t *neighbors, token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1; } -const int16_t *vp9_get_coef_neighbors_handle(const int16_t *scan); - - // 128 lists of probabilities are stored for the following ONE node probs: // 1, 3, 5, 7, ..., 253, 255 // In between probabilities are interpolated linearly @@ -367,22 +364,24 @@ static int get_entropy_context(TX_SIZE tx_size, static void get_scan_and_band(const MACROBLOCKD *xd, TX_SIZE tx_size, PLANE_TYPE type, int block_idx, const int16_t **scan, + const int16_t **scan_nb, const uint8_t **band_translate) { switch (tx_size) { case TX_4X4: - *scan = get_scan_4x4(get_tx_type_4x4(type, xd, block_idx)); + get_scan_nb_4x4(get_tx_type_4x4(type, xd, block_idx), scan, scan_nb); *band_translate = vp9_coefband_trans_4x4; break; case TX_8X8: - *scan = get_scan_8x8(get_tx_type_8x8(type, xd)); + get_scan_nb_8x8(get_tx_type_8x8(type, xd), scan, scan_nb); *band_translate = vp9_coefband_trans_8x8plus; break; case TX_16X16: - *scan = get_scan_16x16(get_tx_type_16x16(type, xd)); + get_scan_nb_16x16(get_tx_type_16x16(type, xd), scan, scan_nb); *band_translate = vp9_coefband_trans_8x8plus; break; case TX_32X32: *scan = vp9_default_scan_32x32; + *scan_nb = vp9_default_scan_32x32_neighbors; *band_translate = vp9_coefband_trans_8x8plus; break; default: diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c index 3792b9c78..e77862e72 100644 --- a/vp9/decoder/vp9_detokenize.c +++ b/vp9/decoder/vp9_detokenize.c @@ -106,8 +106,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, const uint8_t *band_translate; uint8_t token_cache[1024]; int pt = get_entropy_context(tx_size, A, L); - get_scan_and_band(xd, tx_size, type, block_idx, &scan, &band_translate); - nb = vp9_get_coef_neighbors_handle(scan); + get_scan_and_band(xd, tx_size, type, block_idx, &scan, &nb, &band_translate); while (1) { int val; diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 058bde66f..fae4e6a8f 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -172,7 +172,7 @@ static void optimize_b(MACROBLOCK *mb, assert((!type && !plane) || (type && plane)); dqcoeff_ptr = BLOCK_OFFSET(pd->dqcoeff, block); qcoeff_ptr = BLOCK_OFFSET(pd->qcoeff, block); - get_scan_and_band(xd, tx_size, type, ib, &scan, &band_translate); + get_scan_and_band(xd, tx_size, type, ib, &scan, &nb, &band_translate); assert(eob <= default_eob); /* Now set up a Viterbi trellis to evaluate alternative roundings. */ @@ -191,7 +191,6 @@ static void optimize_b(MACROBLOCK *mb, for (i = 0; i < eob; i++) token_cache[scan[i]] = vp9_pt_energy_class[vp9_dct_value_tokens_ptr[ qcoeff_ptr[scan[i]]].token]; - nb = vp9_get_coef_neighbors_handle(scan); for (i = eob; i-- > i0;) { int base_bits, d2, dx; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 8b911e669..4a971f421 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1097,6 +1097,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib, for (idx = 0; idx < num_4x4_blocks_wide; ++idx) { int64_t ssz; const int16_t *scan; + const int16_t *nb; uint8_t *src = src_init + idx * 4 + idy * 4 * src_stride; uint8_t *dst = dst_init + idx * 4 + idy * 4 * dst_stride; @@ -1122,10 +1123,10 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib, x->quantize_b_4x4(x, block, tx_type, 16); } - scan = get_scan_4x4(get_tx_type_4x4(PLANE_TYPE_Y_WITH_DC, xd, block)); + get_scan_nb_4x4(get_tx_type_4x4(PLANE_TYPE_Y_WITH_DC, xd, block), + &scan, &nb); ratey += cost_coeffs(x, 0, block, - tempa + idx, templ + idy, TX_4X4, scan, - vp9_get_coef_neighbors_handle(scan)); + tempa + idx, templ + idy, TX_4X4, scan, nb); distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, block), 16, &ssz) >> 2; if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index a59f6db88..7c14c18aa 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -137,8 +137,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, pt = get_entropy_context(tx_size, pd->above_context + aoff, pd->left_context + loff); - get_scan_and_band(xd, tx_size, type, block, &scan, &band_translate); - nb = vp9_get_coef_neighbors_handle(scan); + get_scan_and_band(xd, tx_size, type, block, &scan, &nb, &band_translate); c = 0; do { const int band = get_coef_band(band_translate, c); -- cgit v1.2.3