Commit 5a3d1a88 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Cleaning up vp9_xform_quant() function.

Change-Id: Id56089107b7458aa59f345edc1b49e62eac41035
parent bac4113c
...@@ -333,22 +333,21 @@ static INLINE void fdct32x32(int rd_transform, ...@@ -333,22 +333,21 @@ static INLINE void fdct32x32(int rd_transform,
void vp9_xform_quant(MACROBLOCK *x, int plane, int block, void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *const p = &x->plane[plane]; const struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane]; const struct macroblockd_plane *const pd = &xd->plane[plane];
int16_t *coeff = BLOCK_OFFSET(p->coeff, block); const scan_order *const scan_order = &vp9_default_scan_orders[tx_size];
int16_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block); int16_t *const coeff = BLOCK_OFFSET(p->coeff, block);
int16_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
const scan_order *scan_order; int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
uint16_t *eob = &p->eobs[block]; uint16_t *const eob = &p->eobs[block];
const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
int i, j; int i, j;
int16_t *src_diff; const int16_t *src_diff;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
src_diff = &p->src_diff[4 * (j * diff_stride + i)]; src_diff = &p->src_diff[4 * (j * diff_stride + i)];
switch (tx_size) { switch (tx_size) {
case TX_32X32: case TX_32X32:
scan_order = &vp9_default_scan_orders[TX_32X32];
fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride); fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride);
vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round, vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff, p->quant, p->quant_shift, qcoeff, dqcoeff,
...@@ -356,7 +355,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block, ...@@ -356,7 +355,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
scan_order->iscan); scan_order->iscan);
break; break;
case TX_16X16: case TX_16X16:
scan_order = &vp9_default_scan_orders[TX_16X16];
vp9_fdct16x16(src_diff, coeff, diff_stride); vp9_fdct16x16(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff, p->quant, p->quant_shift, qcoeff, dqcoeff,
...@@ -364,7 +362,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block, ...@@ -364,7 +362,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
scan_order->scan, scan_order->iscan); scan_order->scan, scan_order->iscan);
break; break;
case TX_8X8: case TX_8X8:
scan_order = &vp9_default_scan_orders[TX_8X8];
vp9_fdct8x8(src_diff, coeff, diff_stride); vp9_fdct8x8(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff, p->quant, p->quant_shift, qcoeff, dqcoeff,
...@@ -372,7 +369,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block, ...@@ -372,7 +369,6 @@ void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
scan_order->scan, scan_order->iscan); scan_order->scan, scan_order->iscan);
break; break;
case TX_4X4: case TX_4X4:
scan_order = &vp9_default_scan_orders[TX_4X4];
x->fwd_txm4x4(src_diff, coeff, diff_stride); x->fwd_txm4x4(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff, p->quant, p->quant_shift, qcoeff, dqcoeff,
......
Supports Markdown
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