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

aom-decode

Minimal safe wrapper for libaom AV1 decoder

9 releases

0.2.5 Jan 4, 2023
0.2.4 Sep 3, 2022
0.2.3 Apr 8, 2022
0.2.2 Mar 23, 2022
0.1.1 Nov 21, 2020

#12 in #av1

Download history 64/week @ 2022-11-28 79/week @ 2022-12-05 68/week @ 2022-12-12 65/week @ 2022-12-19 15/week @ 2022-12-26 40/week @ 2023-01-02 123/week @ 2023-01-09 206/week @ 2023-01-16 62/week @ 2023-01-23 61/week @ 2023-01-30 135/week @ 2023-02-06 163/week @ 2023-02-13 200/week @ 2023-02-20 132/week @ 2023-02-27 103/week @ 2023-03-06 102/week @ 2023-03-13

582 downloads per month
Used in 4 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

~19MB
~380K SLoC