diff options
author | Jingning Han <jingning@google.com> | 2013-07-23 10:02:43 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2013-07-23 10:06:41 -0700 |
commit | 0359ad7f9a8d8e78482b869d9c911df4d02f5dbf (patch) | |
tree | 4051ce219d560e4e3d6f58ba1581acdf41cb8236 /vp9 | |
parent | cedd24ec619849994eebc23d02f3141c6a4acefb (diff) | |
download | libvpx-0359ad7f9a8d8e78482b869d9c911df4d02f5dbf.tar libvpx-0359ad7f9a8d8e78482b869d9c911df4d02f5dbf.tar.gz libvpx-0359ad7f9a8d8e78482b869d9c911df4d02f5dbf.tar.bz2 libvpx-0359ad7f9a8d8e78482b869d9c911df4d02f5dbf.zip |
Skip inverse transform when eob is zero
When all the transform coefficients were quantized to zero, skip
the inverse transform operation. For bus_cif at 1000 kbps, the
runtime goes from 154967ms -> 149842ms, i.e., about 3% speed-up,
at speed 0.
Change-Id: Ic0a813fff5e28972d4888ee42d8747846a6c3cc6
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_encodemb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 28f8d0807..710417948 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -533,6 +533,8 @@ static void encode_block(int plane, int block, BLOCK_SIZE_TYPE bsize, if (x->skip_encode) return; + if (pd->eobs[block] == 0) + return; switch (ss_txfrm_size / 2) { case TX_32X32: @@ -657,7 +659,7 @@ void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, pd->dequant, p->zbin_extra, eob, scan, iscan); - if (!x->skip_encode) + if (!x->skip_encode && *eob) vp9_short_idct32x32_add(dqcoeff, dst, pd->dst.stride); break; case TX_16X16: @@ -682,7 +684,7 @@ void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, pd->dequant, p->zbin_extra, eob, scan, iscan); - if (!x->skip_encode) { + if (!x->skip_encode && *eob) { if (tx_type == DCT_DCT) vp9_short_idct16x16_add(dqcoeff, dst, pd->dst.stride); else @@ -711,7 +713,7 @@ void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, pd->dequant, p->zbin_extra, eob, scan, iscan); - if (!x->skip_encode) { + if (!x->skip_encode && *eob) { if (tx_type == DCT_DCT) vp9_short_idct8x8_add(dqcoeff, dst, pd->dst.stride); else @@ -743,7 +745,7 @@ void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize, vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, p->quant, p->quant_shift, qcoeff, dqcoeff, pd->dequant, p->zbin_extra, eob, scan, iscan); - if (!x->skip_encode) { + if (!x->skip_encode && *eob) { if (tx_type == DCT_DCT) // this is like vp9_short_idct4x4 but has a special case around eob<=1 // which is significant (not just an optimization) for the lossless |