shithub: libvpx

Download patch

ref: d6cd3b7ec001620922f52544a81ae84a694cafbb
parent: dc6e6fbdcc7aee0d2ff7984e974ae045bd9805c9
author: Paul Wilkins <paulwilkins@google.com>
date: Fri Mar 1 10:37:58 EST 2019

Adjustment to low variance block bias in rd_variance_adjustment()

Adjust the extra bias applied for very low variance blocks to focus
mainly on DC_PRED.

Change-Id: I8f1c1a29932f319535807046846b604b5b8827c1

--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3131,7 +3131,8 @@
 static void rd_variance_adjustment(VP9_COMP *cpi, MACROBLOCK *x,
                                    BLOCK_SIZE bsize, int64_t *this_rd,
                                    struct buf_2d *recon,
-                                   MV_REFERENCE_FRAME ref_frame) {
+                                   MV_REFERENCE_FRAME ref_frame,
+                                   PREDICTION_MODE this_mode) {
   MACROBLOCKD *const xd = &x->e_mbd;
   unsigned int rec_variance;
   unsigned int src_variance;
@@ -3183,8 +3184,12 @@
 
   if (content_type == VP9E_CONTENT_FILM) {
     if (src_rec_min <= LOW_VAR_THRESH / 2) {
-      if (ref_frame == INTRA_FRAME) *this_rd *= 2;
-      if (bsize > BLOCK_16X16) *this_rd *= 2;
+      if (ref_frame == INTRA_FRAME) {
+        if (this_mode == DC_PRED)
+          *this_rd *= 2;
+        else
+          *this_rd += (*this_rd / 4);
+      }
     }
   }
 
@@ -3726,7 +3731,8 @@
     // Apply an adjustment to the rd value based on the similarity of the
     // source variance and reconstructed variance.
     if (recon) {
-      rd_variance_adjustment(cpi, x, bsize, &this_rd, recon, ref_frame);
+      rd_variance_adjustment(cpi, x, bsize, &this_rd, recon, ref_frame,
+                             this_mode);
     }
 
     if (ref_frame == INTRA_FRAME) {