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

+3 -10
View File
@@ -1,7 +1,5 @@
-- audio/mpc tests: Musepack SV8 (mpcenc 1.30: stereo / mono, 32 / 44.1 / 48 kHz, quality 1 .. 9, 1 / 4 / 16 / 64
-- frames per packet) and SV7 (mppenc 1.16, quality 2 / 5 / 8) against libmpcdec's float output (mpcf32: gapless
-- length, near bit-exact) and ffmpeg's decode (SNR); APEv2 tags; seeking (SV8 exact, SV7 like libmpcdec); a leading
-- ID3v2 tag; truncated files; error codes; the fuzz no-throw pass. Fixtures: tools/fixtures/mpc.py.
-- audio/mpc tests: Musepack SV8 (mpcenc 1.30) and SV7 (mppenc 1.16) against libmpcdec's float output and ffmpeg.
-- Fixtures: tools/fixtures/mpc.py.
local T = require("@tests/T")
local Mpc = require("@rosetta/audio/mpc")
local Bytes = require("@rosetta/core/Bytes")
@@ -15,7 +13,6 @@ local function reader(s: string): Bytes.Reader
return Bytes.reader(buffer.fromstring(s))
end
-- SNR (dB) and the largest difference of frames [from, to) of got against a f32le reference (frames from 0)
local function compare(got: buffer, gotFrom: number, ref: string, ch: number, frames: number): (number, number)
local rb = buffer.fromstring(ref)
local n = math.min(frames * ch, #ref // 4)
@@ -64,8 +61,7 @@ for _, c in Fx do
end
end
-- seeking: SV8 is exact (one packet of pre-roll); SV7 decodes like libmpcdec's seek (32 frames of pre-roll from reset
-- scalefactors)
-- SV8 seeks exactly; SV7 like libmpcdec's seek (32 frames of pre-roll from reset scalefactors)
for _, sk in Seek do
local c = byName[sk.name]
local whole = Mpc.decode(reader(c.data)) :: any
@@ -94,7 +90,6 @@ for _, sk in Seek do
t:check(n0 == 1000 and d0 < 1e-5, sk.name .. ": seek back to 0")
end
-- an ID3v2 tag in front; truncated files
do
local c = byName.sv8_q5_stereo
local id3 = "ID3\3\0\0\0\0\0\20" .. string.rep("\0", 20)
@@ -112,7 +107,6 @@ do
end
end
-- errors
do
local c8, c7 = byName.sv8_q5_stereo.data, byName.sv7_q5_stereo.data
t:eq(Mpc.sniff(reader("RIFF....WAVE")), 0, "sniff a WAV")
@@ -131,7 +125,6 @@ do
t:check(e and e.code == Err.LIMIT, "maxFrames: " .. tostring(e))
end
-- fuzz
do
local samples = {}
for _, c in Fx do