From 5a3d1a88eac748181d4d178194a5b42ca26aa8c8 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 27 Feb 2014 12:02:09 -0800 Subject: [PATCH] Cleaning up vp9_xform_quant() function. Change-Id: Id56089107b7458aa59f345edc1b49e62eac41035 --- vp9/encoder/vp9_encodemb.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index b3964ade1..cc5821c93 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -333,22 +333,21 @@ static INLINE void fdct32x32(int rd_transform, void vp9_xform_quant(MACROBLOCK *x, int plane, int block, BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { MACROBLOCKD *const xd = &x->e_mbd; - struct macroblock_plane *const p = &x->plane[plane]; - struct macroblockd_plane *const pd = &xd->plane[plane]; - int16_t *coeff = BLOCK_OFFSET(p->coeff, block); - int16_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); - int16_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); - const scan_order *scan_order; - uint16_t *eob = &p->eobs[block]; + const struct macroblock_plane *const p = &x->plane[plane]; + const struct macroblockd_plane *const pd = &xd->plane[plane]; + const scan_order *const scan_order = &vp9_default_scan_orders[tx_size]; + int16_t *const coeff = BLOCK_OFFSET(p->coeff, block); + int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); + int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); + uint16_t *const eob = &p->eobs[block]; const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; int i, j; - int16_t *src_diff; + const int16_t *src_diff; txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); src_diff = &p->src_diff[4 * (j * diff_stride + i)]; switch (tx_size) { case TX_32X32: - scan_order = &vp9_default_scan_orders[TX_32X32]; fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, @@ -356,7 +355,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block, scan_order->iscan); break; case TX_16X16: - scan_order = &vp9_default_scan_orders[TX_16X16]; vp9_fdct16x16(src_diff, coeff, diff_stride); vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, @@ -364,7 +362,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block, scan_order->scan, scan_order->iscan); break; case TX_8X8: - scan_order = &vp9_default_scan_orders[TX_8X8]; vp9_fdct8x8(src_diff, coeff, diff_stride); vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, @@ -372,7 +369,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block, scan_order->scan, scan_order->iscan); break; case TX_4X4: - scan_order = &vp9_default_scan_orders[TX_4X4]; x->fwd_txm4x4(src_diff, coeff, diff_stride); vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, -- 2.40.0