]> granicus.if.org Git - libvpx/commitdiff
Check if sub8x8 rd stats are valid before reusing them.
authorGeza Lore <gezalore@gmail.com>
Fri, 13 May 2016 13:39:44 +0000 (14:39 +0100)
committerDebargha Mukherjee <debargha@google.com>
Fri, 3 Jun 2016 18:47:34 +0000 (11:47 -0700)
Change-Id: I5d49f15a07de58c226d4003b4691e001abf1f3f8

vp10/encoder/rdopt.c

index 1ddbcd4598d51e9612859e3296a3417b08b03a58..490e32fff86ded30dab5b8b70af841980dab43ca 100644 (file)
@@ -5598,6 +5598,8 @@ static int64_t rd_pick_best_sub8x8_mode(VP10_COMP *cpi, MACROBLOCK *x,
                 ref_bsi->rdstat[i][mode_idx].mvs[ref].as_int;
           }
 
+          have_ref &= ref_bsi->rdstat[i][mode_idx].brate > 0;
+
           if (filter_idx > 1 && !subpelmv && !have_ref) {
             ref_bsi = bsi_buf + 1;
             have_ref = 1;
@@ -5613,6 +5615,8 @@ static int64_t rd_pick_best_sub8x8_mode(VP10_COMP *cpi, MACROBLOCK *x,
 #endif  // CONFIG_EXT_INTER
               have_ref &= mode_mv[this_mode][ref].as_int ==
                   ref_bsi->rdstat[i][mode_idx].mvs[ref].as_int;
+
+            have_ref &= ref_bsi->rdstat[i][mode_idx].brate > 0;
           }
 
           if (!subpelmv && have_ref &&