shithub: libvpx

Download patch

ref: 1c84e73ebda82f0089f6ae71acfe1710f5bed2c2
parent: 61966b1d10821cd4e1f6e0368aef46d827be162e
parent: 64348d9f8d82050f799058c3f2fc75a7a1599c5b
author: Jingning Han <[email protected]>
date: Fri Oct 31 04:55:40 EDT 2014

Merge "Fix mode index use case in vp9_pick_inter_mode"

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -606,6 +606,7 @@
     for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) {
       int rate_mv = 0;
       int mode_rd_thresh;
+      int mode_index = mode_idx[ref_frame][INTER_OFFSET(this_mode)];
 
       if (const_motion[ref_frame] && this_mode == NEARMV)
         continue;
@@ -613,10 +614,9 @@
       if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode)))
         continue;
 
-      mode_rd_thresh =
-          rd_threshes[mode_idx[ref_frame][INTER_OFFSET(this_mode)]];
+      mode_rd_thresh = rd_threshes[mode_index];
       if (rd_less_than_thresh(best_rdc.rdcost, mode_rd_thresh,
-                              rd_thresh_freq_fact[this_mode]))
+                              rd_thresh_freq_fact[mode_index]))
         continue;
 
       if (this_mode == NEWMV) {
@@ -839,12 +839,12 @@
 
   if (is_inter_block(mbmi))
     vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact,
-                              cpi->sf.adaptive_rd_thresh, bsize,
-                              mode_idx[ref_frame][INTER_OFFSET(mbmi->mode)]);
+                            cpi->sf.adaptive_rd_thresh, bsize,
+                            mode_idx[best_ref_frame][INTER_OFFSET(mbmi->mode)]);
   else
     vp9_update_rd_thresh_fact(tile_data->thresh_freq_fact,
                               cpi->sf.adaptive_rd_thresh, bsize,
-                              mode_idx[ref_frame][mbmi->mode]);
+                              mode_idx[INTRA_FRAME][mbmi->mode]);
 
   *rd_cost = best_rdc;
 }