Expand description
use tealdust::{Decoder, Settings, Data, TealdustError};
let mut decoder = Decoder::open(&Settings::default()).unwrap();
// Feed compressed data
let obu_data: Vec<u8> = std::fs::read("input.obu").unwrap();
decoder.send_data(Some(Data::wrap(obu_data))).unwrap();
// Retrieve decoded pictures
loop {
match decoder.get_picture() {
Ok(picture) => { /* process decoded frame */ }
Err(TealdustError::Again) => break, // need more input
Err(TealdustError::Eof) => break, // end of stream
Err(e) => panic!("decode error: {e}"),
}
}Macros§
- itx_
idct_ dequant_ rect_ simd4_ body - itx_
idct_ dequant_ simd4_ body - itx_
kind_ dequant_ rect_ simd4_ body - itx_
kind_ dequant_ rect_ simd4_ mono_ body - itx_
kind_ dequant_ simd4_ body - itx_
kind_ dequant_ simd4_ mono_ body
Structs§
- Alpha
Plane - Decoded alpha (transparency) plane from the auxiliary alpha item.
- Avif
Container - A fully parsed AVIF container, ready for decoding.
- Avif
Decoder - High-level AVIF / AV2 image decoder.
- Avif
Image - A fully decoded AVIF image: metadata + raw plane data.
- Avif
Image Info - Metadata about a decoded AVIF image, available before or alongside pixel data.
- Avif
Item - Describes a single item inside the AVIF
metabox. - Avif
Parser - Stateless AVIF container parser.
- Avif
Settings - High-level AVIF parser/decoder configuration.
- Clean
Aperture - Clean aperture from the
clapitem property (ISO 14496-12 §12.1.4). - Codec
Config - Parsed
av2C(orav1C) codec-configuration record. - Color
Info - Color information extracted from the
colritem property. - Content
Light Level - Data
- A reference-counted byte buffer for compressed bitstream data.
- Decoder
- AV2 bitstream decoder.
- Frame
Header - Picture
- A decoded video frame with pixel data and associated metadata.
- Pixel
Aspect Ratio - Pixel-aspect-ratio from the
paspitem property. - Rational
- A rational number as a (numerator, denominator) pair.
- Sequence
Header - Settings
- Decoder configuration. Use
Settings::default()for sensible defaults. - Spatial
Extents - Image dimensions from the
ispeitem property.
Enums§
- Auxiliary
Type - Identifies the purpose of an auxiliary image item, parsed from the
auxCitem property. - Avif
Error - Errors that can occur when parsing or decoding an AVIF file.
- Color
Primaries - Decode
Frame Type - Which frame types to decode.
- Event
Flags - Inloop
Filter Type - Which in-loop filters to apply during decoding.
- Item
Type - The four-character-code type of
iinfitem. - Matrix
Coefficients - Orientation
- Display orientation, using the eight EXIF orientation values. HEIF expresses
orientation with a rotation property (
irot, anticlockwise multiples of 90°) and a mirror property (imir); the diagonal EXIF values map to a mirror followed by a rotation. - Pixel
Layout - Plane
Storage - Owned storage for one decoded picture plane.
- Tealdust
Error - Transfer
Characteristics
Constants§
- ALPHA_
AUXILIARY_ URN - The standard URN identifying an alpha auxiliary image item.
- DEFAULT_
AVIF_ MAX_ AUXC_ URN_ LEN - Default byte length of an
auxCURN string accepted from the bitstream. - DEFAULT_
AVIF_ MAX_ COMPAT_ BRANDS - Default number of
ftypcompatible brands scanned (prevents O(n) on junk). - DEFAULT_
AVIF_ MAX_ EXTENTS_ PER_ ITEM - Default extents per
ilocitem. - DEFAULT_
AVIF_ MAX_ ILOC_ ITEMS - Default allowed
ilocitem count (v0/v1 = u16, v2 = u32; cap both). - DEFAULT_
AVIF_ MAX_ IMAGE_ DIMENSION - Default image dimension accepted from
ispe. - DEFAULT_
AVIF_ MAX_ IPCO_ PROPS - Default number of property entries accepted from an
ipcobox. - DEFAULT_
AVIF_ MAX_ IPMA_ ENTRIES - Default number of
ipmaentry associations per item. - DEFAULT_
AVIF_ MAX_ IREF_ REFS - Default number of item references consumed from one
ireftype-ref box. - DEFAULT_
AVIF_ MAX_ ITEMS - Default number of items accepted from an
iinfbox. - DEFAULT_
AVIF_ MAX_ OBU_ BYTES - Default total OBU bytes assembled from
ilocextents before feeding the decoder. - DEFAULT_
FRAME_ SIZE_ LIMIT - Default untrusted-data frame-size cap. 4096x2304 keeps normal 4K/2.5MP
fuzz/bench clips inside the default decoder, while avoiding repeated huge
allocations from tiny malformed headers. Set
Settings::frame_size_limit = 0explicitly for trusted streams that may exceed this. - MAX_
FRAME_ DELAY - MAX_
THREADS
Traits§
Functions§
- get_
frame_ delay - probe_
avif - Quick probe: returns
trueifdatabegins with an ISOBMFFftypbox carrying a recognised AVIF brand (avif,avis, orav02). - version
- version_
api