forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to crates/ec-ac3/src/aht_tables.rsClear filter

2026-08-21

2026-08-14

fix(ac3): correct the hebap-4 vector quantizer tableAhmet Kaan Gümüş · 9a40807
fix(ac3): correct the hebap-4 vector quantizer table

Table E4.4's index column is offset by one against its value rows. The
vector an encoder selects with index k is the row the document prints at
k + 1, and index 31 selects the all-zero vector, which the table never
prints. The other six VQ tables need no such correction.

Measured, not guessed: recovering each block's coefficients by running the
analysis transform over ffmpeg's PCM makes the comparison per bin rather
than per sample. Bucketed that way, only hebap-4 bins diverged -- 0.63% of
a channel's energy, and index 31 alone by ten orders of magnitude, with
fifteen independent occurrences all recovering exactly zero.

Coded bins on that stream now land within 0.01% of ffmpeg's energy.
feat(ac3): Enhanced AC-3 — Annex E syntax, spectral extension and AHTAhmet Kaan Gümüş · 7fa4038
feat(ac3): Enhanced AC-3 — Annex E syntax, spectral extension and AHT

Annex E bsi/audfrm/audblk, driving the same bit allocation and transform
as AC-3. Spectral extension synthesises the high band by translation,
noise blending and envelope scaling; the adaptive hybrid transform brings
its six-point DCT with the vector and gain-adaptive quantizers.

Two details the published document states ambiguously, resolved against a
real Dolby Digital Plus stream: the coupling banding array is indexed by
absolute sub-band (like the spectral extension one), and the AHT inverse
DCT carries sqrt(2), not the 2 its printed equation shows -- with 2 every
AHT channel comes out exactly sqrt(2) too loud.

Enhanced coupling and dependent substreams above 5.1 are refused by name.