From: Jingning Han Date: Wed, 3 Feb 2016 19:07:43 +0000 (-0800) Subject: Use precise rate cost estimate for skip block mode X-Git-Tag: v1.6.0~387^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcce658d3159be8435a557f26985e4d3f7b54b40;p=libvpx Use precise rate cost estimate for skip block mode It improves the compression performance of VP9 by 0.1% across all test sets. No speed change is observed. Change-Id: I59338c5c9e67bae22188f35fc3afbfe2a6bba6b0 --- diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 3166f2740..f00a58ce2 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -3355,15 +3355,19 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, } if (!disable_skip) { + vpx_prob skip_prob = vp9_get_skip_prob(cm, xd); if (skippable) { // Back out the coefficient coding costs rate2 -= (rate_y + rate_uv); // Cost the skip mb case - rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1); + rate2 += vp9_cost_bit(skip_prob, 1); } else if (ref_frame != INTRA_FRAME && !xd->lossless) { - if (RDCOST(x->rdmult, x->rddiv, rate_y + rate_uv, distortion2) < - RDCOST(x->rdmult, x->rddiv, 0, total_sse)) { + if (RDCOST(x->rdmult, x->rddiv, + rate_y + rate_uv + vp9_cost_bit(skip_prob, 0), + distortion2) < + RDCOST(x->rdmult, x->rddiv, + vp9_cost_bit(skip_prob, 1), total_sse)) { // Add in the cost of the no skip flag. rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0); } else {