From: Jingning Han Date: Mon, 15 Dec 2014 20:48:07 +0000 (-0800) Subject: Use right shift to replace division in vp9_pick_inter_mode X-Git-Tag: v1.4.0~351^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83e2c62aba3a427e283c87900ba1ab0806766bef;p=libvpx Use right shift to replace division in vp9_pick_inter_mode Make the variable reduction_fac log2 based and explicitly use right shift when computing intra_cost_penalty. Change-Id: I208f1fb879a02debb3b3fc64f9fd06260dcf1c86 --- diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index d5ab0cc6c..379d06739 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -537,9 +537,9 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, // Reduce the intra cost penalty for small blocks (<=16x16). const int reduction_fac = (cpi->sf.partition_search_type == VAR_BASED_PARTITION && - bsize <= BLOCK_16X16) ? 4 : 1; + bsize <= BLOCK_16X16) ? 2 : 0; const int intra_cost_penalty = vp9_get_intra_cost_penalty( - cm->base_qindex, cm->y_dc_delta_q, cm->bit_depth) / reduction_fac; + cm->base_qindex, cm->y_dc_delta_q, cm->bit_depth) >> reduction_fac; const int64_t inter_mode_thresh = RDCOST(x->rdmult, x->rddiv, intra_cost_penalty, 0); const int8_t segment_id = mbmi->segment_id;