Crate vvdec

Crate vvdec 

Source
Expand description

§Rust bindings for VVdeC

This crate provides Safe Rust bindings for VVdeC.

A simple VVC decoder application can be implemented using the snippet below as a starting point:

use vvdec::{Decoder, Error, Frame, PlaneComponent};

fn main() -> Result<(), Error> {
    // You can also use Decoder::builder() if customizations are needed.
    let mut decoder = Decoder::new()?;

    // Process incoming VVC input bitsteram
    while let Some(data) = get_input_data() {
        decoder.decode(data)?.map(process_frame);
    }

    // Flush at the end
    while let Some(frame) = decoder.flush()? {
        process_frame(frame);
    }

    Ok(())
}

fn get_input_data() -> Option<&'static [u8]> {
    return Some(&[0; 64]); // Replace this with real VVC bitstream data.
}

fn process_frame(frame: Frame) {
    // Use decoded frame
    let y_plane = frame.plane(PlaneComponent::Y).unwrap();
    let y_plane_data: &[u8] = y_plane.as_ref();
    // ...
}

§Vendored build

If VVdeC is not installed in the system, a vendored copy will be built, which requires CMake.

Structs§

AccessUnit
Access unit containing VVC bitstream data.
Decoder
VVC decoder.
DecoderBuilder
Decoder builder
Frame
A decoded frame.
Hrd
HRD parameters.
PictureAttributes
Picture attributes.
Plane
A plane from a Frame.
Vui
VUI parameters.

Enums§

ColorFormat
Color format.
Error
An error that has occurred in VVdeC.
FrameFormat
Frame format.
NalType
NAL type.
PlaneComponent
A plane component
SampleAspectRatio
Sample Aspect Ratio.
SliceType
Slice type.