summaryrefslogtreecommitdiffstats
path: root/third_party/aom/av1/encoder/context_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/av1/encoder/context_tree.c')
-rw-r--r--third_party/aom/av1/encoder/context_tree.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/third_party/aom/av1/encoder/context_tree.c b/third_party/aom/av1/encoder/context_tree.c
index 4c7d6ff00..b1c01b28e 100644
--- a/third_party/aom/av1/encoder/context_tree.c
+++ b/third_party/aom/av1/encoder/context_tree.c
@@ -65,12 +65,10 @@ static void alloc_mode_context(AV1_COMMON *cm, int num_4x4_blk,
}
#if CONFIG_PALETTE
- if (cm->allow_screen_content_tools) {
- for (i = 0; i < 2; ++i) {
- CHECK_MEM_ERROR(
- cm, ctx->color_index_map[i],
- aom_memalign(32, num_pix * sizeof(*ctx->color_index_map[i])));
- }
+ for (i = 0; i < 2; ++i) {
+ CHECK_MEM_ERROR(
+ cm, ctx->color_index_map[i],
+ aom_memalign(32, num_pix * sizeof(*ctx->color_index_map[i])));
}
#endif // CONFIG_PALETTE
}
@@ -141,7 +139,13 @@ static void alloc_tree_contexts(AV1_COMMON *cm, PC_TREE *tree,
&tree->verticalb[1]);
alloc_mode_context(cm, num_4x4_blk / 4, PARTITION_VERT_B,
&tree->verticalb[2]);
-#ifdef CONFIG_SUPERTX
+ for (int i = 0; i < 4; ++i) {
+ alloc_mode_context(cm, num_4x4_blk / 4, PARTITION_HORZ_4,
+ &tree->horizontal4[i]);
+ alloc_mode_context(cm, num_4x4_blk / 4, PARTITION_HORZ_4,
+ &tree->vertical4[i]);
+ }
+#if CONFIG_SUPERTX
alloc_mode_context(cm, num_4x4_blk, PARTITION_HORZ,
&tree->horizontal_supertx);
alloc_mode_context(cm, num_4x4_blk, PARTITION_VERT, &tree->vertical_supertx);
@@ -159,7 +163,7 @@ static void alloc_tree_contexts(AV1_COMMON *cm, PC_TREE *tree,
alloc_mode_context(cm, num_4x4_blk, &tree->none);
alloc_mode_context(cm, num_4x4_blk / 2, &tree->horizontal[0]);
alloc_mode_context(cm, num_4x4_blk / 2, &tree->vertical[0]);
-#ifdef CONFIG_SUPERTX
+#if CONFIG_SUPERTX
alloc_mode_context(cm, num_4x4_blk, &tree->horizontal_supertx);
alloc_mode_context(cm, num_4x4_blk, &tree->vertical_supertx);
alloc_mode_context(cm, num_4x4_blk, &tree->split_supertx);
@@ -184,13 +188,17 @@ static void free_tree_contexts(PC_TREE *tree) {
free_mode_context(&tree->verticala[i]);
free_mode_context(&tree->verticalb[i]);
}
+ for (i = 0; i < 4; ++i) {
+ free_mode_context(&tree->horizontal4[i]);
+ free_mode_context(&tree->vertical4[i]);
+ }
#endif // CONFIG_EXT_PARTITION_TYPES
free_mode_context(&tree->none);
free_mode_context(&tree->horizontal[0]);
free_mode_context(&tree->horizontal[1]);
free_mode_context(&tree->vertical[0]);
free_mode_context(&tree->vertical[1]);
-#ifdef CONFIG_SUPERTX
+#if CONFIG_SUPERTX
free_mode_context(&tree->horizontal_supertx);
free_mode_context(&tree->vertical_supertx);
free_mode_context(&tree->split_supertx);