From 35a83677a534f3e100eb118ea85eeedb495bc621 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Wed, 21 May 2014 11:09:44 -0700 Subject: Moving itxm_add pointer from MACROBLOCKD to MACROBLOCK. The final goal is eventually to get rid of both itxm_add and fwd_txm4x4. This patch does it in the decoder. Change-Id: Ibb3db57efbcbb1ac387c6742538a9fcf2c6f24a5 --- vp9/encoder/vp9_block.h | 1 + vp9/encoder/vp9_encodeframe.c | 4 ++-- vp9/encoder/vp9_encodemb.c | 6 +++--- vp9/encoder/vp9_encoder.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'vp9/encoder') diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h index c406860a0..c3cd93b78 100644 --- a/vp9/encoder/vp9_block.h +++ b/vp9/encoder/vp9_block.h @@ -109,6 +109,7 @@ struct macroblock { MV pred_mv[MAX_REF_FRAMES]; void (*fwd_txm4x4)(const int16_t *input, int16_t *output, int stride); + void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob); }; #ifdef __cplusplus diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index ef33fcaf1..b4c867182 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -2384,7 +2384,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { if (lossless) { // printf("Switching to lossless\n"); cpi->mb.fwd_txm4x4 = vp9_fwht4x4; - cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add; + cpi->mb.itxm_add = vp9_iwht4x4_add; cpi->mb.optimize = 0; cpi->common.lf.filter_level = 0; cpi->zbin_mode_boost_enabled = 0; @@ -2392,7 +2392,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { } else { // printf("Not lossless\n"); cpi->mb.fwd_txm4x4 = vp9_fdct4x4; - cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add; + cpi->mb.itxm_add = vp9_idct4x4_add; } } diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 3b231b7f2..8581e6117 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -406,7 +406,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, // this is like vp9_short_idct4x4 but has a special case around eob<=1 // which is significant (not just an optimization) for the lossless // case. - xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); + x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); break; default: assert(0 && "Invalid transform size"); @@ -428,7 +428,7 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize, vp9_xform_quant(x, plane, block, plane_bsize, tx_size); if (p->eobs[block] > 0) - xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); + x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); } void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) { @@ -574,7 +574,7 @@ static void encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, // this is like vp9_short_idct4x4 but has a special case around eob<=1 // which is significant (not just an optimization) for the lossless // case. - xd->itxm_add(dqcoeff, dst, dst_stride, *eob); + x->itxm_add(dqcoeff, dst, dst_stride, *eob); else vp9_iht4x4_16_add(dqcoeff, dst, dst_stride, tx_type); } diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 1f68f03c4..a918dde19 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -602,9 +602,9 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { // is set. cpi->oxcf.worst_allowed_q = 0; cpi->oxcf.best_allowed_q = 0; - cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add; + cpi->mb.itxm_add = vp9_iwht4x4_add; } else { - cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add; + cpi->mb.itxm_add = vp9_idct4x4_add; } rc->baseline_gf_interval = DEFAULT_GF_INTERVAL; cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG; -- cgit v1.2.3