ref: 0ef5016878f0c22ac8262db78eef0b977ccb3b9c
parent: 247a28c280677b92537951f61b218d3c79ed3800
author: Paul Wilkins <[email protected]>
date: Fri Mar 8 10:36:42 EST 2019
Further Adjustments to film mode bias. Stronger bias against variance below source than above. Change-Id: Ied3992f4204e14433c6841d51c192118be954f0a
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3137,7 +3137,7 @@
unsigned int rec_variance;
unsigned int src_variance;
unsigned int src_rec_min;
- unsigned int absvar_diff = 0;
+ unsigned int var_diff = 0;
unsigned int var_factor = 0;
unsigned int adj_max;
unsigned int low_var_thresh = LOW_VAR_THRESH;
@@ -3183,13 +3183,15 @@
if (src_rec_min > low_var_thresh) return;
- absvar_diff = (src_variance > rec_variance) ? (src_variance - rec_variance)
- : (rec_variance - src_variance);
+ // We care more when the reconstruction has lower variance so give this case
+ // a stronger weighting.
+ var_diff = (src_variance > rec_variance) ? (src_variance - rec_variance) * 2
+ : (rec_variance - src_variance) / 2;
adj_max = max_var_adjust[content_type];
var_factor =
- (unsigned int)((int64_t)VAR_MULT * absvar_diff) / VPXMAX(1, src_variance);
+ (unsigned int)((int64_t)VAR_MULT * var_diff) / VPXMAX(1, src_variance);
var_factor = VPXMIN(adj_max, var_factor);
*this_rd += (*this_rd * var_factor) / 100;