]> granicus.if.org Git - libvpx/commitdiff
Don't initialize extra context tree buffers for 4x8 and 8x4.
authorAlex Converse <aconverse@google.com>
Fri, 24 Jul 2015 17:35:10 +0000 (10:35 -0700)
committerAlex Converse <aconverse@google.com>
Fri, 24 Jul 2015 18:14:33 +0000 (11:14 -0700)
Change-Id: Ib669d572654f24fd43410a9399a8b609e87f846a

vp9/encoder/vp9_context_tree.c

index fbff9d7a0e747840de89e156ce77febb01f57510..e87cccba5464f4a12d635800ded43afb0c9e7c44 100644 (file)
@@ -69,10 +69,13 @@ static void alloc_tree_contexts(VP9_COMMON *cm, PC_TREE *tree,
   alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[0]);
   alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[0]);
 
-  /* TODO(Jbb): for 4x8 and 8x4 these allocated values are not used.
-   * Figure out a better way to do this. */
-  alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[1]);
-  alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[1]);
+  if (num_4x4_blk > 4) {
+    alloc_mode_context(cm, num_4x4_blk/2, &tree->horizontal[1]);
+    alloc_mode_context(cm, num_4x4_blk/2, &tree->vertical[1]);
+  } else {
+    memset(&tree->horizontal[1], 0, sizeof(tree->horizontal[1]));
+    memset(&tree->vertical[1], 0, sizeof(tree->vertical[1]));
+  }
 }
 
 static void free_tree_contexts(PC_TREE *tree) {