shithub: libvpx

Download patch

ref: ecc28cdaa3b216b18aee95645fb93dcc4eb7b107
parent: 1259b0b22e4a9f500e4dafad3323a6bd6264f56f
author: Yaowu Xu <yaowu@google.com>
date: Tue Apr 17 11:14:45 EDT 2012

added reset of rate estimates for each mode

This is to prevent the evaluation of a mode from using values left
over from a mode evaluated prior in the loop.

Change-Id: Ife2c6ceb76d2f7365fd262515d3ae48229033c2d

--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -2813,6 +2813,8 @@
         // These variables hold are rolling total cost and distortion for this mode
         rate2 = 0;
         distortion2 = 0;
+        rate_y = 0;
+        rate_uv =0;
 
         this_mode = vp8_mode_order[mode_index];
         x->e_mbd.mode_info_context->mbmi.mode = this_mode;
@@ -3466,8 +3468,8 @@
                 int mb_skippable;
                 int mb_skip_allowed;
                 int has_y2 = ( this_mode!=SPLITMV
-                                    &&this_mode!=B_PRED
-                                    &&this_mode!=I8X8_PRED);
+                                &&this_mode!=B_PRED
+                    &&this_mode!=I8X8_PRED);
 
                 if((cpi->common.txfm_mode == ALLOW_8X8) && has_y2)
                 {
@@ -3611,7 +3613,6 @@
             cpi->rd_thresh_mult[mode_index] = (cpi->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ? cpi->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT;
             cpi->rd_threshes[mode_index] = (cpi->rd_baseline_thresh[mode_index] >> 7) * cpi->rd_thresh_mult[mode_index];
         }
-
         // If the mode did not help improve the best error case then raise the threshold for testing that mode next time around.
         else
         {