shithub: libvpx

Download patch

ref: 0d2abe30843364fa342c5afaf32cc9af5773adfc
parent: 1312a7a2e2ce740325ea3dde1a149d07e896ee42
parent: 8608de1c6f07b3e0b979177c0ada15f06d358ce9
author: Adrian Grange <agrange@google.com>
date: Fri Apr 15 04:37:19 EDT 2011

Merge "Fix usage of value returned by vp8_pick_intra4x4mby_modes"

--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -642,10 +642,10 @@
         switch (this_mode)
         {
         case B_PRED:
-            distortion2 = *returndistortion;                    // Best so far passed in as breakout value to vp8_pick_intra4x4mby_modes
-            vp8_pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x, &rate, &distortion2);
-            rate2 += rate;
-            distortion2 = VARIANCE_INVOKE(&cpi->rtcd.variance, get16x16prederror)(x->src.y_buffer, x->src.y_stride, x->e_mbd.predictor, 16, 0x7fffffff);
+            // Pass best so far to vp8_pick_intra4x4mby_modes to use as breakout
+            distortion2 = *returndistortion;
+            vp8_pick_intra4x4mby_modes(IF_RTCD(&cpi->rtcd), x,
+                                         &rate, &distortion2);
 
             if (distortion2 == INT_MAX)
             {
@@ -653,6 +653,11 @@
             }
             else
             {
+                rate2 += rate;
+                distortion2 = VARIANCE_INVOKE
+                                (&cpi->rtcd.variance, get16x16prederror)(
+                                    x->src.y_buffer, x->src.y_stride,
+                                    x->e_mbd.predictor, 16, 0x7fffffff);
                 this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
 
                 if (this_rd < best_intra_rd)
--