shithub: libvpx

Download patch

ref: ba933b90c68927959c7ff5bb9c82436f8339d34e
parent: 8b5e665098b54f36040ec7b1c88ec49f03077566
parent: b2762a8853762a7f13bbf084ae1ae99992013ce2
author: Jingning Han <jingning@google.com>
date: Fri Feb 6 05:11:33 EST 2015

Merge "Re-arrange inter mode search order in RTC coding flow"

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -573,6 +573,10 @@
   *rd_cost = best_rdc;
 }
 
+static const PREDICTION_MODE inter_mode_set[INTER_MODES] = {
+    ZEROMV, NEARESTMV, NEARMV, NEWMV,
+};
+
 // TODO(jingning) placeholder for inter-frame non-RD mode decision.
 // this needs various further optimizations. to be continued..
 void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
@@ -732,10 +736,12 @@
     mbmi->ref_frame[0] = ref_frame;
     set_ref_ptrs(cm, xd, ref_frame, NONE);
 
-    for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) {
+    for (i = 0; i < INTER_MODES; ++i) {
       int rate_mv = 0;
       int mode_rd_thresh;
-      int mode_index = mode_idx[ref_frame][INTER_OFFSET(this_mode)];
+      int mode_index;
+      this_mode = inter_mode_set[i];
+      mode_index = mode_idx[ref_frame][INTER_OFFSET(this_mode)];
 
       if (const_motion[ref_frame] && this_mode == NEARMV)
         continue;