1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! The CELT layer (RFC 6716 §4.3) - under construction.
//!
//! CELT is the MDCT half of Opus: band energies coded with a Laplace model
//! plus fine refinement, and band shapes coded as PVQ pulse vectors. The
//! decode pipeline (§4.3) is
//!
//! ```text
//! coarse energy → fine energy → bit allocation → PVQ shapes →
//! anti-collapse → denormalization → inverse MDCT → post-filter
//! ```
//!
//! Implemented so far, bottom-up - each kernel fully tested in isolation
//! before the pipeline is assembled:
//!
//! | Module | RFC | Contents |
//! |--------|-----|----------|
//! | [`laplace`] | §4.3.2.1 | the Laplace coder for coarse energy deltas |
//! | [`cwrs`] | §4.3.4.2 | PVQ codeword enumeration (pulse vectors ↔ indices) |
//! | [`modes`] | Table 55 | static data of the standard 48 kHz mode |
//! | [`energy`] | §4.3.2 | coarse/fine/finalise energy envelope decoding |
//! | [`rate`] | §4.3.3 | the bit allocation: quality interpolation, band skipping, fine/shape split |
//! | [`tables`] | - | mechanically extracted allocation and pulse-cache tables |
//! | [`vq`] | §4.3.4.3 | spreading rotation, PVQ shape decoding, renormalisation |
//! | [`bands`] | §4.3.4 | the band loop: theta splits, stereo, folding, collapse masks |
//! | [`mdct`] | §4.3.7 | the low-overlap MDCT (forward + backward) with the FFT backend seam |
//! | [`decoder`] | §4.3 | the frame driver: flags, post-filter, synthesis, de-emphasis |
// Encoder, pitch analysis and the SIMD pulse search are encode-only (the decode
// path is SIMD-free), so they stay behind `std` while no_std targets decode.
pub
pub