SAO — Sample Adaptive Offset — is HEVC's second in-loop filter, running after the deblocking filter to clean up two specific kinds of compression artefacts that deblocking doesn't catch. Where deblocking smooths block boundaries, SAO adjusts individual pixel values inside blocks to nudge them closer to what the original frame looked like. It does this in two complementary modes that the encoder picks per region.
Edge Offset (EO) targets ringing artefacts near sharp edges — those faint repeated lines parallel to a high-contrast boundary that aggressive quantization produces. The encoder identifies the edge direction (horizontal, vertical, or one of the two diagonals) and applies small corrections along that direction. Band Offset (BO) targets banding in smooth gradients — the visible "steps" of colour on a sunset sky. The encoder splits the brightness range into 32 bands and applies a small offset to four consecutive bands, smoothing the gradient without affecting the rest of the image. Both modes send their corrections as part of the bitstream so every decoder applies the same fix.
For a product team, SAO is invisible plumbing that contributes to HEVC's quality advantage over H.264 at the same bitrate. There's nothing to tune; the encoder turns it on by default. The successor codecs evolved the idea further: AV1 replaced SAO with cdef (Constrained Directional Enhancement Filter), and VVC kept SAO while adding alf (Adaptive Loop Filter) on top. The general lesson: each generation adds more sophisticated cleanup filters, each filter targets a specific kind of compression damage, and the cumulative effect is what lets newer codecs produce visibly cleaner-looking video at every bitrate.
The book · Volume 1 of 7
Video Encoding: A Complete Guide to Video Compression — From Pixels and Color to H.264, HEVC, AV1, Quality Metrics, and AI
SAO cleans up ringing and banding that quantization leaves behind in HEVC, and turning it off costs visible quality. Volume 1 covers SAO in detail with the other in-loop filters: deblocking, SAO band and edge offsets, ALF in VVC, CDEF in AV1, and their effect on quality and encode speed. Written by Nikolay Sapunov, CEO at Fora Soft.
Seeing ringing or banding in HEVC encodes and wondering whether SAO is set right?
Send us problem clips and your x265 settings: we tune deblocking and SAO options and show the quality difference at the same bitrate. 250+ video products shipped since 2005.