From 200ec69abb0e38c36219dfc60a273272be9f040f Mon Sep 17 00:00:00 2001 From: Yunqing Wang Date: Mon, 15 Sep 2014 17:11:16 -0700 Subject: [PATCH] Simplify the skip flag cost code Code refactoring. Change-Id: Idad53cb80497d13551a142a642f7529fc305b0bc --- vp9/encoder/vp9_rdopt.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 212b960ff..e0049490c 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2913,18 +2913,11 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, if (!disable_skip) { if (skippable) { - vp9_prob skip_prob = vp9_get_skip_prob(cm, xd); - // Back out the coefficient coding costs rate2 -= (rate_y + rate_uv); - // for best yrd calculation - rate_uv = 0; // Cost the skip mb case - if (skip_prob) { - int prob_skip_cost = vp9_cost_bit(skip_prob, 1); - rate2 += prob_skip_cost; - } + rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 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)) { @@ -2936,8 +2929,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, distortion2 = total_sse; assert(total_sse >= 0); rate2 -= (rate_y + rate_uv); - rate_y = 0; - rate_uv = 0; this_skip2 = 1; } } else {