shithub: libvpx

Download patch

ref: 49741fee9feca9695424818a2e63b194696d03b1
parent: 82dc1332af4b16d3e4ad3c4358498820637b7add
author: Tim Kopp <[email protected]>
date: Tue Jul 1 04:31:06 EDT 2014

Replaced loops with vpx_memcpy()

Change-Id: Icbe05657f0e92c3838e6a5a975f4f82d21328a2e

--- a/vp9/encoder/vp9_denoiser.c
+++ b/vp9/encoder/vp9_denoiser.c
@@ -81,13 +81,11 @@
   return framebuf + (stride * mi_row * 8) + (mi_col * 8);
 }
 
-void copy_block(uint8_t *dest, int dest_stride,
-                uint8_t *src, int src_stride, BLOCK_SIZE bs) {
-  int r, c;
+static void copy_block(uint8_t *dest, int dest_stride,
+                       const uint8_t *src, int src_stride, BLOCK_SIZE bs) {
+  int r;
   for (r = 0; r < heights[bs]; ++r) {
-    for (c = 0; c < widths[bs]; ++c) {
-      dest[c] = src[c];
-    }
+    vpx_memcpy(dest, src, widths[bs]);
     dest += dest_stride;
     src += src_stride;
   }
@@ -254,7 +252,7 @@
 }
 
 static void copy_frame(YV12_BUFFER_CONFIG dest, const YV12_BUFFER_CONFIG src) {
-  int r, c;
+  int r;
   const uint8_t *srcbuf = src.y_buffer;
   uint8_t *destbuf = dest.y_buffer;
   assert(dest.y_width == src.y_width);
@@ -261,9 +259,7 @@
   assert(dest.y_height == src.y_height);
 
   for (r = 0; r < dest.y_height; ++r) {
-    for (c = 0; c < dest.y_width; ++c) {
-      destbuf[c] = srcbuf[c];
-    }
+    vpx_memcpy(destbuf, srcbuf, dest.y_width);
     destbuf += dest.y_stride;
     srcbuf += src.y_stride;
   }