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

aom-decode

Minimal safe wrapper for libaom AV1 decoder

6 releases

0.2.7 Nov 20, 2023
0.2.6 Jun 15, 2023
0.2.5 Jan 4, 2023
0.2.4 Sep 3, 2022
0.1.1 Nov 21, 2020

#852 in Images

Download history 37/week @ 2024-01-01 73/week @ 2024-01-08 79/week @ 2024-01-15 67/week @ 2024-01-22 45/week @ 2024-01-29 65/week @ 2024-02-05 35/week @ 2024-02-12 191/week @ 2024-02-19 165/week @ 2024-02-26 111/week @ 2024-03-04 75/week @ 2024-03-11 57/week @ 2024-03-18 108/week @ 2024-03-25 149/week @ 2024-04-01 51/week @ 2024-04-08 117/week @ 2024-04-15

431 downloads per month
Used in 8 crates (4 directly)

BSD-2-Clause

32KB
669 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: num_cpus::get(),
})?;

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

~20MB
~397K SLoC