shithub: libvpx

Download patch

ref: b79d5b62bde18167349578f49eada7447f1a077d
parent: 31c03b31fe83e5d61df7367ac1aea3ddba6b2494
author: Tim Kopp <[email protected]>
date: Fri Jun 13 12:02:36 EDT 2014

Fixed VP9 denoiser COPY_BLOCK case

Now copies the src to the correct location in the running average buffer.

Change-Id: I9c83c96dc7a97f42c8df16ab4a9f18b733181f34

--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -93,12 +93,14 @@
   int decision = COPY_BLOCK;
 
   YV12_BUFFER_CONFIG avg = denoiser->running_avg_y[INTRA_FRAME];
+  YV12_BUFFER_CONFIG mc_avg = denoiser->mc_running_avg_y;
+  uint8_t *avg_start = block_start(avg.y_buffer, avg.y_stride, mi_row, mi_col);
+  uint8_t *mc_avg_start = block_start(mc_avg.y_buffer, mc_avg.y_stride,
+                                          mi_row, mi_col);
   struct buf_2d src = mb->plane[0].src;
 
-  update_running_avg(denoiser->mc_running_avg_y.y_buffer,
-                     denoiser->mc_running_avg_y.y_stride,
-                     denoiser->running_avg_y[INTRA_FRAME].y_buffer,
-                     denoiser->running_avg_y[INTRA_FRAME].y_stride,
+
+  update_running_avg(mc_avg_start, mc_avg.y_stride, avg_start, avg.y_stride,
                      mb->plane[0].src.buf, mb->plane[0].src.stride, 0, bs);
 
   if (decision == FILTER_BLOCK) {
@@ -105,8 +107,7 @@
     // TODO(tkopp)
   }
   if (decision == COPY_BLOCK) {
-    copy_block(block_start(avg.y_buffer, avg.y_stride, mi_row, mi_col),
-               avg.y_stride, src.buf, src.stride, bs);
+    copy_block(avg_start, avg.y_stride, src.buf, src.stride, bs);
   }
 }