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

aom-decode

Minimal safe wrapper for libaom AV1 decoder

4 releases

0.2.0 May 30, 2021
0.1.2 May 9, 2021
0.1.1 Nov 21, 2020
0.1.0 Sep 9, 2020

#7 in #av1

Download history 17/week @ 2021-04-03 32/week @ 2021-04-10 20/week @ 2021-04-17 8/week @ 2021-04-24 43/week @ 2021-05-01 38/week @ 2021-05-08 49/week @ 2021-05-15 23/week @ 2021-05-22 61/week @ 2021-05-29 28/week @ 2021-06-05 21/week @ 2021-06-12 36/week @ 2021-06-19 16/week @ 2021-06-26 71/week @ 2021-07-03 12/week @ 2021-07-10 44/week @ 2021-07-17

87 downloads per month
Used in 3 crates (2 directly)

BSD-2-Clause

30KB
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

~17MB
~352K SLoC