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§
- Access
Unit - Access unit containing VVC bitstream data.
- Decoder
- VVC decoder.
- Decoder
Builder - Decoder builder
- Frame
- A decoded frame.
- Hrd
- HRD parameters.
- Picture
Attributes - Picture attributes.
- Plane
- A plane from a Frame.
- Vui
- VUI parameters.
Enums§
- Color
Format - Color format.
- Error
- An error that has occurred in VVdeC.
- Frame
Format - Frame format.
- NalType
- NAL type.
- Plane
Component - A plane component
- Sample
Aspect Ratio - Sample Aspect Ratio.
- Slice
Type - Slice type.