AV1 Loop Filtering Across Tile Borders Explained
This article explores how the AV1 video codec manages in-loop
filtering across tile boundaries, balancing multithreaded decoding
performance with visual consistency. In AV1, three primary filter
stages—the Deblocking Filter, the Constrained Directional Enhancement
Filter (CDEF), and the Loop Restoration filter—process reconstructed
frames. Their behavior at tile edges is primarily controlled by the
frame-level syntax flag loop_filter_across_tiles_enabled,
which dictates whether cross-boundary pixel dependencies are processed
or completely severed to enable independent tile processing.
The Role of Tiles and Independence
Tiles in AV1 partition a frame into distinct rectangular grids, allowing parallel encoding and decoding. To achieve true thread independence during decoding, a tile cannot depend on the reconstructed pixel data of adjacent tiles. However, video compression artifacts often manifest along grid lines, making filtering across tile seams desirable to prevent visible boundary lines.
AV1 resolves this tension through the
loop_filter_across_tiles_enabled syntax element defined in
the uncompressed frame header. When set to 0, tile borders
are treated as picture boundaries for the relevant filter stages. When
set to 1, filters access pixels from adjacent tiles,
requiring decoder synchronization or an extra post-processing pass over
the tile seams.
Deblocking Filter (DBF) Across Tile Borders
The deblocking filter removes block artifacts caused by transform block boundaries and prediction boundaries.
- Enabled
(
loop_filter_across_tiles_enabled = 1): The deblocking filter processes edges on tile boundaries identically to regular transform or prediction block edges within a tile. Vertical and horizontal edges lying directly on tile borders use filter sample values from both the current tile and the neighboring tile. - Disabled
(
loop_filter_across_tiles_enabled = 0): Edge filtering on tile boundaries is skipped entirely. No boundary filtering is performed across the seam, preventing any inter-tile data dependency. Within each tile, edges close to the boundary are filtered using only samples available inside that tile; filter operations do not sample across the border.
Constrained Directional Enhancement Filter (CDEF)
CDEF operates after the deblocking filter to eliminate ringing artifacts by applying non-linear filtering along identified edge directions. CDEF requires a 7x7 or 5x5 neighborhood of pixels around each 8x8 block.
- Enabled: CDEF accesses reconstructed, deblocked pixels from adjacent tiles. Filtering continues smoothly across the boundary, maintaining directional continuity.
- Disabled: CDEF treats the tile boundary as an image edge. Pixels that fall outside the current tile boundary are unavailable. To execute the filter without reading adjacent tile data, AV1 uses sample padding (repeating the nearest valid boundary pixel, similar to edge clamping) for any required taps that lie across the tile line.
Loop Restoration Filter (LR)
Loop Restoration applies either a Wiener filter or a Self-Guided filter to restore fine details and high frequencies. It operates on large processing zones called Restoration Units (typically 64x64, 128x128, or 256x256 pixels).
- Enabled: Restoration filter kernels draw source samples freely across tile lines. Intermediate line buffers can extend into adjacent tiles to construct the required filtering neighborhood.
- Disabled: Restoration units are clipped at the tile boundary. When filter taps require samples located outside the current tile, the reference samples are extended by replicating border samples. Furthermore, loop restoration parameters cannot be derived using statistics gathered from neighboring tiles.
Performance and Quality Trade-offs
Disabling loop filtering across tiles guarantees zero-wait multithreading, allowing decoders to finish tiles completely out of order without inter-thread synchronization during the filtering stages. The drawback is potential boundary artifacts ("grid lines") along tile divisions, especially at low bitrates.
Enabling filtering across borders improves visual quality and objective metrics (PSNR, VMAF) by eliminating tile seams, but it mandates a synchronized filtering stage or multi-pass architecture where tile decoding must complete prior to executing cross-boundary filter taps.