forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on cb2465d9e46aa8a9eccb2156cb85e47eeeb4ba3cFiltered to crates/ec-ac3/src/decoder.rsClear filter

2026-09-12

🛡️ fix(ac3): a packet tail that begins a syncframe is refused by name, never dropped in silenceAhmet Kaan Gümüş · 49e4498
🛡️ fix(ac3): a packet tail that begins a syncframe is refused by name, never dropped in silence

decode_frame decoded the first substream and discarded the rest of the
packet (let _ = consumed) -- the shape a Matroska block for 7.1 DD+
really carries (independent substream plus its dependent): 1536 samples
out, the extension channels gone, no error. Old decoders of record
walked that tail, so the silent drop was a regression hiding under the
named refusals.

Now reject_tail runs after every successful frame: padding that is not
itself a syncframe (the container slack the spec allows) still decodes
sample-for-sample like the bare frame, but a tail that begins a
syncframe is Unsupported naming what it is -- an E-AC-3 dependent
substream in the tail (the 7.1 extension channels) or a second
syncframe altogether (one packet is one frame and its substreams; hand
frames over one at a time). A 0x0B77 coincidence that parses as no
header stays junk.

Witnesses in decode_matrix: concatenated real fixture frames (AC-3 and
E-AC-3) refuse as second syncframes; the E-AC-3 tail flipped to
dependent refuses with the dependent wording; padded frames decode
bit-identically to bare ones. Fixture matrix vs ffmpeg stays green.

2026-08-14

fix(ac3): switch the spectral extension noise with the dither optionAhmet Kaan Gümüş · 6432e08
fix(ac3): switch the spectral extension noise with the dither option

§E3.6.4.2.4's noise() is a zero-mean unit-variance source the standard
leaves to the implementation, exactly like §7.3.4's dither: two conformant
decoders differ by it and by nothing else. It now follows the same option,
so a comparison against another decoder can isolate what the standard does
specify, and the default still generates both.

On the Dolby Digital Plus track that uses spectral extension this is the
whole remaining difference: 0.9988 per-channel correlation with both
decoders' noise in, 0.9994 with it out.
feat(ac3): AC-3 decoder — coupling, rematrixing, DRC and the public surfaceAhmet Kaan Gümüş · 5bc2be2
feat(ac3): AC-3 decoder — coupling, rematrixing, DRC and the public surface

One packet is one syncframe; frames come out as interleaved f32 in the
family's channel order, with an optional section 7.8 Lo/Ro downmix for
callers that want stereo. Dynamic range compression is applied by default
because section 7.7.1 says a decoder shall, with drc_scale to turn it
down; dialnorm is surfaced and never applied.

Every fixture decodes to a per-channel correlation of 1.000000 against
ffmpeg (mono, stereo and 5.1 at 32/44.1/48 kHz).