#av1-decoder #libaom #av1 #unavif #cest-lavif

aom-decode

Minimal safe wrapper for libaom AV1 decoder

11 releases

0.2.13 Oct 17, 2024
0.2.10 Jul 7, 2024
0.2.7 Nov 20, 2023
0.2.6 Jun 15, 2023
0.1.1 Nov 21, 2020

#1575 in Images

Download history 214/week @ 2025-12-16 403/week @ 2025-12-23 609/week @ 2025-12-30 8806/week @ 2026-01-06 1187/week @ 2026-01-13 663/week @ 2026-01-20 803/week @ 2026-01-27 484/week @ 2026-02-03 529/week @ 2026-02-10 430/week @ 2026-02-17 455/week @ 2026-02-24 628/week @ 2026-03-03 747/week @ 2026-03-10 370/week @ 2026-03-17 362/week @ 2026-03-24 342/week @ 2026-03-31

1,869 downloads per month
Used in 11 crates (4 directly)

BSD-2-Clause

37KB
786 lines

Rust wrapper for AOMedia AV1 decoder

It's a minimal safe wrapper that allows decoding individual AV1 frames. It's meant for decoding AVIF images.

Usage

See examples/topng.rs for the full code.

You'll need the avif-parse crate to get AV1 data out of an AVIF file, and the yuv crate to convert YUV pixels into RGB.

let avif = avif_parse::read_avif(file)?;

let mut d = Decoder::new(&Config {
    threads: std::thread::available_parallelism().map(|v| v.get()).unwrap_or(4),
})?;

let img = d.decode_frame(&avif.primary_item)?;
match img.rows_iter()? {
    RowsIters::YuvPlanes8 {y,u,v,chroma_sampling} => {
        match chroma_sampling {
            color::ChromaSampling::Cs444 => {
                yuv_444(y, u, v).map(|px| {
                    // here's your YUV pixel
                });
            },
        }
    },
}

Dependencies

~25MB
~495K SLoC