ref: 2e5bbdc8fc9510b34e1d9cf5a475910d992ef2c0
parent: c40224631ad20d41f73fc78576dc770169004346
author: Paul Wilkins <paulwilkins@google.com>
date: Thu Dec 6 08:34:41 EST 2018
Improve rd_variance_adjustment() for low variance blocks. Change the cross over point for switching between per pixel and per block variance numbers when comparing reconstruction and source complexity. This improves the accuracy of the comparison for low variance regions, For example, recon and source may both have an integer per pixel variance of 1, but one of these may actually be be 1.01 and the other 1.99. The reason for using per pixel at all was because this number is already available for the source block so does not need to be recomputed here. Changing the threshold from >0 to >100 for using per pixel values will thus cause a little extra work for some blocks. With my default runs on derf and nf sets their is a net gain as follows: (-ve = better, Overal PSNR, SSIm, PSNR-HVS) derf low res -0.106, -0.107, -0.093 midres -0.000, -0.021, 0.001 hd res -0.198, -0.190, -0.282 nf2k -0.090, -0.088, -0.077 Change-Id: I53ef514fe1c35ee3f08c64e9b22fc05fc7fe5887
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2963,7 +2963,7 @@
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
- if (source_variance > 0) {
+ if (source_variance > 100) {
rec_variance = vp9_high_get_sby_perpixel_variance(cpi, &xd->plane[0].dst,
bsize, xd->bd);
src_variance = source_variance;
@@ -2974,7 +2974,7 @@
vp9_high_get_sby_variance(cpi, &x->plane[0].src, bsize, xd->bd);
}
} else {
- if (source_variance > 0) {
+ if (source_variance > 100) {
rec_variance =
vp9_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
src_variance = source_variance;
@@ -2984,7 +2984,7 @@
}
}
#else
- if (source_variance > 0) {
+ if (source_variance > 100) {
rec_variance = vp9_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
src_variance = source_variance;
} else {