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
impl Clone for FrameDecodeStatus
Source§fn clone(&self) -> FrameDecodeStatus
fn clone(&self) -> FrameDecodeStatus
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 FrameDecodeStatus
Source§impl Debug for FrameDecodeStatus
impl Debug for FrameDecodeStatus
impl Eq for FrameDecodeStatus
Source§impl PartialEq for FrameDecodeStatus
impl PartialEq for FrameDecodeStatus
Source§fn eq(&self, other: &FrameDecodeStatus) -> bool
fn eq(&self, other: &FrameDecodeStatus) -> bool
self and other values to be equal, and is used by ==.