Skip to main content

Vp8EncoderConfig

Struct Vp8EncoderConfig 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§qindex: u8

Base y_ac_qi quantiser index (§9.6, 0..=127).

§lf_level: u8

Loop-filter level (0..=63).

§lf_mode: LoopFilterMode

Loop-filter routing mode.

§golden_interval: u32

Golden-frame refresh interval in frames.

§alt_ref_interval: u32

Alt-ref refresh interval in frames.

§lookahead_window: u32

Lookahead window in frames (first-pass / scene-cut buffer).

§target_bitrate_bps: u32

One-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: bool

When 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: EncodeEffort

Mode-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: usize

Thread budget for each frame’s macroblock-row wavefront, key and inter frames alike (0 / 1 = serial, the default). Never changes the bytes.

§inter_effort: EncodeEffort

Mode-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: f64

Frames 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

Source

pub fn with_effort(self, v: EncodeEffort) -> Self

Set effort.

Source

pub fn with_threads(self, v: usize) -> Self

Set threads.

Source

pub fn with_inter_effort(self, v: EncodeEffort) -> Self

Set inter_effort.

Source

pub fn with_partitions(self, v: u8) -> Self

Set partitions.

Source

pub fn with_frame_rate(self, v: f64) -> Self

Set frame_rate.

Source

pub fn with_qindex(self, v: u8) -> Self

Set qindex.

Source

pub fn with_lf_level(self, v: u8) -> Self

Set lf_level.

Source

pub fn with_lf_mode(self, v: LoopFilterMode) -> Self

Set lf_mode.

Source

pub fn with_golden_interval(self, v: u32) -> Self

Set golden_interval.

Source

pub fn with_alt_ref_interval(self, v: u32) -> Self

Set alt_ref_interval.

Source

pub fn with_lookahead_window(self, v: u32) -> Self

Set lookahead_window.

Source

pub fn with_target_bitrate_bps(self, v: u32) -> Self

Set target_bitrate_bps.

Source

pub fn with_auto_loop_filter(self, v: bool) -> Self

Set auto_loop_filter.

Source

pub fn with_trellis_strength(self, v: TrellisStrength) -> Self

Set trellis_strength.

Trait Implementations§

Source§

impl Clone for Vp8EncoderConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Vp8EncoderConfig

Source§

impl Debug for Vp8EncoderConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Vp8EncoderConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Vp8EncoderConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Vp8EncoderConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.