From 861a6bbbfdbaf7e1aedff0be9078b76fd0f214b1 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Mon, 22 Oct 2012 14:21:59 -0700 Subject: [PATCH] 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 --- vp8/common/alloccommon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vp8/common/alloccommon.c b/vp8/common/alloccommon.c index a03f882dc..8af9e9049 100644 --- a/vp8/common/alloccommon.c +++ b/vp8/common/alloccommon.c @@ -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 -- 2.40.0