CDEF — Constrained Directional Enhancement Filter — is AV1's directional in-loop cleanup filter, applied during decode to reduce ringing and blurring artefacts near high-contrast edges before the frame is used as a reference for the next one. It's the AV1 equivalent of HEVC's SAO (Sample Adaptive Offset) and VVC's ALF, but uses a fundamentally different approach: instead of statistical smoothing, CDEF detects the dominant direction of edges in each block and filters along that direction, preserving the edge while cleaning the noise alongside it.
Why this matters: aggressive compression of high-contrast edges produces visible "ringing" — faint repeated lines parallel to the edge — and the deblocking filter alone doesn't catch these because they're not at block boundaries. CDEF specifically targets that ringing, especially around text, hard graphic edges, and the line where a bright object meets a dark background. The result is noticeably cleaner-looking edges at the same bitrate, which matters for streaming services delivering animation, screencasts, and graphics-heavy news content.
For a product team, CDEF is invisible technology that shows up in the AV1 quality advantage on certain content types. Sports and natural footage compress similarly in AV1 and HEVC; animation, anime, screencasts and slide-heavy content compress notably better in AV1, and CDEF is a big reason why. Like other in-loop filters, CDEF runs identically in every compliant AV1 decoder — there's nothing to tune from the encoder side except whether to enable it (which you always do). It's just part of what AV1 brings to the table compared to older codecs.
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
CDEF is AV1's answer to ringing around sharp edges, and switching it off is a common shortcut that quietly costs quality at low bitrates. Volume 1 covers CDEF in detail alongside deblocking, SAO and ALF: how AV1's in-loop filters work, what they cost in decode time, and how to judge their effect with quality metrics. Written by Nikolay Sapunov, CEO at Fora Soft.
Tuning AV1 encodes and unsure whether CDEF settings help your content?
Send us sample clips and your encoder settings: we return a filter and preset recommendation for AV1 with metric scores and decode-speed numbers for your target devices. 250+ video products shipped since 2005.