Correct three stale claims about the encoder
Browse files at this commitf8b6839f28f0828627df5884ac5a976feb471648Parent: 1466a62- docs
- correct three stale claims about the encoder
2 changed files +12 -7
crates/ec-ac3/src/encode.rsmodified+5 -3
| @@ -507,9 +507,11 @@ impl Ac3Encoder { | |||
| 507 | /// send; otherwise it reuses. Each run of | 507 | /// send; otherwise it reuses. Each run of |
| 508 | /// blocks sharing one set codes the run's loudest magnitude per bin, so no | 508 | /// blocks sharing one set codes the run's loudest magnitude per bin, so no |
| 509 | /// block's mantissa is asked for more than its exponent's headroom. The | 509 | /// block's mantissa is asked for more than its exponent's headroom. The |
| 510 | - /// sending block uses D15 when block-switched, D45 for a run of 3+ blocks | 510 | + /// sending block uses D15 for the LFE channel, D25 when block-switched |
| 511 | - /// (stationary), D25 otherwise. `conservative` forces one D45 set per channel for the | 511 | + /// (the short transform's interleaved halves make D15's per-bin cost too |
| 512 | - /// whole frame: the cheapest legal side information. | 512 | + /// high — see the D25-vs-D15 note below), D45 for a run of 3+ blocks |
| 513 | + /// (stationary), D25 otherwise. `conservative` forces one D45 set per | ||
| 514 | + /// channel for the whole frame: the cheapest legal side information. | ||
| 513 | fn plan(&self, coeffs: &[Vec<[f32; COEFFS]>], blksw: &[Vec<bool>], endmant: &[usize], conservative: bool) -> Plan { | 515 | fn plan(&self, coeffs: &[Vec<[f32; COEFFS]>], blksw: &[Vec<bool>], endmant: &[usize], conservative: bool) -> Plan { |
| 514 | let ideal: Vec<Vec<[u8; COEFFS]>> = coeffs | 516 | let ideal: Vec<Vec<[u8; COEFFS]>> = coeffs |
| 515 | .iter() | 517 | .iter() |
crates/ec-ac3/src/lib.rsmodified+7 -4
| @@ -10,10 +10,13 @@ | |||
| 10 | //! | 10 | //! |
| 11 | //! Contracts worth knowing before implementing against this crate: | 11 | //! Contracts worth knowing before implementing against this crate: |
| 12 | //! | 12 | //! |
| 13 | -//! - **Encoding is a fixed-allocation skeleton so far.** [`Ac3Encoder`] writes | 13 | +//! - **Encoding has no psychoacoustic model yet.** [`Ac3Encoder`] writes |
| 14 | -//! spec-valid syncframes — real MDCT, real bit allocation, real CRCs — but | 14 | +//! spec-valid syncframes — real MDCT, per-block/channel transient-driven |
| 15 | -//! with a constant exponent strategy and bit allocation curve rather than a | 15 | +//! block switching, an exponent planner (D15/D25/D45/reuse) and a |
| 16 | -//! psychoacoustic search; see [`encode`] for exactly what is and is not | 16 | +//! binary-searched SNR-offset rate loop that fills a frame to roughly |
| 17 | +//! 93-99.6% of its budget depending on content and bit rate — but the bit | ||
| 18 | +//! allocation curve itself is the standard's masking model rather than a | ||
| 19 | +//! perceptual search; see [`encode`] for exactly what is and is not | ||
| 17 | //! adaptive yet. | 20 | //! adaptive yet. |
| 18 | //! - **Truncated input is [`Error::NeedMore`]**, a broken bit stream is | 21 | //! - **Truncated input is [`Error::NeedMore`]**, a broken bit stream is |
| 19 | //! [`Error::Corrupt`], and a construct this build does not implement is | 22 | //! [`Error::Corrupt`], and a construct this build does not implement is |