tests/audio: comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:51:26 -05:00
1 parent 75ddfb4068
commit 0eec255bfb
30 files changed
+66 -244

No files matched your search

+4 -10
View File
@@ -1,9 +1,6 @@
-- audio/ac3 tests: AC-3 streams from ffmpeg (every acmod with and without LFE, coupling incl. cplbegf 0, rematrixing,
-- 32 / 44.1 / 48 kHz) and aften (block switching, 1+1 dual mono, dynamic range profiles, the alternate BSI) against
-- ffmpeg's float decode, or liba52's for block-switched streams (SNR, max difference; dithflags cleared in the
-- fixture step so both sides decode the same numbers); dynamic range on; the encoders' dithered originals; AC-3 tracks
-- of MKV / MP4 / MPEG-TS / AVI through the api's audio hook; exact seeking; resync and truncation; error codes (E-AC-3,
-- CRC); the fuzz no-throw pass. Fixtures: tools/fixtures/ac3.py.
-- audio/ac3 tests: AC-3 streams from ffmpeg and aften against ffmpeg's float decode, or liba52's for block-switched
-- streams (dithflags cleared in the fixture step so both sides decode the same numbers).
-- Fixtures: tools/fixtures/ac3.py.
local T = require("@tests/T")
local F = require("@rosetta")
local Ac3F = require("@rosetta/audio/ac3")
@@ -19,7 +16,6 @@ local function reader(s: string): Bytes.Reader
return Bytes.reader(buffer.fromstring(s))
end
-- SNR (dB) and the largest difference of interleaved f32 `got` against the f32le reference `ref`
local function compare(got: buffer, ref: string, count: number): (number, number)
local rb = buffer.fromstring(ref)
local n = math.min(count, #ref // 4, buffer.len(got) // 4)
@@ -104,7 +100,6 @@ do
end
end
-- resync over garbage, a truncated last frame, the raw codec API
do
local c = byName.stereo_44k
local a = Ac3F.decode(reader("\0\11\119garbage" .. c.data)) :: any
@@ -118,7 +113,6 @@ do
t:check(n == 1536 and d.channels == 2 and #d.pcm == 1536 * 2, "decoder: one syncframe")
end
-- errors
do
local c = byName.stereo_44k.data
t:eq(Ac3F.sniff(reader("RIFF....WAVE")), 0, "sniff a WAV")
@@ -138,7 +132,7 @@ do
t:check(e and e.code == Err.LIMIT, "maxFrames: " .. tostring(e))
end
-- fuzz (without the CRC check, so mutations reach the decoder)
-- fuzz without the CRC check, so mutations reach the decoder
do
local samples = {}
for _, c in Fx do