shithub: libvpx

Download patch

ref: 0f02b37992c3475f9a8c9a555ab63d39c67512aa
parent: 808f3814fc1e8c93ba7358f54a02a81c2d440189
parent: cb9698951c8c57b6cdb185c73db1dec42f4574ec
author: John Koleszar <jkoleszar@google.com>
date: Thu Dec 9 19:05:06 EST 2010

Merge remote branch 'origin/master' into experimental

Change-Id: Iada4d917df4af42b16404e1b54b30ba2ca74df39

--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3837,18 +3837,17 @@
 
     vp8_compute_frame_size_bounds(cpi, &frame_under_shoot_limit, &frame_over_shoot_limit);
 
-    // Limit Q range for the adaptive loop (Values not clipped to range 20-60 as in VP8).
+    // Limit Q range for the adaptive loop.
     bottom_index = cpi->active_best_quality;
     top_index    = cpi->active_worst_quality;
+    q_low  = cpi->active_best_quality;
+    q_high = cpi->active_worst_quality;
 
     vp8_save_coding_context(cpi);
 
     loop_count = 0;
 
-    q_low  = cpi->best_quality;
-    q_high = cpi->worst_quality;
 
-
     scale_and_extend_source(cpi->un_scaled_source, cpi);
 #if !(CONFIG_REALTIME_ONLY) && CONFIG_POSTPROC
 
@@ -4029,15 +4028,13 @@
 
                 Q = vp8_regulate_q(cpi, cpi->this_frame_target);
 
-                q_low  = cpi->best_quality;
-                q_high = cpi->worst_quality;
-
                 vp8_compute_frame_size_bounds(cpi, &frame_under_shoot_limit, &frame_over_shoot_limit);
 
-                // Limit Q range for the adaptive loop (Values not clipped to range 20-60 as in VP8).
+                // Limit Q range for the adaptive loop.
                 bottom_index = cpi->active_best_quality;
                 top_index    = cpi->active_worst_quality;
-
+                q_low  = cpi->active_best_quality;
+                q_high = cpi->active_worst_quality;
 
                 loop_count++;
                 Loop = TRUE;
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -1642,8 +1642,6 @@
     //int intermodecost[MAX_MODES];
 
     MB_PREDICTION_MODE uv_intra_mode;
-    int sse;
-    int sum;
     int uvintra_eob = 0;
     int tteob = 0;
     int force_no_skip = 0;
@@ -2238,35 +2236,43 @@
 
             vp8_set_mbmode_and_mvs(x, this_mode, &mode_mv[this_mode]);
             vp8_build_inter_predictors_mby(&x->e_mbd);
-            if(x->encode_breakout)
-                VARIANCE_INVOKE(&cpi->rtcd.variance, get16x16var)(x->src.y_buffer, x->src.y_stride, x->e_mbd.predictor, 16, (unsigned int *)(&sse), &sum);
 
             if (cpi->active_map_enabled && x->active_ptr[0] == 0) {
                 x->skip = 1;
             }
-            else if (sse < x->encode_breakout)
+            else if (x->encode_breakout)
             {
-                // Check u and v to make sure skip is ok
-                int sse2 = 0;
+                int sum, sse;
 
-                // add dc check
-                if (abs(sum) < (cpi->common.Y2dequant[0][0] << 2))
+                VARIANCE_INVOKE(&cpi->rtcd.variance, get16x16var)
+                    (x->src.y_buffer, x->src.y_stride,
+                     x->e_mbd.predictor, 16, (unsigned int *)(&sse), &sum);
+
+                if (sse < x->encode_breakout)
                 {
-                    sse2 = VP8_UVSSE(x, IF_RTCD(&cpi->rtcd.variance));
+                    // Check u and v to make sure skip is ok
+                    int sse2 = 0;
 
-                    if (sse2 * 2 < x->encode_breakout)
+                    // add dc check
+                    if (abs(sum) < (cpi->common.Y2dequant[0][0] << 2))
                     {
-                        x->skip = 1;
-                        distortion2 = sse;
-                        rate2 = 500;
-                        disable_skip = 1;
-                        this_rd = RDFUNC(x->rdmult, x->rddiv, rate2,
-                          distortion2, cpi->target_bits_per_mb);
+                        sse2 = VP8_UVSSE(x, IF_RTCD(&cpi->rtcd.variance));
 
-                        break;
+                        if (sse2 * 2 < x->encode_breakout)
+                        {
+                            x->skip = 1;
+                            distortion2 = sse;
+                            rate2 = 500;
+                            disable_skip = 1;
+                            this_rd = RDFUNC(x->rdmult, x->rddiv, rate2,
+                              distortion2, cpi->target_bits_per_mb);
+
+                            break;
+                        }
                     }
                 }
             }
+
 
             //intermodecost[mode_index] = vp8_cost_mv_ref(this_mode, mdcounts);   // Experimental debug code