Skip to main content

SilkFrameConfig

Struct SilkFrameConfig 

Source
pub struct SilkFrameConfig {
    pub bandwidth: Bandwidth,
    pub frame_size: SilkFrameSize,
    pub voice_active: bool,
    pub first_subframe_independent: bool,
    pub previous_log_gain: Option<u8>,
    pub previous_primary_lag: Option<i32>,
    pub ltp_scaling_present: bool,
    pub lsf_interp_after_reset: bool,
    pub previous_nlsf_q15: Option<[i16; 16]>,
    pub previous_nlsf_len: usize,
    pub stereo: Option<StereoHeaderContext>,
}
Expand description

Configuration for one regular SILK frame decode, supplying the per-frame conditions that the §4.2 packet organisation determines outside the SILK frame itself (the §4.2.4 VAD flag, the §4.2.7.4 independent-gain enumeration, the §4.2.7.6.1 relative-lag base, and the §4.2.7.6.3 LTP-scaling-present enumeration).

Fields§

§bandwidth: Bandwidth

Internal SILK bandwidth (NB / MB / WB). SWB / FB are rejected.

§frame_size: SilkFrameSize

SILK frame duration: 10 ms (2 subframes) or 20 ms (4 subframes).

§voice_active: bool

§4.2.4 voice-activity flag for this frame’s time interval. Selects the §4.2.7.3 frame-type PDF (active vs inactive).

§first_subframe_independent: bool

§4.2.7.4: whether the first subframe gain is coded independently (first SILK frame of its type for this channel in the Opus frame, or the previous SILK frame of the same type was not coded).

§previous_log_gain: Option<u8>

§4.2.7.4 clamp base: the previous SILK frame’s last subframe log_gain for this channel, or None after a reset / uncoded previous frame (the clamp is then skipped).

§previous_primary_lag: Option<i32>

§4.2.7.6.1: how the primary pitch lag is coded. None defaults to absolute coding; Some(prev) enables relative coding against the previous frame’s primary lag.

§ltp_scaling_present: bool

§4.2.7.6.3: whether the LTP scaling factor is present in the bitstream (first time interval of the Opus frame for its type, or an LBRR frame whose prior LBRR frame is not coded).

§lsf_interp_after_reset: bool

§4.2.7.5.5 interpolation context for a 20 ms frame: true after a decoder reset / uncoded previous frame (the decoded factor is discarded and 4 is used). Ignored for a 10 ms frame.

§previous_nlsf_q15: Option<[i16; 16]>

§4.2.7.5.5: the previous coded frame’s stabilized NLSF vector (n0_Q15[]), used as the interpolation base for a 20 ms frame. None after a reset (the 4 factor is used so n1 == n2).

§previous_nlsf_len: usize

Length of the populated prefix of Self::previous_nlsf_q15 (the d_LPC of the previous frame: 10 for NB/MB, 16 for WB).

§stereo: Option<StereoHeaderContext>

§4.2.7.1 / §4.2.7.2 stereo header context for the mid channel of a stereo Opus frame. None for a mono frame (no stereo prediction weights, no mid-only flag). When Some, the front-half decode reads the §4.2.7.1 prediction weights first and, when StereoHeaderContext::has_mid_only_flag is set, the §4.2.7.2 mid-only flag, both in Table-5 order ahead of the frame type. The decoded values are returned in SilkFrameDecoded::stereo_pred / SilkFrameDecoded::mid_only_flag.

Trait Implementations§

Source§

impl Clone for SilkFrameConfig

Source§

fn clone(&self) -> SilkFrameConfig

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 SilkFrameConfig

Source§

impl Debug for SilkFrameConfig

Source§

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

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

impl Eq for SilkFrameConfig

Source§

impl PartialEq for SilkFrameConfig

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SilkFrameConfig

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.