AV2 video for everyone: Dav2d decoder will play it even on older PCs

The problem with new video formats is their performance requirements as that they generally assume playback via dedicated hardware. The catch is that it often takes years before such decoders appear in GPUs and processors, leaving all devices purchased before then without support. Fortunately, the new AV2 format should remain accessible even on older devices thanks to the work of open-source developers behind the VLC media player.

The AV2 format itself is apparently still not fully finalized, despite last year’s announcement that completion was expected by year’s end. However, it seems only smaller details remain unresolved, as work has already begun on an optimized high-performance decoder for the format that should enable AV2 video playback on as many processors as possible that lack a hardware AV2 decode block.

This project is called Dav2d and builds on the Dav1d decoder, which was created with the same objective for the AV1 format. Dav1d was highly optimized through SIMD code hand-written in assembly, achieving extremely high performance and allowing AV1 playback even on relatively old CPUs.

Dav2d has the same goal—to be the fastest possible solution for AV2 playback and to bridge the years during which hardware decoders will be unavailable or uncommon in PCs. At the same time, the decoder is intended to be optimized for high performance on both the newest and older processors. Developers will initially focus on performance for current x86 processors supporting AVX2—such as all Ryzen CPUs and Intel Core 4th-generation and newer (in this sense, targeting AVX means usage of these instructions as well as older instruction sets supported on the relevant CPUs)—and newer Arm processors based on ARMv8 (or ARMv9), meaning smartphones are Dav2d’s target as well.

Once that is done, work will move on to code paths optimized for older processors—targeting cores that support SSSE3, which means Intel Core 2 and newer processors up through Sandy Bridge and Ivy Bridge (as well as various SoCs based on Atom-line cores through the Tremont architecture). On AMD’s side, this includes Bulldozer, Piledriver, Steamroller, Jaguar, and technically even Bobcat cores.

With lower priority, Dav2d also plans to explore optimizations for 32-bit ARM cores (ARMv7) and eventually, if resources permit, IBM Power/PowerPC, RISC-V, and very old x86 processors lacking SSSE3 support—which in practice mainly means various AMD Phenom and Athlon II chips based on the K10 architecture. Their architecture tops out at SSE3 but lacks SSSE3, or “Supplemental SSE3,” which was introduced in Core 2 processors and (unfortunately fo K10) includes several instructions highly important for multimedia SIMD code, such as PSHUFB.

These now rarely used, obsolete, or exotic processors are among the lowest priority items on the roadmap. Ironically, AVX-512 optimizations are also similarly low on the to do list. That is likely due to a combination of AVX-512’s limited historical market penetration and the assumption that any processors supporting AVX-512 will probably have enough excess performance even when relying just on AVX2.

How demanding AV2 playback will be still remains unknown

For such old processors with fewer cores, however, insufficient raw performance could still become a problem. In addition to hand-optimized SIMD code, Dav2d will also rely heavily on using multithreaded decoding. Older CPU architectures may therefore only remain viable for AV2 decoding if the processor also has a sufficiently high core count.

There are currently no concrete estimates for how powerful processors you’ll generally need for AV2 decoding of specific resolutions and frame rates—we will only see that in the future. However, it is assumed that most newer AVX2-capable processors with four or more cores should handle 1080p video without issue, and hopefully even 4K resolution will remain relatively accessible. It should be noted, however, that playing the video inside web browsers will be significantly more demanding than simply playing back downloaded video in applications such as VLC or MPV.

Plán vývoje AV2 dekodéru Dav2d
Dav2d AV2 decoder development roadmap (source: VideoLAN)

According to currently limited information on the project website, developers are still working on full implementation of all decoder functions required for complete AV2 specification coverage, as well as API development and porting to various platforms (which likely involves handling both operating system compatibility and support for various non x86/ARM processor instruction sets). The decoder is not yet deployment-ready, but neither is the AV2 format itself—in both cases, this is work on technology that will become useful for mainstream users only some time in the future.

The code will be written in C, which may be somewhat unfortunate (Rust would offer greater safety, a potential advantage especially for web browsers), but C is likely the easier solution in terms of integrating optimized SIMD code and also allows reuse of portions of the Dav1d project’s codebase. Dependence on Rust compiler and tooling availability would also likely conflict with the goal of maximizing cross-platform compatibility.

SIMD optimizations themselves will begin once this phase is completed. Performance work on Dav2d will initially prioritize newer processors and standard bit-depth video decoding. Higher bit depths (10-bit, 12-bit) and 4:2:2 and/or 4:4:4 sampling will have lower priority, though they are also planned. Over time, the decoder may even potentially gain some form of GPU acceleration for certain operations, but this too sits fairly low on the priorities list—CPU performance will remain the primary focus.

Open-source

Dav2d is open source (with a permissive license rather than GPL or similar) as per tradition and, like Dav1d, is overseen by the VideoLAN project, known for the popular VLC Media Player (originally VideoLAN Client). VLC should therefore eventually integrate Dav2d automatically, though integration with FFmpeg and other video players can also be expected.

Whether Dav2d will make its way into web browsers—and how long that may take—remains an open question. Google, for example, previously preferred its own reference code in Chrome despite worse performance and did not deploy the FFVP9 decoder, significantly harming VP9 playback capability. Dav1d, however, does appear to have eventually made its way into Chrome, so Dav2d may follow the same path. Firefox already uses Dav1d for AV1 playback, so it should also be receptive to Dav2d integration.

Source: VideoLAN

English translation and edit by Jozef Dudáš


Contents

Leave a Reply

Your email address will not be published. Required fields are marked *