dav2d: Bridging the Gap for the AV2 Video Codec

The release of a new video codec specification is a milestone, but as Jean-Baptiste Kempf of VideoLAN puts it, "A codec does not really exist until everyone can decode it." While the Alliance for Open Media (AOM) has officially released the AV2 specification, the transition from a theoretical standard to a practical tool requires a production-ready decoder.

Entering this space is dav2d, a fast, portable, and open-source decoder developed by the VideoLAN community. Designed as the successor to the highly successful dav1d (the AV1 decoder), dav2d aims to provide the necessary software infrastructure to make AV2 viable on existing hardware long before dedicated hardware decoders become ubiquitous.

The Challenge of AV2

AV2 is the latest royalty-free successor to AV1, introducing advanced coding tools across prediction, transforms, entropy coding, and chroma processing. The primary goal is increased compression efficiency, with reported gains of approximately 25% over AV1 in many test conditions.

However, this efficiency comes at a significant computational cost. AV2 decoding is roughly five times more complex than AV1 decoding. This leap in complexity means that software running on current-generation hardware will struggle to decode AV2 in real time without aggressive, architecture-specific optimizations. This performance gap is the primary driver behind the early development of dav2d; waiting for the specification to fully stabilize before starting the decoder would have left a critical gap in the ecosystem's ability to deploy the codec.

Lessons from dav1d

The strategy for dav2d is heavily informed by the history of dav1d. When AV1 was first finalized, there was a debate within the AOM community regarding whether hardware implementations and the reference decoder would be sufficient. VideoLAN argued that browsers, media players, and mobile devices would need a production-quality software decoder immediately to avoid stalling adoption.

History proved them correct. dav1d became the most widely deployed AV1 software decoder, integrated into VLC, FFmpeg, Chrome, Firefox, Safari, Android, and Windows. By starting dav2d early, VideoLAN is applying the same logic to AV2: providing a tool that developers can use to build, benchmark, and integrate the codec into their applications immediately.

Technical Implementation and Current Status

Rather than starting from scratch, dav2d leverages the architectural foundations of dav1d. Much of the experience regarding threading, SIMD organization, and API design has been transferred directly to the new project.

Currently, dav2d features a functional AVM v15 decoder supporting both 8-bit and 10-bit decoding. Key components already implemented include:

  • Bitstream parsing and header handling
  • Entropy decoding and CDF handling
  • Intra and inter prediction
  • Transforms and Wiener filtering
  • Deblocking, CDEF, and film grain synthesis

Performance Optimization

To combat the five-fold increase in complexity, the team is focusing on architecture-specific assembly code:

  • x86: Implementation of AVX2 code for inverse transforms, CCTX, and deblocking.
  • ARM: AArch64 NEON optimizations for entropy decoding, SAD, and motion-related functions.
  • RISC-V: Early work to adapt existing intra prediction and motion compensation assembly.

One of the most significant advantages dav2d has over the early days of dav1d is the use of checkasm. This framework allows the team to validate and benchmark optimized assembly implementations against their C equivalents in real time, making the optimization process faster and safer.

Community Perspectives and Critical Questions

The announcement of dav2d has sparked a technical debate among developers and enthusiasts regarding the trade-offs of increasing codec complexity.

The "Complexity vs. Gain" Trade-off

Some observers have questioned whether a 25% reduction in file size is worth the cost of obsoleting older hardware. As one commenter noted, if AV1 software decoding was already intensive, the five-fold increase in AV2 complexity could be "mortifying" for performance benchmarks on older devices.

The Future of Human-Engineered Codecs

There is also a broader discussion about whether traditional human-engineered codecs are hitting a ceiling. Some suggest that if decoding is becoming too expensive for hardware to handle, the industry might eventually move toward "full neural" decoding—sending latents and running the decode process on tensor cores—though this remains a distant prospect for the majority of current hardware.

Patent and Licensing Concerns

Despite the royalty-free goals of AOM, some users have raised concerns about the patent-pool issues that plagued AV1, questioning how AV2 will avoid similar legal challenges from entities like Sisvel or Dolby/Snap.

Conclusion

By releasing dav2d under a BSD-style license and developing it in the open, VideoLAN is ensuring that the AV2 ecosystem has a transparent, interoperable foundation. While the road to full optimization is long, the existence of a high-performance software decoder is the only way to ensure that a royalty-free codec can actually be deployed across the diverse landscape of modern computing devices.

Sources