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: BandwidthInternal SILK bandwidth (NB / MB / WB). SWB / FB are rejected.
frame_size: SilkFrameSizeSILK 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: usizeLength 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
impl Clone for SilkFrameConfig
Source§fn clone(&self) -> SilkFrameConfig
fn clone(&self) -> SilkFrameConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SilkFrameConfig
Source§impl Debug for SilkFrameConfig
impl Debug for SilkFrameConfig
impl Eq for SilkFrameConfig
Source§impl PartialEq for SilkFrameConfig
impl PartialEq for SilkFrameConfig
Source§fn eq(&self, other: &SilkFrameConfig) -> bool
fn eq(&self, other: &SilkFrameConfig) -> bool
self and other values to be equal, and is used by ==.