pub struct EncoderMdctState {
pub n: u32,
pub history: Vec<f32>,
}Expand description
Per-channel forward-MDCT analysis state — carries the last N input
samples so the next frame can window across the 50% TDAC boundary.
Fields§
§n: u32Transform length (samples per output spectrum). The MDCT consumes
2N samples per call (last N from history + this frame’s N new).
history: Vec<f32>Last N input PCM samples for the next-frame overlap.
Implementations§
Source§impl EncoderMdctState
impl EncoderMdctState
Sourcepub fn new(n: u32) -> Self
pub fn new(n: u32) -> Self
Fresh encoder state with N-sample zero history (TDAC priming — the very first encoded frame will lose half a window of energy at the leading edge, identical to the decoder’s first-frame behaviour).
Sourcepub fn analyse_frame(&mut self, frame: &[f32]) -> Vec<f32>
pub fn analyse_frame(&mut self, frame: &[f32]) -> Vec<f32>
Push a fresh N-sample frame of input PCM through the windowed
forward MDCT and return the N spectral coefficients. The caller
owns the input buffer — this method consumes it logically (copies
into the state).
Trait Implementations§
Source§impl Clone for EncoderMdctState
impl Clone for EncoderMdctState
Source§fn clone(&self) -> EncoderMdctState
fn clone(&self) -> EncoderMdctState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EncoderMdctState
impl RefUnwindSafe for EncoderMdctState
impl Send for EncoderMdctState
impl Sync for EncoderMdctState
impl Unpin for EncoderMdctState
impl UnsafeUnpin for EncoderMdctState
impl UnwindSafe for EncoderMdctState
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