]> granicus.if.org Git - libvpx/commitdiff
Fix a bug in vp9_rd_pick_inter_mode_sb
authorJingning Han <jingning@google.com>
Tue, 9 Sep 2014 22:32:40 +0000 (15:32 -0700)
committerJingning Han <jingning@google.com>
Tue, 9 Sep 2014 22:39:54 +0000 (15:39 -0700)
This commit fixes a bug related to skipping intra mode checking, by
using a separate variable to store the best prediction error from
inter mode. It avoids unintentionally overwriting intra mode
rate-distortion cost, and hence affecting other speed features.

Change-Id: I99e12993339c84c8b4f597996b372012e5858fae

vp9/encoder/vp9_rdopt.c

index 8b173249417d908517b70ef6064db450e2cbf3a4..9096677fb0663be6f681f686de2a6631b5e95786 100644 (file)
@@ -2575,6 +2575,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
   vp9_prob comp_mode_p;
   int64_t best_intra_rd = INT64_MAX;
   int64_t best_inter_rd = INT64_MAX;
+  unsigned int best_pred_sse = UINT_MAX;
   PREDICTION_MODE best_intra_mode = DC_PRED;
   MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME;
   int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES];
@@ -2804,7 +2805,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
 
     if (ref_frame == INTRA_FRAME) {
       if (cpi->sf.adaptive_mode_search)
-        if ((x->source_variance << num_pels_log2_lookup[bsize]) > best_intra_rd)
+        if ((x->source_variance << num_pels_log2_lookup[bsize]) > best_pred_sse)
           continue;
 
       if (!(intra_y_mode_mask & (1 << this_mode)))
@@ -2983,7 +2984,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
           mbmi->mv[0].as_int = 0;
           max_plane = 1;
         } else {
-          best_intra_rd = x->pred_sse[ref_frame];
+          best_pred_sse = x->pred_sse[ref_frame];
         }
 
         *returnrate = rate2;