pjs/media/libvpx/I3915d597.patch

42 строки
1.6 KiB
Diff

# HG changeset patch
# Parent 0d104ba08fe98d5024014fbf45af06100ef7b6f9
# User Timothy B. Terriberry <tterribe@vt.edu>
Align internal mfqe framebuffer dimensions
Upstream Change-Id: I3915d597cd66886a24f4ef39752751ebe6425066
diff --git a/media/libvpx/vp8/common/postproc.c b/media/libvpx/vp8/common/postproc.c
--- a/media/libvpx/vp8/common/postproc.c
+++ b/media/libvpx/vp8/common/postproc.c
@@ -938,20 +938,26 @@ int vp8_post_proc_frame(VP8_COMMON *oci,
return 0;
}
/* Allocate post_proc_buffer_int if needed */
if ((flags & VP8D_MFQE) && !oci->post_proc_buffer_int_used)
{
if ((flags & VP8D_DEBLOCK) || (flags & VP8D_DEMACROBLOCK))
{
- if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int, oci->Width, oci->Height, VP8BORDERINPIXELS) >= 0)
- {
- oci->post_proc_buffer_int_used = 1;
- }
+ int width = (oci->Width + 15) & ~15;
+ int height = (oci->Height + 15) & ~15;
+
+ if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer_int,
+ width, height, VP8BORDERINPIXELS))
+ vpx_internal_error(&oci->error, VPX_CODEC_MEM_ERROR,
+ "Failed to allocate MFQE framebuffer");
+
+ oci->post_proc_buffer_int_used = 1;
+
// insure that postproc is set to all 0's so that post proc
// doesn't pull random data in from edge
vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,126,(&oci->post_proc_buffer)->frame_size);
}
}
#if ARCH_X86||ARCH_X86_64