vp9 svc: copy block if ref buffer in denoiser is NULL.
authorJerome Jiang <jianj@google.com>
Tue, 27 Nov 2018 20:29:47 +0000 (12:29 -0800)
committerJerome Jiang <jianj@google.com>
Tue, 27 Nov 2018 23:56:57 +0000 (15:56 -0800)
BUG=b/119097707

Change-Id: I6569306e897da46a44f9d8f2fb28a2a355dd4c2c

vp9/encoder/vp9_denoiser.c

index ab91971..8c039b2 100644 (file)
@@ -263,6 +263,14 @@ static VP9_DENOISER_DECISION perform_motion_compensation(
     denoise_layer_idx = num_spatial_layers - spatial_layer - 1;
   }
 
+  // Force copy (no denoise, copy source in denoised buffer) if
+  // running_avg_y[frame] is NULL.
+  if (denoiser->running_avg_y[frame].buffer_alloc == NULL) {
+    // Restore everything to its original state
+    *mi = saved_mi;
+    return COPY_BLOCK;
+  }
+
   if (ctx->newmv_sse > sse_thresh(bs, increase_denoising)) {
     // Restore everything to its original state
     *mi = saved_mi;