]> granicus.if.org Git - libvpx/commitdiff
Fix the setting of mode_skip_mask
authorYaowu Xu <yaowu@google.com>
Wed, 9 Apr 2014 18:37:27 +0000 (11:37 -0700)
committerYaowu Xu <yaowu@google.com>
Wed, 9 Apr 2014 18:42:28 +0000 (11:42 -0700)
In mode selection loop, once mode_index pass mode_skip_start, all
modes with a different reference frame from current best mode are
masked out using mode_skip_mask.

However, the setting of mode_skip_mask may use an invalid mode if
there is no mode tested yet. This commit fixes the issue by making
sure a mode has been tested and selected. Otherwise, no mode will be
masked out because of their reference frame.

Change-Id: Ib0009e8a96836a65cf5347440fff8a2e1a67f29f

vp9/encoder/vp9_rdopt.c

index a3e513277442124a049db873363a3d344f308f5c..1066f6a177da64da0ab250a568a4b0b33809926c 100644 (file)
@@ -3304,7 +3304,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
 
     // Look at the reference frame of the best mode so far and set the
     // skip mask to look at a subset of the remaining modes.
-    if (mode_index == mode_skip_start) {
+    if (mode_index == mode_skip_start && best_rd < INT64_MAX) {
       switch (vp9_mode_order[best_mode_index].ref_frame[0]) {
         case INTRA_FRAME:
           break;