Skip to content
Snippets Groups Projects
Commit 4dc5bd7b authored by Yi Luo's avatar Yi Luo
Browse files

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
parent 454fd586
No related branches found
No related tags found
2 merge requests!6Rav1e 11 yushin 1,!3Rav1e 10 yushin
...@@ -452,12 +452,12 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row, ...@@ -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) { if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
highbd_fwd_txfm(src_diff, coeff, diff_stride, &fwd_txfm_param); highbd_fwd_txfm(src_diff, coeff, diff_stride, &fwd_txfm_param);
if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) { if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) {
if (x->skip_block) { if (LIKELY(!x->skip_block)) {
vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
} else {
quant_func_list[xform_quant_idx][QUANT_FUNC_HIGHBD]( quant_func_list[xform_quant_idx][QUANT_FUNC_HIGHBD](
coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob,
scan_order, &qparam); scan_order, &qparam);
} else {
vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
} }
} }
return; return;
...@@ -466,12 +466,12 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row, ...@@ -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); fwd_txfm(src_diff, coeff, diff_stride, &fwd_txfm_param);
if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) { if (xform_quant_idx != VP10_XFORM_QUANT_SKIP_QUANT) {
if (x->skip_block) { if (LIKELY(!x->skip_block)) {
vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
} else {
quant_func_list[xform_quant_idx][QUANT_FUNC_LOWBD]( quant_func_list[xform_quant_idx][QUANT_FUNC_LOWBD](
coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob,
scan_order, &qparam); scan_order, &qparam);
} else {
vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment