shithub: libvpx

Download patch

ref: 861a6bbbfdbaf7e1aedff0be9078b76fd0f214b1
parent: 4cf4c94ad1668dd140e2185497192d92c35d98ea
author: John Koleszar <jkoleszar@google.com>
date: Mon Oct 22 10:21:59 EDT 2012

postproc: allocate enough memory for limits buffer

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

--- a/vp8/common/alloccommon.c
+++ b/vp8/common/alloccommon.c
@@ -107,8 +107,11 @@
     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