shithub: libvpx

Download patch

ref: 915f13bd5972c7e004b48533a455c9c7b7bc6d2d
parent: 3adcbe2f15a034fa9ff7f16639086f24fa684257
author: Ronald S. Bultje <rbultje@google.com>
date: Wed Feb 8 09:55:46 EST 2012

Fix dual prediction recode loop.

We should only change the dual prediction mode if we actually entered
the recode branch. Else, it may potentially undo beneficial changes
to the dual prediction mode in the first encode iteration.

Change-Id: I79fc53e5fd0bb551092ed422c797619f1566f002

--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -1537,21 +1537,21 @@
         if (redo)
         {
             encode_frame_internal(cpi);
-        }
 
-        if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
-        {
-            if (cpi->dual_pred_count[0] == 0 &&
-                cpi->dual_pred_count[1] == 0 &&
-                cpi->dual_pred_count[2] == 0)
+            if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
             {
-                cpi->common.dual_pred_mode = SINGLE_PREDICTION_ONLY;
-            }
-            else if (cpi->single_pred_count[0] == 0 &&
-                     cpi->single_pred_count[1] == 0 &&
-                     cpi->single_pred_count[2] == 0)
-            {
-                cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY;
+                if (cpi->dual_pred_count[0] == 0 &&
+                    cpi->dual_pred_count[1] == 0 &&
+                    cpi->dual_pred_count[2] == 0)
+                {
+                    cpi->common.dual_pred_mode = SINGLE_PREDICTION_ONLY;
+                }
+                else if (cpi->single_pred_count[0] == 0 &&
+                         cpi->single_pred_count[1] == 0 &&
+                         cpi->single_pred_count[2] == 0)
+                {
+                    cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY;
+                }
             }
         }
     }
--