From: Adrian Grange Date: Tue, 19 Jun 2012 18:19:40 +0000 (-0700) Subject: Corrected usage of image strides X-Git-Tag: v1.2.0~171 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5eaa9bcfe361d0ecd2554291388d6c2113c6b1b1;p=libvpx Corrected usage of image strides 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 --- diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index 6fe644cd2..a7509ff4e 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -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; } }