Skip to main content

FrameDecodeStatus

Enum FrameDecodeStatus 

Source
pub enum FrameDecodeStatus {
    DtxOrLost,
    LayerNotWired(OperatingMode),
    SilkParamsDecoded,
    SilkStereoDecoded,
    SilkDecodeError,
    CeltSilence,
    CeltDecodeError,
    CeltCoarseEnergyDecoded,
    CeltAllocationDecoded,
}
Expand description

Why a given Opus frame produced the samples it did.

The packet-level orchestration is complete, but the per-frame audio decode lands incrementally. This status lets a caller (and the crate’s own tests) distinguish “decoded real audio” from “emitted silence because the layer’s range-coded decode is not wired yet” or “emitted silence for a DTX / lost frame”.

Variants§

§

DtxOrLost

A §3.2.1 zero-length frame: DTX or a lost/packet-loss marker. Per §4.6 the floor behaviour is to emit silence; a real PLC model is a separate milestone.

§

LayerNotWired(OperatingMode)

The frame’s operating mode does not yet have a composed sample-producing decode path in this crate, so silence of the correct length was emitted. The variant carries the mode so the caller knows which layer is pending.

§

SilkParamsDecoded

A mono SILK-only frame whose full §4.2.7 bitstream (frame type, gains, LSF chain, LTP, LCG seed, excitation) was decoded in Table-5 order via crate::silk_decode::decode_silk_frame, then synthesized through the §4.2.7.9 LTP / LPC filters (crate::silk_synthesis::synthesize_silk_frame) and resampled to 48 kHz (§4.2.9, non-normative). The emitted PCM is real audio.

§

SilkStereoDecoded

A stereo SILK-only frame whose §4.2.3 / §4.2.4 header bits and the §4.2.5 / §4.2.6 interleaved mid/side SILK frames were decoded in §4.2.2 order (mid frame then side frame per 20 ms interval, the side frame skipped when the §4.2.7.2 mid-only flag is set), each channel synthesized through the §4.2.7.9 filters, converted from mid/side to left/right via §4.2.8 stereo unmixing (crate::silk_stereo::stereo_ms_to_lr), then resampled to 48 kHz (§4.2.9, non-normative). The emitted interleaved L/R PCM is real audio.

§

SilkDecodeError

A SILK-only frame whose §4.2.7 bitstream decode latched an error (a malformed / truncated frame). Silence of the correct length was emitted in its place per the §4.6 floor.

§

CeltSilence

A CELT-only frame whose §4.3.7.1 silence flag was set: the real range-coded frame prefix (silence + post-filter group) was decoded and the §4.3.6→§4.3.7.2 synthesis backend was advanced with all-zero band shapes / energies, emitting silence PCM while carrying the MDCT overlap-add and de-emphasis state forward for the next frame. (Distinct from Self::LayerNotWired: the bitstream is actually consumed and the synthesis state is real, not stubbed.)

§

CeltDecodeError

A CELT-only frame whose §4.3.7.1 prefix decode latched a range-coder error (a malformed / truncated frame). Silence of the correct length was emitted in its place per the §4.6 floor.

§

CeltCoarseEnergyDecoded

A non-silent CELT-only frame whose §4.3.7.1 prefix and §4.3.2.1 coarse-energy were decoded from the real range coder: the per-band coarse log-energy envelope was reconstructed (the 2-D predictor recurrence in crate::celt_coarse_energy) and threaded into the cross-frame predictor state. The remaining band-data stages (bit allocation, §4.3.4 PVQ band shapes, §4.3.2.2 fine energy) are not yet wired, so silence of the correct length is still emitted and the synthesis backend’s overlap-add / de-emphasis state is advanced — but the coarse-energy front half of the entropy decode is now real. (Distinct from Self::LayerNotWired: the frame prefix and coarse energy are actually consumed.)

§

CeltAllocationDecoded

A non-silent CELT-only frame that additionally decoded the §4.3.3 allocation header from the real range coder, on top of the §4.3.7.1 prefix and §4.3.2.1 coarse energy: the §4.3.3 band boosts (crate::celt_band_boost::decode_band_boosts), the §4.3.3 allocation trim (crate::celt_alloc_trim::decode_alloc_trim), and the §4.3.3 anti-collapse / skip / intensity-stereo / dual-stereo reservations (crate::celt_reservations::reserve_block) were consumed in §4.3.3 order, advancing the range-coder position through the entire signalled part of the allocation. The remaining §4.3.3 implicit allocation (the interp_bits2pulses per-band pulse / fine-energy split — reference-code-only, absent from the RFC narrative body) plus the §4.3.4 PVQ band shapes and §4.3.2.2 fine energy are still pending, so silence of the correct length is emitted and the synthesis backend’s overlap-add / de-emphasis state is advanced with all-zero bands. The signalled allocation header is now real. (Distinct from Self::CeltCoarseEnergyDecoded: the boost / trim / reservation symbols are actually consumed.)

Trait Implementations§

Source§

impl Clone for FrameDecodeStatus

Source§

fn clone(&self) -> FrameDecodeStatus

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 FrameDecodeStatus

Source§

impl Debug for FrameDecodeStatus

Source§

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

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

impl Eq for FrameDecodeStatus

Source§

impl PartialEq for FrameDecodeStatus

Source§

fn eq(&self, other: &FrameDecodeStatus) -> 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 FrameDecodeStatus

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.