]> granicus.if.org Git - libvpx/commitdiff
Corrected usage of image strides
authorAdrian Grange <agrange@google.com>
Tue, 19 Jun 2012 18:19:40 +0000 (11:19 -0700)
committerAdrian Grange <agrange@google.com>
Tue, 19 Jun 2012 21:02:22 +0000 (14:02 -0700)
The function vp8_post_proc_down_and_across_c takes the
stride of both the src and dst images as parameters, but
assumes that they are the same.

I modified the code to use the correct strides, as the
assembler versions of these functions do.

Change-Id: I222715b774cd071b21c15a4b0d2f4aef64a520de

vp8/common/postproc.c

index 6fe644cd202c871f7c3ab3ca0c1ef09bd18ee88e..a7509ff4e28d5460afc7cda4ec4be265e83fec2c 100644 (file)
@@ -143,9 +143,7 @@ void vp8_post_proc_down_and_across_c
     int col;
     int i;
     int v;
-    int pitch = src_pixels_per_line;
     unsigned char d[8];
-    (void)dst_pixels_per_line;
 
     for (row = 0; row < rows; row++)
     {
@@ -161,10 +159,10 @@ void vp8_post_proc_down_and_across_c
 
             for (i = -2; i <= 2; i++)
             {
-                if (abs(v - p_src[col+i*pitch]) > flimit)
+                if (abs(v - p_src[col+i*src_pixels_per_line]) > flimit)
                     goto down_skip_convolve;
 
-                kernel += kernel5[2+i] * p_src[col+i*pitch];
+                kernel += kernel5[2+i] * p_src[col+i*src_pixels_per_line];
             }
 
             v = (kernel >> 3);
@@ -211,10 +209,9 @@ void vp8_post_proc_down_and_across_c
         p_dst[col-2] = d[(col-2)&7];
         p_dst[col-1] = d[(col-1)&7];
 
-
         /* next row */
-        src_ptr += pitch;
-        dst_ptr += pitch;
+        src_ptr += src_pixels_per_line;
+        dst_ptr += dst_pixels_per_line;
     }
 }