Commit 87ee34aa authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Removing unused code.

Removing block index (ib) parameter from get_tx_type_{8x8, 16x16}
functions.

Change-Id: Ia213335aae7a7cb027f97b9cc9b04519840250f1
parent 70e96221
...@@ -527,34 +527,30 @@ static TX_TYPE txfm_map(MB_PREDICTION_MODE bmode) { ...@@ -527,34 +527,30 @@ static TX_TYPE txfm_map(MB_PREDICTION_MODE bmode) {
} }
static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) { static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
TX_TYPE tx_type; MODE_INFO *const mi = xd->mode_info_context;
MODE_INFO *mi = xd->mode_info_context;
MB_MODE_INFO *const mbmi = &mi->mbmi; MB_MODE_INFO *const mbmi = &mi->mbmi;
if (xd->lossless || mbmi->ref_frame[0] != INTRA_FRAME) if (xd->lossless || mbmi->ref_frame[0] != INTRA_FRAME)
return DCT_DCT; return DCT_DCT;
if (mbmi->sb_type < BLOCK_SIZE_SB8X8) { if (mbmi->sb_type < BLOCK_SIZE_SB8X8) {
tx_type = txfm_map(mi->bmi[ib].as_mode.first); return txfm_map(mi->bmi[ib].as_mode.first);
} else { } else {
assert(mbmi->mode <= TM_PRED); assert(mbmi->mode <= TM_PRED);
tx_type = txfm_map(mbmi->mode); return txfm_map(mbmi->mode);
} }
return tx_type;
} }
static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) { static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd) {
TX_TYPE tx_type = DCT_DCT; return xd->mode_info_context->mbmi.mode <= TM_PRED
if (xd->mode_info_context->mbmi.mode <= TM_PRED) { ? txfm_map(xd->mode_info_context->mbmi.mode)
tx_type = txfm_map(xd->mode_info_context->mbmi.mode); : DCT_DCT;
}
return tx_type;
} }
static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd, int ib) { static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd) {
TX_TYPE tx_type = DCT_DCT; return xd->mode_info_context->mbmi.mode <= TM_PRED
if (xd->mode_info_context->mbmi.mode <= TM_PRED) { ? txfm_map(xd->mode_info_context->mbmi.mode)
tx_type = txfm_map(xd->mode_info_context->mbmi.mode); : DCT_DCT;
}
return tx_type;
} }
void vp9_setup_block_dptrs(MACROBLOCKD *xd, void vp9_setup_block_dptrs(MACROBLOCKD *xd,
......
...@@ -218,11 +218,11 @@ static void decode_block(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -218,11 +218,11 @@ static void decode_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
vp9_iht_add_c(tx_type, qcoeff, dst, stride, pd->eobs[block]); vp9_iht_add_c(tx_type, qcoeff, dst, stride, pd->eobs[block]);
break; break;
case TX_8X8: case TX_8X8:
tx_type = plane == 0 ? get_tx_type_8x8(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_8x8(xd) : DCT_DCT;
vp9_iht_add_8x8_c(tx_type, qcoeff, dst, stride, pd->eobs[block]); vp9_iht_add_8x8_c(tx_type, qcoeff, dst, stride, pd->eobs[block]);
break; break;
case TX_16X16: case TX_16X16:
tx_type = plane == 0 ? get_tx_type_16x16(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_16x16(xd) : DCT_DCT;
vp9_iht_add_16x16_c(tx_type, qcoeff, dst, stride, pd->eobs[block]); vp9_iht_add_16x16_c(tx_type, qcoeff, dst, stride, pd->eobs[block]);
break; break;
case TX_32X32: case TX_32X32:
......
...@@ -113,7 +113,6 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd, ...@@ -113,7 +113,6 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd,
vp9_prob *prob; vp9_prob *prob;
vp9_coeff_count_model *coef_counts; vp9_coeff_count_model *coef_counts;
const int ref = xd->mode_info_context->mbmi.ref_frame[0] != INTRA_FRAME; const int ref = xd->mode_info_context->mbmi.ref_frame[0] != INTRA_FRAME;
TX_TYPE tx_type = DCT_DCT;
const int *scan, *nb; const int *scan, *nb;
uint8_t token_cache[1024]; uint8_t token_cache[1024];
const uint8_t * band_translate; const uint8_t * band_translate;
...@@ -126,8 +125,8 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd, ...@@ -126,8 +125,8 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd,
switch (txfm_size) { switch (txfm_size) {
default: default:
case TX_4X4: { case TX_4X4: {
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ? const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
get_tx_type_4x4(xd, block_idx) : DCT_DCT; get_tx_type_4x4(xd, block_idx) : DCT_DCT;
scan = get_scan_4x4(tx_type); scan = get_scan_4x4(tx_type);
above_ec = A[0] != 0; above_ec = A[0] != 0;
left_ec = L[0] != 0; left_ec = L[0] != 0;
...@@ -136,12 +135,8 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd, ...@@ -136,12 +135,8 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd,
break; break;
} }
case TX_8X8: { case TX_8X8: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
const int sz = 1 + b_width_log2(sb_type); get_tx_type_8x8(xd) : DCT_DCT;
const int x = block_idx & ((1 << sz) - 1);
const int y = block_idx - x;
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_8x8(xd, y + (x >> 1)) : DCT_DCT;
scan = get_scan_8x8(tx_type); scan = get_scan_8x8(tx_type);
above_ec = (A[0] + A[1]) != 0; above_ec = (A[0] + A[1]) != 0;
left_ec = (L[0] + L[1]) != 0; left_ec = (L[0] + L[1]) != 0;
...@@ -150,12 +145,8 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd, ...@@ -150,12 +145,8 @@ static int decode_coefs(FRAME_CONTEXT *fc, const MACROBLOCKD *xd,
break; break;
} }
case TX_16X16: { case TX_16X16: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
const int sz = 2 + b_width_log2(sb_type); get_tx_type_16x16(xd) : DCT_DCT;
const int x = block_idx & ((1 << sz) - 1);
const int y = block_idx - x;
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_16x16(xd, y + (x >> 2)) : DCT_DCT;
scan = get_scan_16x16(tx_type); scan = get_scan_16x16(tx_type);
above_ec = (A[0] + A[1] + A[2] + A[3]) != 0; above_ec = (A[0] + A[1] + A[2] + A[3]) != 0;
left_ec = (L[0] + L[1] + L[2] + L[3]) != 0; left_ec = (L[0] + L[1] + L[2] + L[3]) != 0;
......
...@@ -164,14 +164,14 @@ static void optimize_b(VP9_COMMON *const cm, MACROBLOCK *mb, ...@@ -164,14 +164,14 @@ static void optimize_b(VP9_COMMON *const cm, MACROBLOCK *mb,
break; break;
} }
case TX_8X8: { case TX_8X8: {
const TX_TYPE tx_type = plane == 0 ? get_tx_type_8x8(xd, ib) : DCT_DCT; const TX_TYPE tx_type = plane == 0 ? get_tx_type_8x8(xd) : DCT_DCT;
scan = get_scan_8x8(tx_type); scan = get_scan_8x8(tx_type);
default_eob = 64; default_eob = 64;
band_translate = vp9_coefband_trans_8x8plus; band_translate = vp9_coefband_trans_8x8plus;
break; break;
} }
case TX_16X16: { case TX_16X16: {
const TX_TYPE tx_type = plane == 0 ? get_tx_type_16x16(xd, ib) : DCT_DCT; const TX_TYPE tx_type = plane == 0 ? get_tx_type_16x16(xd) : DCT_DCT;
scan = get_scan_16x16(tx_type); scan = get_scan_16x16(tx_type);
default_eob = 256; default_eob = 256;
band_translate = vp9_coefband_trans_8x8plus; band_translate = vp9_coefband_trans_8x8plus;
...@@ -468,14 +468,14 @@ static void xform_quant(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -468,14 +468,14 @@ static void xform_quant(int plane, int block, BLOCK_SIZE_TYPE bsize,
vp9_short_fdct32x32(src_diff, coeff, bw * 2); vp9_short_fdct32x32(src_diff, coeff, bw * 2);
break; break;
case TX_16X16: case TX_16X16:
tx_type = plane == 0 ? get_tx_type_16x16(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_16x16(xd) : DCT_DCT;
if (tx_type != DCT_DCT) if (tx_type != DCT_DCT)
vp9_short_fht16x16(src_diff, coeff, bw, tx_type); vp9_short_fht16x16(src_diff, coeff, bw, tx_type);
else else
x->fwd_txm16x16(src_diff, coeff, bw * 2); x->fwd_txm16x16(src_diff, coeff, bw * 2);
break; break;
case TX_8X8: case TX_8X8:
tx_type = plane == 0 ? get_tx_type_8x8(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_8x8(xd) : DCT_DCT;
if (tx_type != DCT_DCT) if (tx_type != DCT_DCT)
vp9_short_fht8x8(src_diff, coeff, bw, tx_type); vp9_short_fht8x8(src_diff, coeff, bw, tx_type);
else else
...@@ -519,14 +519,14 @@ static void encode_block(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -519,14 +519,14 @@ static void encode_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
vp9_short_idct32x32_add(dqcoeff, dst, pd->dst.stride); vp9_short_idct32x32_add(dqcoeff, dst, pd->dst.stride);
break; break;
case TX_16X16: case TX_16X16:
tx_type = plane == 0 ? get_tx_type_16x16(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_16x16(xd) : DCT_DCT;
if (tx_type == DCT_DCT) if (tx_type == DCT_DCT)
vp9_short_idct16x16_add(dqcoeff, dst, pd->dst.stride); vp9_short_idct16x16_add(dqcoeff, dst, pd->dst.stride);
else else
vp9_short_iht16x16_add(dqcoeff, dst, pd->dst.stride, tx_type); vp9_short_iht16x16_add(dqcoeff, dst, pd->dst.stride, tx_type);
break; break;
case TX_8X8: case TX_8X8:
tx_type = plane == 0 ? get_tx_type_8x8(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_8x8(xd) : DCT_DCT;
if (tx_type == DCT_DCT) if (tx_type == DCT_DCT)
vp9_short_idct8x8_add(dqcoeff, dst, pd->dst.stride); vp9_short_idct8x8_add(dqcoeff, dst, pd->dst.stride);
else else
...@@ -659,14 +659,14 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -659,14 +659,14 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
vp9_short_idct32x32_add(dqcoeff, dst, pd->dst.stride); vp9_short_idct32x32_add(dqcoeff, dst, pd->dst.stride);
break; break;
case TX_16X16: case TX_16X16:
tx_type = plane == 0 ? get_tx_type_16x16(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_16x16(xd) : DCT_DCT;
if (tx_type == DCT_DCT) if (tx_type == DCT_DCT)
vp9_short_idct16x16_add(dqcoeff, dst, pd->dst.stride); vp9_short_idct16x16_add(dqcoeff, dst, pd->dst.stride);
else else
vp9_short_iht16x16_add(dqcoeff, dst, pd->dst.stride, tx_type); vp9_short_iht16x16_add(dqcoeff, dst, pd->dst.stride, tx_type);
break; break;
case TX_8X8: case TX_8X8:
tx_type = plane == 0 ? get_tx_type_8x8(xd, raster_block) : DCT_DCT; tx_type = plane == 0 ? get_tx_type_8x8(xd) : DCT_DCT;
if (tx_type == DCT_DCT) if (tx_type == DCT_DCT)
vp9_short_idct8x8_add(dqcoeff, dst, pd->dst.stride); vp9_short_idct8x8_add(dqcoeff, dst, pd->dst.stride);
else else
......
...@@ -337,11 +337,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb, ...@@ -337,11 +337,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
break; break;
} }
case TX_8X8: { case TX_8X8: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
const int sz = 1 + b_width_log2(sb_type); get_tx_type_8x8(xd) : DCT_DCT;
const int x = block & ((1 << sz) - 1), y = block - x;
TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_8x8(xd, y + (x >> 1)) : DCT_DCT;
above_ec = (A[0] + A[1]) != 0; above_ec = (A[0] + A[1]) != 0;
left_ec = (L[0] + L[1]) != 0; left_ec = (L[0] + L[1]) != 0;
scan = get_scan_8x8(tx_type); scan = get_scan_8x8(tx_type);
...@@ -350,11 +347,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb, ...@@ -350,11 +347,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
break; break;
} }
case TX_16X16: { case TX_16X16: {
const BLOCK_SIZE_TYPE sb_type = xd->mode_info_context->mbmi.sb_type; const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
const int sz = 2 + b_width_log2(sb_type); get_tx_type_16x16(xd) : DCT_DCT;
const int x = block & ((1 << sz) - 1), y = block - x;
TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_16x16(xd, y + (x >> 2)) : DCT_DCT;
scan = get_scan_16x16(tx_type); scan = get_scan_16x16(tx_type);
seg_eob = 256; seg_eob = 256;
above_ec = (A[0] + A[1] + A[2] + A[3]) != 0; above_ec = (A[0] + A[1] + A[2] + A[3]) != 0;
...@@ -370,7 +364,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb, ...@@ -370,7 +364,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
band_translate = vp9_coefband_trans_8x8plus; band_translate = vp9_coefband_trans_8x8plus;
break; break;
default: default:
abort(); assert(0);
break; break;
} }
assert(eob <= seg_eob); assert(eob <= seg_eob);
......
...@@ -133,8 +133,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -133,8 +133,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
const int ref = mbmi->ref_frame[0] != INTRA_FRAME; const int ref = mbmi->ref_frame[0] != INTRA_FRAME;
ENTROPY_CONTEXT above_ec, left_ec; ENTROPY_CONTEXT above_ec, left_ec;
uint8_t token_cache[1024]; uint8_t token_cache[1024];
TX_TYPE tx_type = DCT_DCT; const uint8_t *band_translate;
const uint8_t * band_translate;
assert((!type && !plane) || (type && plane)); assert((!type && !plane) || (type && plane));
counts = cpi->coef_counts[tx_size]; counts = cpi->coef_counts[tx_size];
...@@ -142,8 +141,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -142,8 +141,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
switch (tx_size) { switch (tx_size) {
default: default:
case TX_4X4: { case TX_4X4: {
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ? const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
get_tx_type_4x4(xd, block) : DCT_DCT; get_tx_type_4x4(xd, block) : DCT_DCT;
above_ec = A[0] != 0; above_ec = A[0] != 0;
left_ec = L[0] != 0; left_ec = L[0] != 0;
seg_eob = 16; seg_eob = 16;
...@@ -152,10 +151,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -152,10 +151,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
break; break;
} }
case TX_8X8: { case TX_8X8: {
const int sz = 1 + b_width_log2(sb_type); const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
const int x = block & ((1 << sz) - 1), y = block - x; get_tx_type_8x8(xd) : DCT_DCT;
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_8x8(xd, y + (x >> 1)) : DCT_DCT;
above_ec = (A[0] + A[1]) != 0; above_ec = (A[0] + A[1]) != 0;
left_ec = (L[0] + L[1]) != 0; left_ec = (L[0] + L[1]) != 0;
seg_eob = 64; seg_eob = 64;
...@@ -164,10 +161,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize, ...@@ -164,10 +161,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
break; break;
} }
case TX_16X16: { case TX_16X16: {
const int sz = 2 + b_width_log2(sb_type); const TX_TYPE tx_type = type == PLANE_TYPE_Y_WITH_DC ?
const int x = block & ((1 << sz) - 1), y = block - x; get_tx_type_16x16(xd) : DCT_DCT;
tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_16x16(xd, y + (x >> 2)) : DCT_DCT;
above_ec = (A[0] + A[1] + A[2] + A[3]) != 0; above_ec = (A[0] + A[1] + A[2] + A[3]) != 0;
left_ec = (L[0] + L[1] + L[2] + L[3]) != 0; left_ec = (L[0] + L[1] + L[2] + L[3]) != 0;
seg_eob = 256; seg_eob = 256;
...@@ -263,8 +258,7 @@ int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { ...@@ -263,8 +258,7 @@ int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
int vp9_sby_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) { int vp9_sby_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
int result = 1; int result = 1;
struct is_skippable_args args = {xd, &result}; struct is_skippable_args args = {xd, &result};
foreach_transformed_block_in_plane(xd, bsize, 0, foreach_transformed_block_in_plane(xd, bsize, 0, is_skippable, &args);
is_skippable, &args);
return result; return result;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment