Rework loop filter tx size selection
Update and capture the effective transform block size per color
plane.
Change-Id: Ib6e0e7abb3973db6b8d511ee7c9948aaab048788
diff --git a/av1/common/alloccommon.c b/av1/common/alloccommon.c
index c1b596b..80f6b09 100644
--- a/av1/common/alloccommon.c
+++ b/av1/common/alloccommon.c
@@ -125,6 +125,11 @@
#if CONFIG_VAR_TX
aom_free(cm->above_txfm_context);
cm->above_txfm_context = NULL;
+
+ for (i = 0; i < MAX_MB_PLANE; ++i) {
+ aom_free(cm->top_txfm_context[i]);
+ cm->top_txfm_context[i] = NULL;
+ }
#endif
}
@@ -170,6 +175,14 @@
cm->above_txfm_context = (TXFM_CONTEXT *)aom_calloc(
aligned_mi_cols << TX_UNIT_WIDE_LOG2, sizeof(*cm->above_txfm_context));
if (!cm->above_txfm_context) goto fail;
+
+ for (i = 0; i < MAX_MB_PLANE; ++i) {
+ aom_free(cm->top_txfm_context[i]);
+ cm->top_txfm_context[i] =
+ (TXFM_CONTEXT *)aom_calloc(aligned_mi_cols << TX_UNIT_WIDE_LOG2,
+ sizeof(*cm->top_txfm_context[0]));
+ if (!cm->top_txfm_context[i]) goto fail;
+ }
#endif
cm->above_context_alloc_cols = aligned_mi_cols;