pub struct SilkFrameHeader {
pub vad_flag: bool,
pub lbrr_flag: bool,
pub signal_type: u8,
pub quantization_offset: u8,
}Expand description
Parsed header fields from a SILK frame.
Fields§
§vad_flag: boolVoice activity detection flag.
lbrr_flag: boolLow Bitrate Redundancy (LBRR) payload present.
signal_type: u8Signal type: 0 = inactive, 1 = voiced, 2 = unvoiced.
quantization_offset: u8Quantization offset type (0 or 1).
Implementations§
Source§impl SilkFrameHeader
impl SilkFrameHeader
Sourcepub fn parse(data: &[u8]) -> Result<Self, String>
pub fn parse(data: &[u8]) -> Result<Self, String>
Parses a SilkFrameHeader from the first byte(s) of a raw frame.
The SILK frame header is packed into the leading bits of the payload. This parser reads the minimum information needed to scaffold frame processing; full SILK decoding requires an entropy/range decoder.
Layout of byte 0:
Bit 7: VAD flag
Bit 6: LBRR flag
Bits 5-4: signal_type (0-2, values 0b11 treated as inactive)
Bit 3: quantization_offset
Bits 2-0: reserved / additional payload bitsTrait Implementations§
Source§impl Clone for SilkFrameHeader
impl Clone for SilkFrameHeader
Source§fn clone(&self) -> SilkFrameHeader
fn clone(&self) -> SilkFrameHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SilkFrameHeader
impl Debug for SilkFrameHeader
Source§impl PartialEq for SilkFrameHeader
impl PartialEq for SilkFrameHeader
impl Eq for SilkFrameHeader
impl StructuralPartialEq for SilkFrameHeader
Auto Trait Implementations§
impl Freeze for SilkFrameHeader
impl RefUnwindSafe for SilkFrameHeader
impl Send for SilkFrameHeader
impl Sync for SilkFrameHeader
impl Unpin for SilkFrameHeader
impl UnsafeUnpin for SilkFrameHeader
impl UnwindSafe for SilkFrameHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more