From: Yi Luo Date: Fri, 12 Aug 2016 19:37:32 +0000 (-0700) Subject: Apply branch prediction on quantize/quantize_skip functions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4dc5bd7b716b12bb4a5e0b74c27a02e89866d9cb;p=libvpx Apply branch prediction on quantize/quantize_skip functions - On E5-2680, park_joy_1080p, 5 frames, baseline encoding time reduces about 0.8~1.0%. - Credit goes to Erik Niemeyer (erik.a.niemeyer@intel.com). Change-Id: I69f191d5a4e4b96a5f9ffd8286e484b69d565c01 --- diff --git a/vp10/encoder/encodemb.c b/vp10/encoder/encodemb.c index 46ee48dbe..2cc8575f9 100644 --- a/vp10/encoder/encodemb.c +++ b/vp10/encoder/encodemb.c @@ -452,12 +452,12 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row, if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { highbd_fwd_txfm(src_diff, coeff, diff_stride, &fwd_txfm_param); if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) { - if (x->skip_block) { - vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob); - } else { + if (LIKELY(!x->skip_block)) { quant_func_list[xform_quant_idx][QUANT_FUNC_HIGHBD]( coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam); + } else { + vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob); } } return; @@ -466,12 +466,12 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row, fwd_txfm(src_diff, coeff, diff_stride, &fwd_txfm_param); if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) { - if (x->skip_block) { - vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob); - } else { + if (LIKELY(!x->skip_block)) { quant_func_list[xform_quant_idx][QUANT_FUNC_LOWBD]( coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order, &qparam); + } else { + vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob); } } }