shithub: libvpx

Download patch

ref: da3b24c83272773ba8bf1060bae905543ef3bb91
parent: b2f29a9a716b119c2297befeb2e119202a259c41
author: Marco Paniconi <[email protected]>
date: Mon Apr 8 10:21:41 EDT 2019

vp9-rtc: Fix to rate cost for switchable filter

Add consistent switchable rate cost, which should be only
when non-integer motion mode is tested.

Neutal/negligible change in metrics.

Also diable the re-evaluation of ZEROMV mode after denoising
feature, as this rate cost fix exposed an exsting issue
with this feature.

Change-Id: I9e5479281810a392b9a409e238c564b2def8e546

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1637,7 +1637,11 @@
       (cpi->sf.adaptive_rd_thresh_row_mt)
           ? &(tile_data->row_base_thresh_freq_fact[thresh_freq_fact_idx])
           : tile_data->thresh_freq_fact[bsize];
-
+#if CONFIG_VP9_TEMPORAL_DENOISING
+  // TODO(marpan/jianj): Re-enable this feature (re-evaluate ZEROMV mode
+  // on denoised signal) when mismatch issue is resolved.
+  const int denoise_recheck_zeromv = 0;
+#endif
   INTERP_FILTER filter_ref;
   const int bsl = mi_width_log2_lookup[bsize];
   const int pred_filter_search =
@@ -2284,9 +2288,10 @@
           this_rdc.rate += vp9_get_switchable_rate(cpi, xd);
       }
     } else {
-      this_rdc.rate += cm->interp_filter == SWITCHABLE
-                           ? vp9_get_switchable_rate(cpi, xd)
-                           : 0;
+      if (cm->interp_filter == SWITCHABLE) {
+        if ((mi->mv[0].as_mv.row | mi->mv[0].as_mv.col) & 0x07)
+          this_rdc.rate += vp9_get_switchable_rate(cpi, xd);
+      }
       this_rdc.rate += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
     }
 
@@ -2595,8 +2600,9 @@
                                 frame_mv, reuse_inter_pred, &best_pickmode);
     vp9_denoiser_denoise(cpi, x, mi_row, mi_col, bsize, ctx, &decision,
                          gf_temporal_ref);
-    recheck_zeromv_after_denoising(cpi, mi, x, xd, decision, &ctx_den, yv12_mb,
-                                   &best_rdc, bsize, mi_row, mi_col);
+    if (denoise_recheck_zeromv)
+      recheck_zeromv_after_denoising(cpi, mi, x, xd, decision, &ctx_den,
+                                     yv12_mb, &best_rdc, bsize, mi_row, mi_col);
     best_pickmode.best_ref_frame = ctx_den.best_ref_frame;
   }
 #endif