ws-audio: Vorbis encoder (audio/vorbis/Encode: long blocks, floor 1 fit to the envelope, square-polar coupling, residue 2 with 6 classes + cascades, fixed Laplacian-Huffman codebooks, exact granules, Ogg via containers/Ogg Mux) wired into audio/vorbis encode; fixtures: ogginfo clean, oggdec exact lengths + SNR floors, ffmpeg; bench line
This commit is contained in:
1 parent
929b5d6d53
commit
cb05744367
7 files changed
+1068
-7
No files matched your search
@@ -160,3 +160,17 @@ do
|
||||
print(string.format("%-8s %-30s %8.1fx real time", runtime, "", 10 / dt))
|
||||
end
|
||||
end
|
||||
-- vorbis encode (ws-audio): 10 s of 44.1 kHz stereo tones at quality 3
|
||||
do
|
||||
local Vb = require("@formats/audio/vorbis")
|
||||
local n = 441000
|
||||
local a = Types.Audio.new(44100, 2, n)
|
||||
for i = 0, n - 1 do
|
||||
buffer.writef32(a.samples, i * 8, math.sin(i * 0.031) * 0.4 + math.sin(i * 0.21) * 0.1)
|
||||
buffer.writef32(a.samples, i * 8 + 4, math.sin(i * 0.017) * 0.3)
|
||||
end
|
||||
local dt = bench("vorbis encode q3 (10 s st)", 2, n * 8, function()
|
||||
Vb.encode(a, { quality = 3 })
|
||||
end)
|
||||
print(string.format("%-8s %-30s %8.1fx real time", runtime, "", 10 / dt))
|
||||
end
|
||||
Reference in new issue
Block a user