]> granicus.if.org Git - libvpx/commitdiff
Fix intra mode update process in vp9_pick_inter_mode
authorJingning Han <jingning@google.com>
Mon, 15 Dec 2014 22:43:07 +0000 (14:43 -0800)
committerJingning Han <jingning@google.com>
Tue, 16 Dec 2014 01:52:09 +0000 (17:52 -0800)
When multiple intra modes are tested, the previous mode info
update process may overwrite the selected best intra mode and make
the final selection use an inter mode. This commit fixes this
issue by moving the mode_info reset outside the intra mode search
loop.

Change-Id: I15ed4288a6b3cb0832104a5e6d5d9a25cd1a5b2b

vp9/encoder/vp9_pickmode.c

index db5650c1035e8b0f45342888f42a18151c2d35f3..e0892fe356d15230c5afcc85ca3e5481f677190a 100644 (file)
@@ -872,7 +872,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
       const PREDICTION_MODE this_mode = intra_mode_list[i];
       if (!((1 << this_mode) & cpi->sf.intra_y_mode_mask[intra_tx_size]))
         continue;
-      skip_txfm = x->skip_txfm[0];
       args.mode = this_mode;
       args.rate = 0;
       args.dist = 0;
@@ -893,11 +892,14 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
         mbmi->ref_frame[0] = INTRA_FRAME;
         mbmi->uv_mode = this_mode;
         mbmi->mv[0].as_int = INVALID_MV;
-      } else {
-        x->skip_txfm[0] = best_mode_skip_txfm;
-        mbmi->tx_size = best_tx_size;
       }
     }
+
+    // Reset mb_mode_info to the best inter mode.
+    if (mbmi->ref_frame[0] != INTRA_FRAME) {
+      x->skip_txfm[0] = best_mode_skip_txfm;
+      mbmi->tx_size = best_tx_size;
+    }
   }
 
   pd->dst = orig_dst;