Fix tile boundary calculation
Fix a rare case in which the tile boundary information was not
set up properly in the decoder when using LOOPFILTERING_ACROSS_TILES
The situation was:
* One frame uses loop filtering across tiles. Then its tile
boundary information is not needed, so is not calculated.
* The next frame (in decode order) has the same size and the
same tile layout, but doesn't use loop filtering across tiles.
* Now the tile boundary information *is* needed, but we weren't
recalculating it. This resulted in the loop filter being
applied across tile boundaries even though we signalled not to.
Since the conditions on when we can reuse the previous frame's
boundary information are complex, and the overhead of calculating
the tile boundaries is low, we avoid this issue by simply
recalculating the boundary information each frame.
Change-Id: I1f3cbb0537535bf38faaed4c21c07142e747f962
diff --git a/av1/common/tile_common.c b/av1/common/tile_common.c
index e5a95e6..b01d26c 100644
--- a/av1/common/tile_common.c
+++ b/av1/common/tile_common.c
@@ -103,13 +103,10 @@
}
}
+#if CONFIG_LOOPFILTERING_ACROSS_TILES
void av1_setup_across_tile_boundary_info(const AV1_COMMON *const cm,
const TileInfo *const tile_info) {
- int lpf_across_tiles_enabled = 1;
-#if CONFIG_LOOPFILTERING_ACROSS_TILES
- lpf_across_tiles_enabled = cm->loop_filter_across_tiles_enabled;
-#endif
- if ((cm->tile_cols * cm->tile_rows > 1) && (!lpf_across_tiles_enabled)) {
+ if (cm->tile_cols * cm->tile_rows > 1) {
const int mi_row = tile_info->mi_row_start;
const int mi_col = tile_info->mi_col_start;
MODE_INFO *const mi_start = cm->mi + mi_row * cm->mi_stride + mi_col;
@@ -150,7 +147,6 @@
}
}
-#if CONFIG_LOOPFILTERING_ACROSS_TILES
int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm) {
return (!cm->loop_filter_across_tiles_enabled &&
(cm->tile_cols * cm->tile_rows > 1));