shithub: libvpx

Download patch

ref: 160f3c7e9e25089b5e0c9f324415333051510a5e
parent: d88da98614e1e095fabde411e97ff4c081441f5c
parent: 718c19711ad2e097e480b089eac87c77b2f32534
author: Yaowu Xu <yaowu@google.com>
date: Wed Dec 8 08:08:04 EST 2010

Merge "vp8e - static threshold play"

--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -2241,8 +2241,7 @@
             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)
-            {
+            if (cpi->active_map_enabled && x->active_ptr[0] == 0) {
                 x->skip = 1;
             }
             else if (sse < x->encode_breakout)
@@ -2250,21 +2249,23 @@
                 // Check u and v to make sure skip is ok
                 int sse2 = 0;
 
-                sse2 = VP8_UVSSE(x, IF_RTCD(&cpi->rtcd.variance));
-
-                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;
+                    sse2 = VP8_UVSSE(x, IF_RTCD(&cpi->rtcd.variance));
 
-                    disable_skip = 1;    // We have no real rate data so trying to adjust for rate_y and rate_uv below will cause problems.
-                    this_rd = RDFUNC(x->rdmult, x->rddiv, rate2, distortion2, cpi->target_bits_per_mb);
+                    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;              // (PGW) Move break here from below - for now at least
+                        break;
+                    }
                 }
-                else
-                    x->skip = 0;
             }
 
             //intermodecost[mode_index] = vp8_cost_mv_ref(this_mode, mdcounts);   // Experimental debug code
--