]> granicus.if.org Git - libvpx/commitdiff
Improve rd_variance_adjustment() for low variance blocks.
authorPaul Wilkins <paulwilkins@google.com>
Thu, 6 Dec 2018 13:34:41 +0000 (13:34 +0000)
committerPaul Wilkins <paulwilkins@google.com>
Thu, 6 Dec 2018 13:34:41 +0000 (13:34 +0000)
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

vp9/encoder/vp9_rdopt.c

index b55e2ddb4117556eef9d043a845acd891c90c243..84ae130d440c3a595cffd9b9a6672e55063cc5b1 100644 (file)
@@ -2963,7 +2963,7 @@ static void rd_variance_adjustment(VP9_COMP *cpi, MACROBLOCK *x,
 
 #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 @@ static void rd_variance_adjustment(VP9_COMP *cpi, MACROBLOCK *x,
           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 @@ static void rd_variance_adjustment(VP9_COMP *cpi, MACROBLOCK *x,
     }
   }
 #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 {