Block-based coding leaves visible seams at block edges, so codecs filter each frame before it becomes a reference. See how deblocking, SAO and ALF differ.
When each block is quantized independently, values jump abruptly at the boundary between neighboring blocks. This is called a blocking artifact. The in-loop filter corrects this problem inside the decoder loop (before the picture is used as a reference frame).
The filtered result is used as the reference for predicting the next frames. So a well-designed filter doesn't just improve quality: it raises the accuracy of the reference frames and improves the compression efficiency of the frames that follow, too. This is the decisive difference from a simple post-processing filter — an in-loop filter is part of the standard, and decoders must apply it identically.
The oldest and most basic filter. It has existed in every mainstream codec since H.264. It smooths the pixels on both sides of a block edge, adjusting its strength by judging from the amount of pixel-value change (the gradient) whether the edge is a real object contour or a compression artifact.
A filter newly introduced by HEVC. Where deblocking smooths the 'edge', SAO looks at the overall pattern of pixel values. It has two modes.
The most powerful and complex in-loop filter. It analyzes the directionality of each block region (whether it has horizontal, vertical, or diagonal texture) and chooses and applies the best of several pre-trained sets of filter coefficients. In effect, a small adaptive signal-processing filter is built into the codec.
Several filters are applied in a fixed order (e.g., deblocking → SAO → ALF). Changing the order changes the result, so the standard specifies it strictly. In hardware decoder design, the in-loop filter chain easily becomes a pipeline bottleneck and takes up a large share of a decoder chip's silicon area and power. The steady addition of filters in AV2 likewise shows the compression efficiency ↔ decoder complexity trade-off.
A standardized filter applied right after reconstruction, before the picture is used as a reference frame.
The most basic filter, softening step artifacts at block edges.
HEVC's filter. Corrects brightness bias and ringing with band/edge offsets.
The filter in VVC. Selects and applies a trained set of filter coefficients based on directionality.
AV1's filter. Applied after deblocking, taking over SAO's role.
AV1's additional restoration stage. Uses Wiener and self-guided filters to correct noise left after CDEF.
In-loop filter tools newly added in AV2. CCSO handles cross-correction between chroma components and GDF handles detail restoration (see Chapter 8).
What is the fundamental difference between an in-loop filter and a simple post-processing filter?