From: Jingning Han Date: Fri, 17 Jun 2016 23:23:32 +0000 (-0700) Subject: Fix unit test failure in obmc exp X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=887f020691758dd3d9176d043e612e4e6b924959;p=libvpx Fix unit test failure in obmc exp Properly restore the rate cost in the inner search loop of obmc prediction. This avoids unexpected encoding behavior. It fixes the unit test failure in obmc experiment: AltRefForcedKeyTestLarge.Frame1IsKey/2 Change-Id: I667b219dfcf2f2c63d9d984900ed3cfd10c354bd --- diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index c7ae00fbb..80132a1ed 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -6762,9 +6762,7 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, is_motvar_allowed(mbmi); int rate2_nocoeff, best_rate2 = INT_MAX, best_skippable, best_xskip, best_disable_skip = 0; -#if CONFIG_SUPERTX int best_rate_y, best_rate_uv; -#endif // CONFIG_SUPERTX #if CONFIG_VAR_TX uint8_t best_blk_skip[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE * 4]; #endif // CONFIG_VAR_TX @@ -7981,10 +7979,8 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, best_mbmi = *mbmi; best_rd = tmp_rd; best_rate2 = *rate2; -#if CONFIG_SUPERTX best_rate_y = *rate_y; best_rate_uv = *rate_uv; -#endif // CONFIG_SUPERTX #if CONFIG_VAR_TX for (i = 0; i < MAX_MB_PLANE; ++i) memcpy(best_blk_skip[i], x->blk_skip[i], @@ -8006,10 +8002,8 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, } *mbmi = best_mbmi; *rate2 = best_rate2; -#if CONFIG_SUPERTX *rate_y = best_rate_y; *rate_uv = best_rate_uv; -#endif // CONFIG_SUPERTX #if CONFIG_VAR_TX for (i = 0; i < MAX_MB_PLANE; ++i) memcpy(x->blk_skip[i], best_blk_skip[i], @@ -9509,6 +9503,10 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi, } else { this_skip2 = mbmi->skip; this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2); + if (this_skip2) { + rate_y = 0; + rate_uv = 0; + } #endif // CONFIG_OBMC }