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

+2 -8
View File
@@ -1,7 +1,5 @@
-- audio/vorbis tests: oggenc / ffmpeg streams (qualities -1 .. 10, managed bitrate, 8 .. 96 kHz, mono / stereo / 5.1,
-- transients, silence, tags, sub-block lengths) against oggdec (libvorbisfile: sample counts and 16-bit samples, so
-- start / end trimming is exact) and ffmpeg's f32 decode (SNR); streaming reads; seeking (sample-exact against the
-- reference at the target); the packet-level decoder; errors; fuzz. Fixtures: tools/fixtures/vorbis.py.
-- audio/vorbis tests: oggenc / ffmpeg streams against oggdec (16-bit, exact trimming) and ffmpeg's f32 decode (SNR).
-- Fixtures: tools/fixtures/vorbis.py.
local T = require("@tests/T")
local Vorbis = require("@rosetta/audio/vorbis")
local Bytes = require("@rosetta/core/Bytes")
@@ -20,7 +18,6 @@ local function s16(x: number): number
local v = math.floor(x * 32768 + 0.5)
return math.clamp(v, -32768, 32767)
end
-- the largest |our sample as s16 - oggdec's| over n samples of ours at byte a0 against ref16 from sample r0
local function maxDiff16(a: buffer, a0: number, ref: buffer, r0: number, n: number): number
local m = 0
for i = 0, n - 1 do
@@ -76,7 +73,6 @@ for _, c in Cases do
minSnr = math.min(minSnr, s)
t:check(s > 100, string.format("%s: SNR vs ffmpeg %.1f dB", c.name, s))
end
-- streaming in odd chunks gives the same samples
local dec = Vorbis.open(reader(c.data)) :: Types.Decoder
t:eq(dec.frames, c.frames, c.name .. ": Decoder.frames")
local got, ok = 0, true
@@ -117,7 +113,6 @@ local function case(name: string): any
error("no case " .. name)
end
-- tags, meta, sniff, sub-range
do
local c = case("q2-stereo-32k-tags")
local dec = Vorbis.open(reader(c.data)) :: any
@@ -164,7 +159,6 @@ do
t:check(e and e.code == Err.CORRUPT, "packetDecoder with headers swapped")
end
-- errors
do
local _, e1 = Vorbis.decode(reader("OggS but not really"))
t:check(e1 and Err.is(e1), "junk: " .. tostring(e1))