shithub: libvpx

Download patch

ref: c46694c1d93ccfa40cb1c3b7c04c167be59fded4
parent: b0ab51dc2bc9c84a25e5b0408b89f3d45bcde9ea
author: Marco Paniconi <marpan@google.com>
date: Wed Apr 10 17:34:36 EDT 2019

vp9-rtc: Fix to re-eval zero-mv for denoising

Change-Id: I3bb0646661efa06c8d1d688c746e41855c99f408

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1334,6 +1334,7 @@
         cpi->svc.number_spatial_layers == 1 &&
         decision == FILTER_ZEROMV_BLOCK))) {
     // Check if we should pick ZEROMV on denoised signal.
+    VP9_COMMON *const cm = &cpi->common;
     int rate = 0;
     int64_t dist = 0;
     uint32_t var_y = UINT_MAX;
@@ -1342,6 +1343,7 @@
     mi->mode = ZEROMV;
     mi->ref_frame[0] = LAST_FRAME;
     mi->ref_frame[1] = NONE;
+    set_ref_ptrs(cm, xd, mi->ref_frame[0], NONE);
     mi->mv[0].as_int = 0;
     mi->interp_filter = EIGHTTAP;
     if (cpi->sf.default_interp_filter == BILINEAR) mi->interp_filter = BILINEAR;
@@ -1359,6 +1361,7 @@
       this_rdc = *best_rdc;
       mi->mode = ctx_den->best_mode;
       mi->ref_frame[0] = ctx_den->best_ref_frame;
+      set_ref_ptrs(cm, xd, mi->ref_frame[0], NONE);
       mi->interp_filter = ctx_den->best_pred_filter;
       if (ctx_den->best_ref_frame == INTRA_FRAME) {
         mi->mv[0].as_int = INVALID_MV;
@@ -1638,9 +1641,7 @@
           ? &(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;
+  const int denoise_recheck_zeromv = 1;
 #endif
   INTERP_FILTER filter_ref;
   int pred_filter_search = cm->interp_filter == SWITCHABLE;