shithub: libvpx

Download patch

ref: c076467e8dfff4971227bb618cc60f6bfdb5ed20
parent: d40a5bc8a3558ba6c0eeeed11c964ed26544aabc
author: Jerome Jiang <[email protected]>
date: Wed Nov 28 12:26:18 EST 2018

vp9 denoiser: force copy block when last not a reference.

Last reference doesn't always exist when SVC layers changed dynamically.

When last is not a reference for current layer, copy block directly on
denoiser.

Change-Id: I9d98c4d6fdcfa25ba707db3333712761b5cf9ab8

--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -360,6 +360,7 @@
   int is_skin = 0;
   int increase_denoising = 0;
   int consec_zeromv = 0;
+  int last_is_reference = cpi->ref_frame_flags & VP9_LAST_FLAG;
   mv_col = ctx->best_sse_mv.as_mv.col;
   mv_row = ctx->best_sse_mv.as_mv.row;
   motion_magnitude = mv_row * mv_row + mv_col * mv_col;
@@ -403,7 +404,12 @@
   }
   if (!is_skin && denoiser->denoising_level == kDenHigh) increase_denoising = 1;
 
-  if (denoiser->denoising_level >= kDenLow && !ctx->sb_skip_denoising)
+  // Copy block if LAST_FRAME is not a reference.
+  // Last doesn't always exist when SVC layers are dynamically changed, e.g. top
+  // spatial layer doesn't have last reference when it's brought up for the
+  // first time on the fly.
+  if (last_is_reference && denoiser->denoising_level >= kDenLow &&
+      !ctx->sb_skip_denoising)
     decision = perform_motion_compensation(
         &cpi->common, denoiser, mb, bs, increase_denoising, mi_row, mi_col, ctx,
         motion_magnitude, is_skin, &zeromv_filter, consec_zeromv,