AV1 Software Decoders Supported by libavif

This article provides a direct overview of the AV1 software decoders that can be used as decoding backends within the libavif library. It details the three primary supported decoders—dav1d, libaom, and libgav1—explaining their unique characteristics, performance profiles, and how they integrate with libavif to enable AVIF image decoding.

The libavif library does not decode AV1 bitstreams itself; instead, it relies on external AV1 codecs. For decoding AVIF images, libavif can be compiled with one or more of the following software decoder backends:

1. dav1d

Developed by the VideoLAN and VLC communities, dav1d is widely considered the best-performing software AV1 decoder. It is highly optimized, featuring extensive assembly code for x86, ARM, and other architectures. * Role in libavif: It is the recommended and most commonly used default decoding backend. * Key Advantage: Exceptional speed and low resource consumption, making it ideal for web browsers and image viewers where fast rendering is critical. * Compilation Flag: Enabled using the AVIF_CODEC_DAV1D CMake option.

2. libaom

libaom is the official reference library developed by the Alliance for Open Media (AOMedia). It serves as both an encoder and a decoder. * Role in libavif: It is often used as a fallback or in environments where a single library is preferred for both encoding and decoding duties. * Key Advantage: As the reference implementation, it is guaranteed to support all features of the AV1 specification. However, its decoding performance is significantly slower than dav1d. * Compilation Flag: Enabled using the AVIF_CODEC_AOM CMake option.

3. libgav1

Developed by Google, libgav1 is a clean, lightweight AV1 decoder designed specifically for efficiency. * Role in libavif: It is primarily utilized in mobile and embedded systems, such as the Android ecosystem, where memory footprint and binary size are tightly constrained. * Key Advantage: Highly optimized for ARM platforms, offering a balanced compromise between binary size and decoding speed. * Compilation Flag: Enabled using the AVIF_CODEC_GAV1 CMake option.

Backend Selection

When multiple decoders are compiled into libavif, the library employs a priority system to choose the best available decoder at runtime, typically prioritizing dav1d for its superior performance, followed by libgav1, and using libaom as a baseline backup.