AV1 vs HEVC: Logarithmic Contouring Artifacts
This article compares how AV1 and HEVC (H.265) manage logarithmic contouring artifacts, commonly recognized as color banding along smooth gradients and low-contrast logarithmic curves. By examining the underlying compression architectures, in-loop filtering pipelines, and perceptual mitigation techniques of each codec, this guide explains why these artifacts occur and which format handles gradient integrity more effectively at matching bitrates.
Understanding Logarithmic Contouring
Logarithmic contouring occurs when continuous luminance or chrominance gradients are quantized into distinct, visible bands or "steps." This artifact is particularly prevalent in scenes encoded with logarithmic transfer functions (such as camera log profiles or HDR transfer characteristics) and flat, dimly lit regions like skies or shadows. Because human visual perception is roughly logarithmic, subtle shifts in low-luminance zones become starkly noticeable when a codec truncates precision to meet bitrate constraints.
HEVC Artifact Profile and Mitigation
HEVC combats contouring primarily through its Deblocking Filter and Sample Adaptive Offset (SAO).
- Sample Adaptive Offset (SAO): SAO applies offsets to reconstructed pixels categorized into edge offsets or band offsets. Band offset specifically targets flat areas by splitting sample values into bands and adding a correction offset to smooth out uniform regions.
- Transform Limitations: HEVC supports transform units up to 32x32. At lower bitrates, coarse quantization across these large blocks results in rigid, block-aligned stepped bands across logarithmic ramps.
- Over-smoothing vs. Banding: While HEVC Main10 (10-bit) substantially reduces banding compared to 8-bit profiles, HEVC at constrained bitrates often faces a trade-off: SAO either aggressively smooths the image, destroying fine texture, or fails to bridge large quantization deltas, leaving distinct contour boundaries visible.
AV1 Artifact Profile and Mitigation
AV1 employs a more sophisticated in-loop filtering and restoration architecture designed specifically to tackle false edges and contouring.
- Constrained Directional Enhancement Filter (CDEF): Operating after the deblocking filter, CDEF identifies gradient directions and applies non-linear filtering along identified edges while suppressing ringing and step artifacts across flat regions without excessive blur.
- Loop Restoration: AV1 introduces Wiener filtering and Self-Guided Restoration. The self-guided filter uses edge-preserving algorithms to restore smooth gradients closer to the uncompressed source, significantly attenuating step-like quantization errors.
- Film Grain Synthesis (FGS): AV1 includes a native film grain synthesis tool. Instead of spending bits encoding fine noise to hide contouring, the encoder strips natural grain and re-synthesizes it deterministically on the decoder side. This subtle dither naturally disrupts logarithmic contouring boundaries, tricking the human visual system into perceiving a smooth, continuous gradient.
Comparative Summary
When evaluating the logarithmic contouring profile between both standards:
- Low-to-Medium Bitrates: AV1 outperforms HEVC. HEVC produces visible stair-stepping artifacts aligned with its coding tree unit (CTU) boundaries, whereas AV1 diffuses and smooths these steps using its multi-stage loop restoration.
- Grain and Dithering: HEVC requires sufficient bitrate to retain natural dither or grain to mask contouring; otherwise, its in-loop filters strip the noise, exacerbating banding. AV1 avoids this penalty via hardware-accelerated film grain synthesis.
- 10-bit Implementation: Both codecs handle gradients significantly better in 10-bit than 8-bit. However, under identical 10-bit rate-constrained scenarios, AV1 maintains higher perceptual uniformity across logarithmic color curves with noticeably fewer contour artifacts than HEVC.