diff --git a/crates/ec-ac3/src/decoder.rs b/crates/ec-ac3/src/decoder.rs index 804e333a..7847681f 100644 --- a/crates/ec-ac3/src/decoder.rs +++ b/crates/ec-ac3/src/decoder.rs @@ -38,13 +38,16 @@ pub struct Options { pub drc_scale: f32, /// Channel folding, off by default. pub downmix: Downmix, - /// Substitute pseudo-random noise for zero-bit mantissas (§7.3.4), which - /// is what the standard asks a decoder to do and what this defaults to. + /// Generate the pseudo-random noise the format asks for: dither in place + /// of zero-bit mantissas (§7.3.4) and the blend that fills the spectral + /// extension band (§E3.6.4.2.4). On by default, because both are what the + /// standard asks a decoder to do. /// - /// The sequence itself is implementation-defined ("any reasonably random - /// sequence"), so two conformant decoders differ by exactly this noise; - /// turning it off is how a comparison against another decoder isolates - /// everything else. + /// Neither sequence is specified — §7.3.4 says "any reasonably random + /// sequence" and §E3.6.4.2.4 just names a zero-mean unit-variance source — + /// so two conformant decoders differ by exactly this noise and nothing + /// else. Turning it off is how a comparison against another decoder + /// isolates everything that *is* specified. pub dither: bool, } diff --git a/crates/ec-ac3/src/lib.rs b/crates/ec-ac3/src/lib.rs index dc3cfe8e..981ff3d3 100644 --- a/crates/ec-ac3/src/lib.rs +++ b/crates/ec-ac3/src/lib.rs @@ -24,19 +24,19 @@ //! it down or off. //! - **Dialogue normalisation is surfaced, never applied.** §7.6 puts //! `dialnorm` in the volume control, which is not in this crate. -//! - **Dither is on by default** (§7.3.4) but its sequence is -//! implementation-defined, so two conformant decoders differ by exactly that -//! noise; [`Options::dither`] turns it off when a comparison needs to +//! - **The noise this format asks for is on by default**: dither for zero-bit +//! mantissas (§7.3.4) and the spectral extension blend (§E3.6.4.2.4). Neither +//! sequence is specified, so two conformant decoders differ by exactly that +//! noise; [`Options::dither`] turns both off when a comparison needs to //! isolate everything else. //! //! Annex E coverage: the adaptive hybrid transform (with its vector and //! gain-adaptive quantizers) and spectral extension are decoded; enhanced //! coupling and dependent substreams above 5.1 are refused by name rather than -//! decoded wrongly. On a real Dolby Digital Plus stream that uses AHT and -//! spectral extension the output tracks ffmpeg's to a per-channel correlation -//! of 0.994 rather than the 0.9999 the rest of the format reaches — the -//! remaining difference is in the AHT quantizer detail and the two decoders' -//! independent noise sources. +//! decoded wrongly. On a real Dolby Digital Plus stream that uses both, the +//! coded bins land within 0.01% of ffmpeg's energy and the whole channel within +//! 0.999 correlation once the two decoders' independent noise is taken out of +//! the comparison ([`Options::dither`]). //! //! No unsafe, no allocation on the block path beyond the output buffer, and no //! dependencies beyond the family IR and DSP crates.