DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (5b81998bb7ab)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
# 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