#[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 strictness: Strictness,
pub cpu_level: CpuLevel,
}Expand description
Decoder configuration settings
Construct with Settings::default(), then assign the fields to customize.
This type is non-exhaustive; downstream callers cannot use struct literals.
use rav1d_safe::{Settings, Strictness};
let mut settings = Settings::default();
settings.threads = 4;
settings.strictness = Strictness::Lenient;
assert_eq!(settings.strictness, Strictness::Lenient);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 the worker count1= single-threaded (default, simpler synchronous behavior)2+= multiple workers, including tile parallelism within a frame
With multiple workers, decode() may return None
even when complete frame data is provided, as frames are processed asynchronously.
Poll get_frame() between chunks, and call
flush() once at end of input — it drains every frame still
owed (in flight or queued in the last chunk) before it resets.
Tile threading works in the default checked build. Decoding multiple
frames in flight also requires the unchecked feature; without it,
frame delay is capped at one while the requested worker count is retained.
For stills, additional workers help mainly when the image has multiple
tiles. Set max_frame_delay to one for explicit
single-frame latency measurements.
apply_grain: boolApply film grain synthesis during decoding
frame_size_limit: u32Maximum frame size in total pixels, i.e. width * height (0 = unlimited)
Default: 120,000,000 (120 MP — admits 108 MP phone photos). 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: booluse strictness
Enforce strict standard compliance.
Deprecated alias for strictness: true behaves as
Strictness::Strict. When both are set, the stricter one applies. Kept
so Settings { strict_std_compliance: true, ..Default::default() } keeps
compiling; it will be removed in a later 0.x release.
strictness: StrictnessHow the decoder treats a stream that violates the AV1 specification.
Default: Strictness::Strict — corrupt or non-conforming tile data is an
Error::InvalidData instead of garbage pixels. Set
Strictness::Lenient for dav1d’s conceal-and-continue behaviour.
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.