ref: 7af0e984b8b83344e013bb24df18322823197eb2
parent: 5a657908140f58fe9d5672cd6acd1666c71490fb
parent: 74f98e6f45dcd63bc1f43cad970ee080d90e65ba
author: Jingning Han <[email protected]>
date: Wed May 7 13:36:00 EDT 2014
Merge "Tune rate-distortion modeling to account for frame light change"
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -164,7 +164,13 @@
int var = cpi->fn_ptr[bsize].vf(p->src.buf, p->src.stride,
pd->dst.buf, pd->dst.stride, &sse);
- vp9_model_rd_from_var_lapndz(sse + var, 1 << num_pels_log2_lookup[bsize],
+ // 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],
pd->dequant[1] >> 3, &rate, &dist);
*out_rate_sum = rate;
*out_dist_sum = dist << 3;