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

aom-decode

Minimal safe wrapper for libaom AV1 decoder

2 releases

0.1.1 Nov 21, 2020
0.1.0 Sep 9, 2020

#9 in #av1

Download history 10/week @ 2020-09-05 3/week @ 2020-09-12 1/week @ 2020-09-19 2/week @ 2020-09-26 39/week @ 2020-10-03 9/week @ 2020-10-10 30/week @ 2020-10-17 24/week @ 2020-10-24 61/week @ 2020-10-31 38/week @ 2020-11-07 12/week @ 2020-11-14 17/week @ 2020-11-21

77 downloads per month

BSD-2-Clause

20KB
387 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

~16MB
~326K SLoC