diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 66fc1cb50cdddd63564f561158c8eed2c9dd53ef..b1af138911b6afdd338be99111b18c2f9ef626df 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -221,8 +221,6 @@ typedef struct macroblockd { int lossless; /* Inverse transform function pointers. */ - void (*inv_txm4x4_1_add)(int16_t *input, uint8_t *dest, int stride); - void (*inv_txm4x4_add)(int16_t *input, uint8_t *dest, int stride); void (*itxm_add)(int16_t *input, uint8_t *dest, int stride, int eob); struct subpix_fn_table subpix; diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index f0282b3874d318585eb48a494b68bbcba2f93603..631a27688f4de7cc1191ae4deba3e0ed0e077e8d 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -22,6 +22,7 @@ #include "vp9/common/vp9_entropymode.h" #include "vp9/common/vp9_extend.h" #include "vp9/common/vp9_findnearmv.h" +#include "vp9/common/vp9_idct.h" #include "vp9/common/vp9_mvref_common.h" #include "vp9/common/vp9_pred_common.h" #include "vp9/common/vp9_quant_common.h" @@ -1862,8 +1863,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { // printf("Switching to lossless\n"); cpi->mb.fwd_txm8x4 = vp9_short_walsh8x4; cpi->mb.fwd_txm4x4 = vp9_short_walsh4x4; - cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_iwht4x4_1_add; - cpi->mb.e_mbd.inv_txm4x4_add = vp9_iwht4x4_16_add; + cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add; cpi->mb.optimize = 0; cpi->common.lf.filter_level = 0; cpi->zbin_mode_boost_enabled = 0; @@ -1872,8 +1872,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) { // printf("Not lossless\n"); cpi->mb.fwd_txm8x4 = vp9_short_fdct8x4; cpi->mb.fwd_txm4x4 = vp9_short_fdct4x4; - cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_idct4x4_1_add; - cpi->mb.e_mbd.inv_txm4x4_add = vp9_idct4x4_16_add; + cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add; } } diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 3eaa47d928b26efa4c518ba5963b823e9481e5c9..5c3977d5b873b5527aa5c11072cf8104c0763e8c 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -40,15 +40,6 @@ void vp9_subtract_block_c(int rows, int cols, } } -static void inverse_transform_b_4x4_add(MACROBLOCKD *xd, int eob, - int16_t *dqcoeff, uint8_t *dest, - int stride) { - if (eob <= 1) - xd->inv_txm4x4_1_add(dqcoeff, dest, stride); - else - xd->inv_txm4x4_add(dqcoeff, dest, stride); -} - static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { struct macroblock_plane *const p = &x->plane[plane]; const MACROBLOCKD *const xd = &x->e_mbd; @@ -463,8 +454,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. - inverse_transform_b_4x4_add(xd, pd->eobs[block], dqcoeff, - dst, pd->dst.stride); + xd->itxm_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]); break; default: assert(!"Invalid transform size"); @@ -631,7 +621,7 @@ void vp9_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. - inverse_transform_b_4x4_add(xd, *eob, dqcoeff, dst, pd->dst.stride); + xd->itxm_add(dqcoeff, dst, pd->dst.stride, *eob); else vp9_short_iht4x4_add(dqcoeff, dst, pd->dst.stride, tx_type); } diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 7339f42ae14f3f22ba5ecd4a4ac1af45057d3418..342ff8473a4ab733064969ff8694a1909f6097ef 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -17,6 +17,7 @@ #include "vp9/common/vp9_alloccommon.h" #include "vp9/common/vp9_filter.h" +#include "vp9/common/vp9_idct.h" #if CONFIG_VP9_POSTPROC #include "vp9/common/vp9_postproc.h" #endif @@ -1227,14 +1228,8 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level]; cpi->oxcf.lossless = oxcf->lossless; - if (cpi->oxcf.lossless) { - cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_iwht4x4_1_add; - cpi->mb.e_mbd.inv_txm4x4_add = vp9_iwht4x4_16_add; - } else { - cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_idct4x4_1_add; - cpi->mb.e_mbd.inv_txm4x4_add = vp9_idct4x4_16_add; - } - + cpi->mb.e_mbd.itxm_add = cpi->oxcf.lossless ? vp9_iwht4x4_add + : vp9_idct4x4_add; cpi->baseline_gf_interval = DEFAULT_GF_INTERVAL; cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index f1946f930ed8a283b7617859fe0e784b2a9aab5a..dce73ee71101744a5bf2309715ce2f8dab3c21e6 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1108,8 +1108,8 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib, vp9_short_iht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, pd->dst.stride, tx_type); else - xd->inv_txm4x4_add(BLOCK_OFFSET(pd->dqcoeff, block), - dst, pd->dst.stride); + xd->itxm_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, pd->dst.stride, + 16); } }