shithub: libvpx

Download patch

ref: 2af46568bdb47330b9b26bed9655ebdc7c6347bd
parent: b590629119b360360ae9f824a02ede6c6b096d52
parent: 44472cde550764a2919ff2025e1d1ae40bc38ddf
author: James Zern <jzern@google.com>
date: Sat Jun 28 06:21:38 EDT 2014

Merge "vp9: disable postproc buffer alloc when unnecessary"

--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -127,12 +127,15 @@
 int vp9_resize_frame_buffers(VP9_COMMON *cm, int width, int height) {
   const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2);
   const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2);
+#if CONFIG_INTERNAL_STATS || CONFIG_VP9_POSTPROC
   const int ss_x = cm->subsampling_x;
   const int ss_y = cm->subsampling_y;
 
+  // TODO(agrange): this should be conditionally allocated.
   if (vp9_realloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
                                VP9_DEC_BORDER_IN_PIXELS, NULL, NULL, NULL) < 0)
     goto fail;
+#endif
 
   set_mb_mi(cm, aligned_width, aligned_height);
 
@@ -199,9 +202,11 @@
 
   init_frame_bufs(cm);
 
+#if CONFIG_INTERNAL_STATS || CONFIG_VP9_POSTPROC
   if (vp9_alloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
                              VP9_ENC_BORDER_IN_PIXELS) < 0)
     goto fail;
+#endif
 
   return 0;