ws-audio2: Musepack / AC-3 bench lines, docs/guide/audio.md section (+ tools/fixtures/docs_lossy.py inputs), AVI AC-3 track test

This commit is contained in:
4DBug committed 2026-10-31 14:48:22 -05:00
1 parent 41b72d9b8a
commit 2d99b9924a
5 files changed
+95 -5

No files matched your search

+28
View File
@@ -1078,3 +1078,31 @@ do
jitTune(false)
end
end
-- ws-audio2: lossy
do
-- Musepack (codecs/audio/Musepack) SV8 / SV7 and AC-3 5.1 (codecs/audio/Ac3): whole-file decodes, MB/s of f32 output
-- (tools/fixtures/mpc.py: 1.2 s of 44.1 kHz stereo at quality 5; tools/fixtures/ac3.py: 0.16 s of 48 kHz 5.1 at
-- 448 kbps, decoded 4 times per run)
local Mpc = require("@formats/audio/mpc")
local MpcFx = require("@tests/gen/mpc_cases")
local Ac3F = require("@formats/audio/ac3")
local Ac3Fx = require("@tests/gen/ac3_cases")
for _, c in MpcFx do
if c.name == "sv8_q5_stereo" or c.name == "sv7_q5_stereo" then
local b = buffer.fromstring(c.data)
bench("mpc " .. c.name, 5, c.frames * c.channels * 4, function()
assert(Mpc.decode(Bytes.reader(b)))
end)
end
end
for _, c in Ac3Fx do
if c.name == "5.1_448" then
local b = buffer.fromstring(c.data)
bench("ac3 5.1 448 kbps", 5, c.frames * c.channels * 4 * 4, function()
for _ = 1, 4 do
assert(Ac3F.decode(Bytes.reader(b)))
end
end)
end
end
end