AOMediaCodec / libavif
libavif - Library for encoding and decoding .avif files
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing AOMediaCodec/libavif in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewlibavif This library aims to be a friendly, portable C implementation of the AV1 Image File Format, as described here: It can encode and decode all AV1 supported YUV formats and bit depths (with alpha). In addition to the library, encoder and decoder command line tools are also provided ( and ). It is recommended that you check out/use tagged releases instead of just using the main branch. We will regularly create new versions as bug fixes and features are added. Command line tool usage See for all options. API usage Please see the examples in the "examples" directory. If you're already building , enable the CMake option in order to build and run the examples too. Installation is a package in most major OSs. Windows You can also download the official windows binaries on the release page. macOS Homebrew: MacPorts: Linux Debian-based distributions: Red Hat-based distributions: MinGW For the "default" MSYS2 UCRT64 environment: Build Notes Building libavif requires CMake. See Build Command Lines below for example command lines. Controlling Dependencies CMake flags like , , etc. allow enabling or disabling dependencies. They can take three possible values: • : the dependency is disabled. • : the dependency is expected to be installed on the system. • : the dependency is built locally. In most cases, CMake can automatically download and build it. For some dependencies, you need to run the associated script in the subdirectory yourself. In cases where CMake handles downloading the dependency, you can still call the script in if you want to use a different version of the dependency (e.g. by modifying the script) or make custom code changes to it. If a directory with the dependency exists in the directory, CMake will use it instead of downloading a new copy. Codec Dependencies No AV1 codecs are enabled by default. You should enable at least one of them by setting any of the following CMake options to or , depending on whether you want to use a locally built or a system installed version (e.g. ): • for libaom (encoder and decoder) • for dav1d (decoder) • for libgav1 (decoder) • for rav1e (encoder) • for SVT-AV1 (encoder) When set to , these libraries (in their C API form) must be externally available (discoverable via CMake's ) to use them, or if libavif is a child CMake project, the appropriate CMake target must already exist by the time libavif's CMake scripts are executed. Libyuv Dependency Libyuv is an optional but strongly recommended dependency that speeds up color space conversions. It's enabled by default with a value of , so it's expected to be installed on the system. It can either be built locally instead by using or disabled with . Tests A few tests written in C can be built by enabling the CMake option. The remaining tests require GoogleTest, and can be built by enabling and setting to or . Additionally, fuzzing tests require fuzztest, see also fuzzing test instructions in . Code coverage is available by enabling then building the target, e.g. . It requires compiling with clang ( ) and LLVM must be installed on the system. Build Command Lines The following instructions can be used to build the libavif library and the and tools. Build using installed dependencies To link against the already installed , , and dependency libraries (recommended): Build everything from scratch For development and debugging purposes: Prebuilt Binaries (Windows) Statically-linked and can be downloaded from the Releases page. Development Notes Please check the wiki for extra resources on libavif, such as the Release Checklist. The libavif library is written in C99. Most of the tests are written in C++14. Formatting Use clang-format to format the sources from the top-level folder ( preferred): Use cmake-format to format the CMakeLists.txt files from the top-level folder: --- License Released under the BSD License.