#[non_exhaustive]pub struct Vp8EncoderConfig {Show 14 fields
pub qindex: u8,
pub lf_level: u8,
pub lf_mode: LoopFilterMode,
pub golden_interval: u32,
pub alt_ref_interval: u32,
pub lookahead_window: u32,
pub target_bitrate_bps: u32,
pub auto_loop_filter: bool,
pub trellis_strength: TrellisStrength,
pub effort: EncodeEffort,
pub threads: usize,
pub inter_effort: EncodeEffort,
pub partitions: u8,
pub frame_rate: f64,
}Expand description
Encoder configuration knobs — the 0.1.13 public struct.
Each field has a documented default constant (e.g.
DEFAULT_QINDEX, DEFAULT_GOLDEN_INTERVAL) so callers can
override only the knobs they care about. The current encoder honours
qindex and lf_level directly; the higher-level knobs (lookahead,
scene-cut detection, segment-aware QP) are persisted on the struct
for forward-compat but not yet exercised by the encode body.
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.qindex: u8Base y_ac_qi quantiser index (§9.6, 0..=127).
lf_level: u8Loop-filter level (0..=63).
lf_mode: LoopFilterModeLoop-filter routing mode.
golden_interval: u32Golden-frame refresh interval in frames.
alt_ref_interval: u32Alt-ref refresh interval in frames.
lookahead_window: u32Lookahead window in frames (first-pass / scene-cut buffer).
target_bitrate_bps: u32One-pass rate control target of the lagged stream paths in bits
per second, or 0 (the default) for a constant quantiser: the
stream starts at qindex and then adapts the quantiser frame by
frame (see AltrefStreamConfig::target_bitrate_bps).
auto_loop_filter: boolWhen true, the §9.4 loop_filter_level / sharpness_level are
chosen per frame by the RD selector
([select_filter_params]) rather than taken from
lf_level: the encoder picks the pair minimising
post-§15 reconstruction SSD against the source. Defaults to false
(the historical fixed-lf_level behaviour). RFC 6386 is silent on
the choice, so this is a clean-room encoder-quality knob.
trellis_strength: TrellisStrength§13 trellis coefficient-RDO aggressiveness — the clean-room
quality/size dial threaded onto both the keyframe and inter residual
emit (see KeyframeParams::trellis_strength).
TrellisStrength::DEFAULT reproduces the calibrated trade; higher
trades PSNR for smaller output, TrellisStrength::OFF reverts to
plain round-quantisation.
effort: EncodeEffortMode-search effort of the key frames this configuration encodes
(see EncodeEffort); inter frames follow
inter_effort. Default
EncodeEffort::Thorough — the historical key-frame bytes.
threads: usizeThread budget for each frame’s macroblock-row wavefront, key and
inter frames alike (0 / 1 = serial, the default). Never
changes the bytes.
inter_effort: EncodeEffortMode-search effort of the stream’s inter frames (the lagged
stream paths: Vp8Encoder::encode_sequence and
make_encoder_with_config). Defaults to
EncodeEffort::Balanced.
partitions: u8§9.5 token partition count (1 / 2 / 4 / 8) of every frame of the lagged stream paths; any other value is treated as 1. More partitions let a decoder parse tokens on several threads.
frame_rate: f64Frames per second target_bitrate_bps
is spread over on Vp8Encoder::encode_sequence (default 30).
The registry encoder uses the stream’s own frame rate when the
codec parameters carry one.
Implementations§
Source§impl Vp8EncoderConfig
impl Vp8EncoderConfig
Sourcepub fn with_effort(self, v: EncodeEffort) -> Self
pub fn with_effort(self, v: EncodeEffort) -> Self
Set effort.
Sourcepub fn with_threads(self, v: usize) -> Self
pub fn with_threads(self, v: usize) -> Self
Set threads.
Sourcepub fn with_inter_effort(self, v: EncodeEffort) -> Self
pub fn with_inter_effort(self, v: EncodeEffort) -> Self
Set inter_effort.
Sourcepub fn with_partitions(self, v: u8) -> Self
pub fn with_partitions(self, v: u8) -> Self
Set partitions.
Sourcepub fn with_frame_rate(self, v: f64) -> Self
pub fn with_frame_rate(self, v: f64) -> Self
Set frame_rate.
Sourcepub fn with_qindex(self, v: u8) -> Self
pub fn with_qindex(self, v: u8) -> Self
Set qindex.
Sourcepub fn with_lf_level(self, v: u8) -> Self
pub fn with_lf_level(self, v: u8) -> Self
Set lf_level.
Sourcepub fn with_lf_mode(self, v: LoopFilterMode) -> Self
pub fn with_lf_mode(self, v: LoopFilterMode) -> Self
Set lf_mode.
Sourcepub fn with_golden_interval(self, v: u32) -> Self
pub fn with_golden_interval(self, v: u32) -> Self
Set golden_interval.
Sourcepub fn with_alt_ref_interval(self, v: u32) -> Self
pub fn with_alt_ref_interval(self, v: u32) -> Self
Set alt_ref_interval.
Sourcepub fn with_lookahead_window(self, v: u32) -> Self
pub fn with_lookahead_window(self, v: u32) -> Self
Set lookahead_window.
Sourcepub fn with_target_bitrate_bps(self, v: u32) -> Self
pub fn with_target_bitrate_bps(self, v: u32) -> Self
Set target_bitrate_bps.
Sourcepub fn with_auto_loop_filter(self, v: bool) -> Self
pub fn with_auto_loop_filter(self, v: bool) -> Self
Set auto_loop_filter.
Sourcepub fn with_trellis_strength(self, v: TrellisStrength) -> Self
pub fn with_trellis_strength(self, v: TrellisStrength) -> Self
Set trellis_strength.