tests/audio: comments: specs only
This commit is contained in:
1 parent
75ddfb4068
commit
0eec255bfb
30 files changed
+66
-244
No files matched your search
@@ -1,11 +1,8 @@
|
||||
-- tests/audio/_adpcm: shared checks of the ADPCM game-audio formats (adx, vag, brstm): a file against the reference
|
||||
-- decoder's s16le output, bit-exact, through decode() and through open() with seeks (forward into unvisited packets,
|
||||
-- back, the end), loop points; the SNR of an encoder's round trip.
|
||||
-- tests/audio/_adpcm: shared checks of adx, vag, brstm: bit-exact against the reference decoder's s16le output.
|
||||
local Bytes = require("@rosetta/core/Bytes")
|
||||
|
||||
local H = {}
|
||||
|
||||
-- same(f32 buffer, s16le reference buffer, first reference sample, count) -> true when every sample is equal
|
||||
function H.same(out: buffer, ref: buffer, from: number, count: number): boolean
|
||||
for i = 0, count - 1 do
|
||||
if buffer.readf32(out, i * 4) * 32768 ~= buffer.readi16(ref, (from + i) * 2) then
|
||||
@@ -26,7 +23,6 @@ function H.snr(x: buffer, y: buffer, count: number): number
|
||||
return if err == 0 then 200 else 10 * math.log10(sig / err)
|
||||
end
|
||||
|
||||
-- check(t, Fmt, c, opts?): c = { name, data, rate, ch, frames?, ref, loopStart?, loopEnd? }
|
||||
function H.check(t: any, Fmt: any, c: any, opts: any?)
|
||||
local ref = buffer.fromstring(c.ref)
|
||||
local frames = buffer.len(ref) // (2 * c.ch)
|
||||
|
||||
Reference in new issue
Block a user