#[non_exhaustive]pub struct Settings {
pub threads: u32,
pub apply_grain: bool,
pub frame_size_limit: u32,
pub all_layers: bool,
pub operating_point: u8,
pub output_invisible_frames: bool,
pub inloop_filters: InloopFilters,
pub decode_frame_type: DecodeFrameType,
pub max_frame_delay: u32,
pub strict_std_compliance: bool,
pub cpu_level: CpuLevel,
}Expand description
Decoder configuration settings
Use Settings::default() or struct update syntax (Settings { threads: 4, ..Default::default() })
to construct. New fields may be added in minor releases.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.threads: u32Number of threads for decoding
0= auto-detect (enables frame threading for better performance but asynchronous behavior)1= single-threaded (default, simpler synchronous behavior)2+= multi-threaded with frame threading
With frame threading enabled (threads >= 2 or threads == 0), decode() may return None
even when complete frame data is provided, as frames are processed asynchronously.
Call decode() or flush() multiple times to drain buffered frames.
Note: Multithreading requires the unchecked feature. Without it,
the decoder silently falls back to single-threaded to prevent runtime
panics from DisjointMut overlap detection on stride gap bytes.
apply_grain: boolApply film grain synthesis during decoding
frame_size_limit: u32Maximum frame size in total pixels, i.e. width * height (0 = unlimited)
Default: 35,389,440 (8K UHD: 8192 × 4320). Set to 0 to disable the limit.
Frames exceeding this limit are rejected during OBU parsing with Err(InvalidData).
all_layers: boolDecode all layers or just the selected operating point
operating_point: u8Operating point to decode (0-31)
output_invisible_frames: boolOutput invisible frames (frames not meant for display)
inloop_filters: InloopFiltersInloop filters to apply during decoding
decode_frame_type: DecodeFrameTypeWhich frame types to decode
max_frame_delay: u32Maximum number of frames in flight for frame threading.
0= auto (default, derived from thread count:min(sqrt(threads), 8))1= no frame threading (tile parallelism only — ideal for still images)2+= up to N frames decoded in parallel
For still image formats (AVIF, HEIC), set this to 1 to get tile-level
parallelism without frame threading overhead or async decode behavior.
strict_std_compliance: boolEnforce strict standard compliance
cpu_level: CpuLevelCPU feature level for SIMD dispatch.
Controls which instruction sets the decoder is allowed to use.
Default is CpuLevel::Native (use all detected features).
Set to a lower level to force the decoder through a specific code path,
e.g. CpuLevel::Scalar to test the pure-Rust fallback.