AV1 Deblocking Filter Edge Thresholds Explained

The AV1 video codec employs an in-loop deblocking filter to eliminate blocking artifacts caused by transform and prediction block partitions while preserving true image edges. To prevent the unwanted blurring of genuine picture details, the filter evaluates local pixel gradients across block boundaries against mathematically defined edge sharpness thresholds. These thresholds are derived from a combination of frame-level quantization parameters, signaled filter levels, delta adjustments, and a dedicated sharpness control setting.

Base Filter Level Derivation

The foundation of threshold calculation begins at the frame level. The encoder signals global filter levels for the luma and chroma components, distinguishing between vertical and horizontal block edges. These base levels are closely coupled with the frame’s Quantization Parameter (QP). A higher QP signifies higher quantization error, which generally requires higher filter levels to smooth coarser block boundaries. Conversely, lower QP values yield lower filter levels to keep fine textures intact.

AV1 can refine these base levels locally across the frame using:

Boundary Thresholds: Limit, Blimit, and Thresh

Once the final filter level is calculated for a given block boundary, the decoder computes three primary threshold parameters:

  1. limit: Controls the maximum allowable variation among internal samples on either side of the boundary.
  2. blimit (Block Limit): Regulates the acceptable step difference directly across the boundary edge.
  3. thresh (High Edge Variance): Detects high-frequency variation within samples on one side of the edge to determine whether a narrow (weak) or wide (strong) filter is applied.

The blimit threshold is proportional to the filter level, scaled to evaluate the gradient step between adjacent pixels across the edge. The limit threshold is derived by modifying the filter level according to the frame's global sharpness parameter.

The Role of the Sharpness Parameter

AV1 features a filter_sharpness parameter (ranging from 0 to 7) that shifts the threshold values to favor detail retention over artifact suppression:

Reducing limit restricts the range of pixel gradients that qualify for smoothing. If a local gradient exceeds this reduced limit, the algorithm classifies the transition as an authentic image detail rather than a compression artifact, thereby skipping or dampening the filtering process.

Boundary Condition Testing

During filtering, pixels perpendicular to the edge (designated as \(p\) samples on one side and \(q\) samples on the other, numbered outward from the boundary as \(p_0, p_1, p_2...\) and \(q_0, q_1, q_2...\)) are tested against the calculated thresholds:

Through this multi-tiered process of QP scaling, sharpness shifting, and local sample testing, AV1 dynamically determines sharpness thresholds that maintain a balance between eliminating block seams and retaining authentic texture.