Add an experiment to disable lpf on tile boundaries
This commit adds a new experiment to allow disabling of loop filtering
on tile boundaries. It is implemented by adding a syntax field
"loopfilter_across_tiles_enabled" into the uncompressed frame header.
If it is set to 0, decoder and encoder will disables loop filtering for
block edges that are also tile boundaries.
Change-Id: Ib80bfd82d49c74f1ba46ae18ceedb30704ac8aa5
diff --git a/av1/common/tile_common.c b/av1/common/tile_common.c
index 2c0e5c6..62ceb12 100644
--- a/av1/common/tile_common.c
+++ b/av1/common/tile_common.c
@@ -59,3 +59,29 @@
assert(*min_log2_tile_cols <= *max_log2_tile_cols);
}
#endif // !CONFIG_EXT_TILE
+
+#if CONFIG_DEBLOCKING_ACROSS_TILES
+void av1_update_tile_boundary_info(const struct AV1Common *cm,
+ const TileInfo *const tile_info, int mi_row,
+ int mi_col) {
+ int row, col;
+ for (row = mi_row; row < (mi_row + cm->mib_size); row++)
+ for (col = mi_col; col < (mi_col + cm->mib_size); col++) {
+ MODE_INFO *const mi = cm->mi + row * cm->mi_stride + col;
+ mi->mbmi.tile_boundary_info = 0;
+ if (row == tile_info->mi_row_start)
+ mi->mbmi.tile_boundary_info |= TILE_ABOVE_BOUNDARY;
+ if (col == tile_info->mi_col_start)
+ mi->mbmi.tile_boundary_info |= TILE_LEFT_BOUNDARY;
+ if ((row + 1) >= tile_info->mi_row_end)
+ mi->mbmi.tile_boundary_info |= TILE_BOTTOM_BOUNDARY;
+ if ((col + 1) >= tile_info->mi_col_end)
+ mi->mbmi.tile_boundary_info |= TILE_RIGHT_BOUNDARY;
+ }
+}
+
+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));
+}
+#endif // CONFIG_DEBLOCKING_ACROSS_TILES