postproc: allocate enough memory for limits buffer
authorJohn Koleszar <jkoleszar@google.com>
Mon, 22 Oct 2012 21:21:59 +0000 (14:21 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Mon, 22 Oct 2012 22:07:52 +0000 (15:07 -0700)
The vp8_post_proc_down_and_across_mb_row_sse2() needs space for an
even number of macroblocks, as they are read two at a time for the
chroma planes. Round up the width during the allocation of
pp_limits_buffer to support this.

Change-Id: Ibfc10c7be290d961ab23ac3dde12a7bb96c12af0

vp8/common/alloccommon.c

index a03f882..8af9e90 100644 (file)
@@ -107,8 +107,11 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
     vpx_memset(oci->post_proc_buffer.buffer_alloc, 128,
                oci->post_proc_buffer.frame_size);
 
-    /* Allocate buffer to store post-processing filter coefficients. */
-    oci->pp_limits_buffer = vpx_memalign(16, 24 * oci->mb_cols);
+    /* Allocate buffer to store post-processing filter coefficients.
+     *
+     * Note: Round up mb_cols to support SIMD reads
+     */
+    oci->pp_limits_buffer = vpx_memalign(16, 24 * ((oci->mb_cols + 1) & ~1));
     if (!oci->pp_limits_buffer)
         goto allocation_fail;
 #endif