ws-audio2: audio/ac3 + codecs/audio/Ac3: AC-3 decoding from ATSC A/52, AC-3 tracks of MKV / MP4 / TS / AVI

Written from the A/52:2018 specification (tables transcribed from it; no liba52 / ffmpeg code): every acmod with LFE,
coupling + phase flags, rematrixing, block switching, delta bit allocation, dither, CRC check, dynamic range off by
default (drc = 0 .. 1). E-AC-3 and bsid 9 / 10 are UNSUPPORTED. 101.8 - 108.6 dB SNR vs ffmpeg's float decode
(liba52's for block-switched streams: the packaged ffmpeg mis-decodes the first short transform).

Outside the folders: containers/AudioWrap passes ac3 tracks to audio/ac3 (one branch); a comment in
src/Formats/init.luau mentions it. The fixture clears the encoders' dithflags (positions from the new
Ac3 decoder field dec.blocks) so reference and decoder decode the same numbers.
This commit is contained in:
4DBug committed 2026-10-31 14:45:23 -05:00
1 parent 5b8f7cba39
commit 41b72d9b8a
10 files changed
+1741 -2

No files matched your search

+12
View File
@@ -158,6 +158,18 @@ local list: { Entry } = {
return require("@formats/audio/aac")
end,
},
{
name = "ac3",
category = "audio",
path = "audio/ac3",
extensions = { "ac3", "a52" },
mime = { "audio/ac3", "audio/x-ac3" },
deps = { "core/Err", "core/Bytes", "Types", "codecs/audio/Pcm", "codecs/audio/Stream", "codecs/audio/Ac3" },
caps = { decode = true, encode = false, codecs = { "ac3" }, channels = 6, streaming = true, lossy = true },
load = function()
return require("@formats/audio/ac3")
end,
},
{
name = "aiff",
category = "audio",