shithub: libvpx

Download patch

ref: b202e475e936e9b529975aa0dc72f6170699543b
parent: 26955b2b6a3e36c8d96e2d4d359d5575be36aa7e
parent: 7c45dc98a8c80030c7f2994ab749d779b55b3047
author: Jingning Han <jingning@google.com>
date: Thu Jun 19 07:47:55 EDT 2014

Merge "Separate rate-distortion modeling for DC and AC coefficients"

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -172,15 +172,15 @@
   else
     x->skip_txfm = 0;
 
-  // TODO(jingning) This is a temporary solution to account for frames with
-  // light changes. Need to customize the rate-distortion modeling for non-RD
-  // mode decision.
-  if ((sse >> 3) > var)
-    sse = var;
-  vp9_model_rd_from_var_lapndz(var + sse, 1 << num_pels_log2_lookup[bsize],
-                               ac_quant >> 3, &rate, &dist);
-  *out_rate_sum = rate;
+  vp9_model_rd_from_var_lapndz(sse - var, 1 << num_pels_log2_lookup[bsize],
+                               dc_quant >> 3, &rate, &dist);
+  *out_rate_sum = rate >> 1;
   *out_dist_sum = dist << 3;
+
+  vp9_model_rd_from_var_lapndz(var, 1 << num_pels_log2_lookup[bsize],
+                               ac_quant >> 3, &rate, &dist);
+  *out_rate_sum += rate;
+  *out_dist_sum += dist << 4;
 }
 
 // TODO(jingning) placeholder for inter-frame non-RD mode decision.