]> granicus.if.org Git - libvpx/commitdiff
Changes to rd_variance_adjustment()
authorPaul Wilkins <paulwilkins@google.com>
Thu, 28 Feb 2019 16:23:35 +0000 (16:23 +0000)
committerPaul Wilkins <paulwilkins@google.com>
Mon, 11 Mar 2019 13:51:48 +0000 (13:51 +0000)
Always calculate per block variance values vs per pixel.

Change-Id: I760b3ba1a250d7544813a1b93923eedc207cbd60

vp9/encoder/vp9_rdopt.c

index 5fc3b7c05b37b199ff21f069efdb6f36bab67e9d..a21681c4e99e652e842a967a69f13c0305caaff0 100644 (file)
@@ -3019,34 +3019,17 @@ 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 > 100) {
-      rec_variance = vp9_high_get_sby_perpixel_variance(cpi, &xd->plane[0].dst,
-                                                        bsize, xd->bd);
-      src_variance = source_variance;
-    } else {
-      rec_variance =
-          vp9_high_get_sby_variance(cpi, &xd->plane[0].dst, bsize, xd->bd);
-      src_variance =
-          vp9_high_get_sby_variance(cpi, &x->plane[0].src, bsize, xd->bd);
-    }
-  } else {
-    if (source_variance > 100) {
-      rec_variance =
-          vp9_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
-      src_variance = source_variance;
-    } else {
-      rec_variance = vp9_get_sby_variance(cpi, &xd->plane[0].dst, bsize);
-      src_variance = vp9_get_sby_variance(cpi, &x->plane[0].src, bsize);
-    }
-  }
-#else
-  if (source_variance > 100) {
-    rec_variance = vp9_get_sby_perpixel_variance(cpi, &xd->plane[0].dst, bsize);
-    src_variance = source_variance;
+    rec_variance =
+        vp9_high_get_sby_variance(cpi, &xd->plane[0].dst, bsize, xd->bd);
+    src_variance =
+        vp9_high_get_sby_variance(cpi, &x->plane[0].src, bsize, xd->bd);
   } else {
     rec_variance = vp9_get_sby_variance(cpi, &xd->plane[0].dst, bsize);
     src_variance = vp9_get_sby_variance(cpi, &x->plane[0].src, bsize);
   }
+#else
+  rec_variance = vp9_get_sby_variance(cpi, &xd->plane[0].dst, bsize);
+  src_variance = vp9_get_sby_variance(cpi, &x->plane[0].src, bsize);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
   // Lower of source (raw per pixel value) and recon variance. Note that