ref: 964058129f7fc7bb2f0f940dcaa8cab0304f2c68
parent: a15edeb76d83ba60c1a3c416e128bf0db22ed18e
author: Alex Converse <[email protected]>
date: Fri Jul 24 06:35:10 EDT 2015
Don't initialize extra context tree buffers for 4x8 and 8x4. Change-Id: Ib669d572654f24fd43410a9399a8b609e87f846a
--- a/vp9/encoder/vp9_context_tree.c
+++ b/vp9/encoder/vp9_context_tree.c
@@ -69,10 +69,13 @@
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) {