There are totally three in-loop filters in VVC. Besides deblocking filter and SAO (the two loop filters in HEVC), adaptive loop filter (ALF) are applied. The ALF comprises of luma ALF, chroma ALF and cross-component ALF (CC-ALF). The ALF filtering process is designed so that luma ALF, chroma ALF and CC-ALF can be executed in parallel. The order of the filtering process in the VVC is the deblocking filter, SAO and ALF. The SAO in VVC is the same as that in HEVC.
In VVC, a new process called the luma mapping with chroma scaling was added (this process was previously known as the adaptive in-loop reshaper). The LMCS modifies the sample values before encoding and after reconstruction by redistributing the codewords across the entire dynamic range. This new process is performed before deblocking.
In VVC, an Adaptive Loop Filter (ALF) with block-based filter adaption is applied. For the luma component, one among 25 filters is selected for each 4×4 block, based on the direction and activity of local gradients.
Two diamond filter shapes (as shown in Figure 48) are used. The 7×7 diamond shape is applied for luma component and the 5×5 diamond shape is applied for chroma components.
For luma component, each block is categorized into one out of 25 classes. The classification index C is derived based on its directionality and a quantized value of activity , as follows:
(3-0)
To calculate and , gradients of the horizontal, vertical and two diagonal direction are first calculated using 1-D Laplacian:
(3-0)
(3-0)
(3-0)
(3-0)
Where indices and refer to the coordinates of the upper left sample within the block and indicates a reconstructed sample at coordinate .
To reduce the complexity of block classification, the subsampled 1-D Laplacian calculation is applied. As shown in Figure 49, the same subsampled positions are used for gradient calculation of all directions.
Figure 49 – Subsampled Laplacian calculation Then maximum and minimum values of the gradients of horizontal and vertical directions are set as:
, (3-0)
The maximum and minimum values of the gradient of two diagonal directions are set as:
, (3-0)
To derive the value of the directionality , these values are compared against each other and with two thresholds and :