diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-11 15:45:23 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-25 19:30:46 -0400 |
commit | bab8d38f7fc0c3e28c383c5cb9c987bf1aa05369 (patch) | |
tree | 6f8a342d148613f391dcdb08417e9d6c05255aad /vp10 | |
parent | c74b33a413f43d76c0a3239f32d42a0980d07ff3 (diff) | |
download | libvpx-bab8d38f7fc0c3e28c383c5cb9c987bf1aa05369.tar libvpx-bab8d38f7fc0c3e28c383c5cb9c987bf1aa05369.tar.gz libvpx-bab8d38f7fc0c3e28c383c5cb9c987bf1aa05369.tar.bz2 libvpx-bab8d38f7fc0c3e28c383c5cb9c987bf1aa05369.zip |
vp10: remove MACROBLOCK.{highbd_,}itxfm_add function pointer.
This is preparatory work for allowing per-segment lossless coding.
See issue 1035.
Change-Id: I9487d02717ee3e766aee61a487780056bb35d2d3
Diffstat (limited to 'vp10')
-rw-r--r-- | vp10/common/idct.c | 66 | ||||
-rw-r--r-- | vp10/common/idct.h | 8 | ||||
-rw-r--r-- | vp10/decoder/decodeframe.c | 14 | ||||
-rw-r--r-- | vp10/encoder/block.h | 6 | ||||
-rw-r--r-- | vp10/encoder/encodeframe.c | 6 | ||||
-rw-r--r-- | vp10/encoder/encodemb.c | 24 | ||||
-rw-r--r-- | vp10/encoder/encoder.c | 7 | ||||
-rw-r--r-- | vp10/encoder/rdopt.c | 12 |
8 files changed, 63 insertions, 80 deletions
diff --git a/vp10/common/idct.c b/vp10/common/idct.c index 144afc34b..5ee15c862 100644 --- a/vp10/common/idct.c +++ b/vp10/common/idct.c @@ -179,21 +179,24 @@ void vp10_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, } void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type, - void (*itxm_add_4x4)(const tran_low_t *input, - uint8_t *dest, int stride, int eob)) { - switch (tx_type) { - case DCT_DCT: - itxm_add_4x4(input, dest, stride, eob); - break; - case ADST_DCT: - case DCT_ADST: - case ADST_ADST: - vp10_iht4x4_16_add(input, dest, stride, tx_type); - break; - default: - assert(0); - break; + int stride, int eob, TX_TYPE tx_type, int lossless) { + if (lossless) { + assert(tx_type == DCT_DCT); + vp10_iwht4x4_add(input, dest, stride, eob); + } else { + switch (tx_type) { + case DCT_DCT: + vp10_idct4x4_add(input, dest, stride, eob); + break; + case ADST_DCT: + case DCT_ADST: + case ADST_ADST: + vp10_iht4x4_16_add(input, dest, stride, tx_type); + break; + default: + assert(0); + break; + } } } @@ -418,21 +421,24 @@ void vp10_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest, void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, int eob, int bd, TX_TYPE tx_type, - void (*highbd_itxm_add_4x4) - (const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd)) { - switch (tx_type) { - case DCT_DCT: - highbd_itxm_add_4x4(input, dest, stride, eob, bd); - break; - case ADST_DCT: - case DCT_ADST: - case ADST_ADST: - vp10_highbd_iht4x4_16_add(input, dest, stride, tx_type, bd); - break; - default: - assert(0); - break; + int lossless) { + if (lossless) { + assert(tx_type == DCT_DCT); + vp10_highbd_iwht4x4_add(input, dest, stride, eob, bd); + } else { + switch (tx_type) { + case DCT_DCT: + vp10_highbd_idct4x4_add(input, dest, stride, eob, bd); + break; + case ADST_DCT: + case DCT_ADST: + case ADST_ADST: + vp10_highbd_iht4x4_16_add(input, dest, stride, tx_type, bd); + break; + default: + assert(0); + break; + } } } diff --git a/vp10/common/idct.h b/vp10/common/idct.h index 2e000529b..088339804 100644 --- a/vp10/common/idct.h +++ b/vp10/common/idct.h @@ -44,9 +44,7 @@ void vp10_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride, int eob); void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, - int stride, int eob, TX_TYPE tx_type, - void (*itxm_add_4x4)(const tran_low_t *input, - uint8_t *dest, int stride, int eob)); + int stride, int eob, TX_TYPE tx_type, int lossless); void vp10_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, int eob, TX_TYPE tx_type); void vp10_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, @@ -67,9 +65,7 @@ void vp10_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, int eob, int bd); void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, int eob, int bd, TX_TYPE tx_type, - void (*highbd_itxm_add_4x4) - (const tran_low_t *input, uint8_t *dest, - int stride, int eob, int bd)); + int lossless); void vp10_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride, int eob, int bd, TX_TYPE tx_type); void vp10_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c index 50d50f88e..bbea6c789 100644 --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@ -203,9 +203,7 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane, switch (tx_size) { case TX_4X4: vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, xd->bd, - tx_type, xd->lossless ? - vp10_highbd_iwht4x4_add : - vp10_highbd_idct4x4_add); + tx_type, xd->lossless); break; case TX_8X8: vp10_highbd_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, xd->bd, @@ -228,8 +226,7 @@ static void inverse_transform_block_inter(MACROBLOCKD* xd, int plane, switch (tx_size) { case TX_4X4: vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type, - xd->lossless ? vp10_iwht4x4_add : - vp10_idct4x4_add); + xd->lossless); break; case TX_8X8: vp10_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, tx_type); @@ -274,9 +271,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane, switch (tx_size) { case TX_4X4: vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, xd->bd, - tx_type, xd->lossless ? - vp10_highbd_iwht4x4_add : - vp10_highbd_idct4x4_add); + tx_type, xd->lossless); break; case TX_8X8: vp10_highbd_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, xd->bd, @@ -299,8 +294,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane, switch (tx_size) { case TX_4X4: vp10_inv_txfm_add_4x4(dqcoeff, dst, stride, eob, tx_type, - xd->lossless ? vp10_iwht4x4_add : - vp10_idct4x4_add); + xd->lossless); break; case TX_8X8: vp10_inv_txfm_add_8x8(dqcoeff, dst, stride, eob, tx_type); diff --git a/vp10/encoder/block.h b/vp10/encoder/block.h index d8a5d911d..cb2a234c9 100644 --- a/vp10/encoder/block.h +++ b/vp10/encoder/block.h @@ -132,12 +132,6 @@ struct macroblock { // Strong color activity detection. Used in RTC coding mode to enhance // the visual quality at the boundary of moving color objects. uint8_t color_sensitivity[2]; - - void (*itxm_add)(const tran_low_t *input, uint8_t *dest, int stride, int eob); -#if CONFIG_VP9_HIGHBITDEPTH - void (*highbd_itxm_add)(const tran_low_t *input, uint8_t *dest, int stride, - int eob, int bd); -#endif }; #ifdef __cplusplus diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index 8e5dfae91..019e5b1e9 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -2696,12 +2696,6 @@ static void encode_frame_internal(VP10_COMP *cpi) { cm->uv_dc_delta_q == 0 && cm->uv_ac_delta_q == 0; -#if CONFIG_VP9_HIGHBITDEPTH - x->highbd_itxm_add = xd->lossless ? vp10_highbd_iwht4x4_add : - vp10_highbd_idct4x4_add; -#endif // CONFIG_VP9_HIGHBITDEPTH - x->itxm_add = xd->lossless ? vp10_iwht4x4_add : vp10_idct4x4_add; - if (xd->lossless) x->optimize = 0; diff --git a/vp10/encoder/encodemb.c b/vp10/encoder/encodemb.c index 9d65abe97..33077200d 100644 --- a/vp10/encoder/encodemb.c +++ b/vp10/encoder/encodemb.c @@ -841,7 +841,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, // case. vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, p->eobs[block], xd->bd, tx_type, - x->highbd_itxm_add); + xd->lossless); break; default: assert(0 && "Invalid transform size"); @@ -870,7 +870,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, // which is significant (not just an optimization) for the lossless // case. vp10_inv_txfm_add_4x4(dqcoeff, dst, pd->dst.stride, p->eobs[block], - tx_type, x->itxm_add); + tx_type, xd->lossless); break; default: assert(0 && "Invalid transform size"); @@ -895,11 +895,21 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize, if (p->eobs[block] > 0) { #if CONFIG_VP9_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { - x->highbd_itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block], xd->bd); - return; + if (xd->lossless) { + vp10_highbd_iwht4x4_add(dqcoeff, dst, pd->dst.stride, + p->eobs[block], xd->bd); + } else { + vp10_highbd_idct4x4_add(dqcoeff, dst, pd->dst.stride, + p->eobs[block], xd->bd); + } + return; } #endif // CONFIG_VP9_HIGHBITDEPTH - x->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); + if (xd->lossless) { + vp10_iwht4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); + } else { + vp10_idct4x4_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]); + } } } @@ -1032,7 +1042,7 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, // eob<=1 which is significant (not just an optimization) for the // lossless case. vp10_highbd_inv_txfm_add_4x4(dqcoeff, dst, dst_stride, *eob, xd->bd, - tx_type, x->highbd_itxm_add); + tx_type, xd->lossless); break; default: assert(0); @@ -1101,7 +1111,7 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, // which is significant (not just an optimization) for the lossless // case. vp10_inv_txfm_add_4x4(dqcoeff, dst, dst_stride, *eob, tx_type, - x->itxm_add); + xd->lossless); } break; default: diff --git a/vp10/encoder/encoder.c b/vp10/encoder/encoder.c index 7dc33f44f..b455bbbb4 100644 --- a/vp10/encoder/encoder.c +++ b/vp10/encoder/encoder.c @@ -4087,13 +4087,6 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags, if (oxcf->pass == 1) { cpi->td.mb.e_mbd.lossless = is_lossless_requested(oxcf); -#if CONFIG_VP9_HIGHBITDEPTH - cpi->td.mb.highbd_itxm_add = - cpi->td.mb.e_mbd.lossless ? vp10_highbd_iwht4x4_add - : vp10_highbd_idct4x4_add; -#endif // CONFIG_VP9_HIGHBITDEPTH - cpi->td.mb.itxm_add = cpi->td.mb.e_mbd.lossless ? vp10_iwht4x4_add - : vp10_idct4x4_add; vp10_first_pass(cpi, source); } else if (oxcf->pass == 2) { Pass2Encode(cpi, size, dest, frame_flags); diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index 1772775ce..e3bbdd346 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -807,8 +807,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x, goto next_highbd; vp10_highbd_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block), dst, dst_stride, p->eobs[block], - xd->bd, DCT_DCT, - vp10_highbd_iwht4x4_add); + xd->bd, DCT_DCT, 1); } else { int64_t unused; TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block); @@ -825,8 +824,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x, goto next_highbd; vp10_highbd_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block), dst, dst_stride, p->eobs[block], - xd->bd, tx_type, - vp10_highbd_idct4x4_add); + xd->bd, tx_type, 0); } } } @@ -907,8 +905,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x, if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) goto next; vp10_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block), - dst, dst_stride, p->eobs[block], DCT_DCT, - vp10_iwht4x4_add); + dst, dst_stride, p->eobs[block], DCT_DCT, 1); } else { int64_t unused; TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block); @@ -923,8 +920,7 @@ static int64_t rd_pick_intra4x4block(VP10_COMP *cpi, MACROBLOCK *x, if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd) goto next; vp10_inv_txfm_add_4x4(BLOCK_OFFSET(pd->dqcoeff, block), - dst, dst_stride, p->eobs[block], tx_type, - vp10_idct4x4_add); + dst, dst_stride, p->eobs[block], tx_type, 0); } } } |