shithub: libvpx

Download patch

ref: cc1aac1b3cca2a4e388ba9c6d814a472eab33bca
parent: 585190474411493efa279339e74153d2ffa9474f
parent: 5efd9609e30eb4220d100a8f32991f8e8b7b63a3
author: John Koleszar <jkoleszar@google.com>
date: Tue Jul 16 07:23:38 EDT 2013

Merge "Fix above context pointers"

--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -158,10 +158,6 @@
   if (!oci->above_context[0])
     goto fail;
 
-  for (i = 1; i < MAX_MB_PLANE; i++)
-    oci->above_context[i] =
-        oci->above_context[0] + i * sizeof(ENTROPY_CONTEXT) * 2 * mi_cols;
-
   oci->above_seg_context = vpx_calloc(sizeof(PARTITION_CONTEXT) * mi_cols, 1);
   if (!oci->above_seg_context)
     goto fail;
@@ -197,9 +193,15 @@
 }
 
 void vp9_update_frame_size(VP9_COMMON *cm) {
+  int i, mi_cols;
   const int aligned_width = ALIGN_POWER_OF_TWO(cm->width, LOG2_MI_SIZE);
   const int aligned_height = ALIGN_POWER_OF_TWO(cm->height, LOG2_MI_SIZE);
 
   set_mb_mi(cm, aligned_width, aligned_height);
   setup_mi(cm);
+
+  mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
+  for (i = 1; i < MAX_MB_PLANE; i++)
+    cm->above_context[i] =
+        cm->above_context[0] + i * sizeof(ENTROPY_CONTEXT) * 2 * mi_cols;
 }
--