diff --git a/crates/ec-ac3/src/encode.rs b/crates/ec-ac3/src/encode.rs index 8f583830..16b24a65 100644 --- a/crates/ec-ac3/src/encode.rs +++ b/crates/ec-ac3/src/encode.rs @@ -507,9 +507,11 @@ impl Ac3Encoder { /// send; otherwise it reuses. Each run of /// blocks sharing one set codes the run's loudest magnitude per bin, so no /// block's mantissa is asked for more than its exponent's headroom. The - /// sending block uses D15 when block-switched, D45 for a run of 3+ blocks - /// (stationary), D25 otherwise. `conservative` forces one D45 set per channel for the - /// whole frame: the cheapest legal side information. + /// sending block uses D15 for the LFE channel, D25 when block-switched + /// (the short transform's interleaved halves make D15's per-bin cost too + /// high — see the D25-vs-D15 note below), D45 for a run of 3+ blocks + /// (stationary), D25 otherwise. `conservative` forces one D45 set per + /// channel for the whole frame: the cheapest legal side information. fn plan(&self, coeffs: &[Vec<[f32; COEFFS]>], blksw: &[Vec], endmant: &[usize], conservative: bool) -> Plan { let ideal: Vec> = coeffs .iter() diff --git a/crates/ec-ac3/src/lib.rs b/crates/ec-ac3/src/lib.rs index 9c0ddb69..6b8a090a 100644 --- a/crates/ec-ac3/src/lib.rs +++ b/crates/ec-ac3/src/lib.rs @@ -10,10 +10,13 @@ //! //! Contracts worth knowing before implementing against this crate: //! -//! - **Encoding is a fixed-allocation skeleton so far.** [`Ac3Encoder`] writes -//! spec-valid syncframes — real MDCT, real bit allocation, real CRCs — but -//! with a constant exponent strategy and bit allocation curve rather than a -//! psychoacoustic search; see [`encode`] for exactly what is and is not +//! - **Encoding has no psychoacoustic model yet.** [`Ac3Encoder`] writes +//! spec-valid syncframes — real MDCT, per-block/channel transient-driven +//! block switching, an exponent planner (D15/D25/D45/reuse) and a +//! binary-searched SNR-offset rate loop that fills a frame to roughly +//! 93-99.6% of its budget depending on content and bit rate — but the bit +//! allocation curve itself is the standard's masking model rather than a +//! perceptual search; see [`encode`] for exactly what is and is not //! adaptive yet. //! - **Truncated input is [`Error::NeedMore`]**, a broken bit stream is //! [`Error::Corrupt`], and a construct this build does not implement is