]> granicus.if.org Git - libvpx/commitdiff
Properly save and restore skip related variables
authorYaowu Xu <yaowu@google.com>
Wed, 16 Mar 2016 22:05:04 +0000 (15:05 -0700)
committerYaowu Xu <yaowu@google.com>
Wed, 16 Mar 2016 23:28:52 +0000 (16:28 -0700)
Change-Id: Id52744e140585c08d047fb395b75ac9318a0b4c3

vp10/encoder/rdopt.c

index 16deebf0c7a2324fd60389c337820be8c514f567..2b7d8f5a8d41bf584b201e9b0a10d104c7dbbc66 100644 (file)
@@ -8063,6 +8063,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
         int_mv backup_mv = frame_mv[NEARMV][ref_frame];
         int_mv cur_mv = mbmi_ext->ref_mv_stack[ref_frame][2].this_mv;
         MB_MODE_INFO backup_mbmi = *mbmi;
+        int backup_skip = x->skip;
 
         int64_t tmp_ref_rd = this_rd;
         int ref_idx;
@@ -8095,6 +8096,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
           int tmp_rate = 0, tmp_rate_y = 0, tmp_rate_uv = 0;
           int tmp_skip = 1;
           int64_t tmp_dist = 0, tmp_sse = 0;
+          int dummy_disable_skip = 0;
 
           cur_mv = mbmi_ext->ref_mv_stack[ref_frame][2 + ref_idx].this_mv;
           lower_mv_precision(&cur_mv.as_mv, cm->allow_high_precision_mv);
@@ -8168,6 +8170,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
 
           if (tmp_ref_rd > tmp_alt_rd) {
             rate2 = tmp_rate;
+            disable_skip = dummy_disable_skip;
             distortion2 = tmp_dist;
             skippable = tmp_skip;
             rate_y = tmp_rate_y;
@@ -8176,6 +8179,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
             this_rd = tmp_alt_rd;
             tmp_ref_rd = tmp_alt_rd;
             backup_mbmi = *mbmi;
+            backup_skip = x->skip;
 #if CONFIG_VAR_TX
             for (i = 0; i < MAX_MB_PLANE; ++i)
               memcpy(x->blk_skip_drl[i], x->blk_skip[i],
@@ -8183,6 +8187,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
 #endif
           } else {
             *mbmi = backup_mbmi;
+            x->skip = backup_skip;
           }
         }