shithub: libvpx

Download patch

ref: 7686c950b563b63bd39f3699558bb22ba965274b
parent: 4e9b0d6cef6ba5fed6a33d5d3afe10ef9c3a5296
author: Jingning Han <[email protected]>
date: Wed Mar 12 06:03:28 EDT 2014

Tune rate-distortion modeling for non-RD mode decision

This commit adjusts the rate-distortion modeling for non-RD mode
decision. It puts more weights on energy from AC coefficients when
estimating the cost. The coding performance for rtc testset is
improved by 0.72%.

Change-Id: Ifa6ff11311a513ec2b10586589e82a9a21f6c61c

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -207,14 +207,14 @@
   struct macroblockd_plane *const pd = &xd->plane[0];
   const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
 
-  (void) cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride,
-                            pd->dst.buf, pd->dst.stride, &sse);
+  int var = cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride,
+                               pd->dst.buf, pd->dst.stride, &sse);
 
-  vp9_model_rd_from_var_lapndz(sse, 1 << num_pels_log2_lookup[bs],
+  vp9_model_rd_from_var_lapndz(var + sse, 1 << num_pels_log2_lookup[bs],
                                pd->dequant[1] >> 3, &rate, &dist);
 
   *out_rate_sum = rate;
-  *out_dist_sum = dist << 4;
+  *out_dist_sum = dist << 3;
 }
 
 // TODO(jingning) placeholder for inter-frame non-RD mode decision.