ws-video-vp8: bench lines (VP8 decode fps 320x240 / 640x480, LuaJIT also with the host's trace limits), damaged inter frame pass in the test, type fix

This commit is contained in:
4DBug committed 2026-10-31 10:08:08 -05:00
1 parent 828389b643
commit 0c7b316998
3 files changed
+69 -4

No files matched your search

+31
View File
@@ -535,3 +535,34 @@ do
Webp.encode(img, { effort = 1 })
end)
end
do
-- VP8 video (codecs/Vp8, tools/fixtures/vp8video.py): whole IVF streams (libvpx, panning testsrc2) through one
-- decoder object; frames per second. On LuaJIT the library's host module raises the trace limits (maxtrace=8000,
-- see src/Formats/host/init.luau): the second pair of lines runs with them, as the api does.
local Vp8 = require("@formats/codecs/Vp8")
local VB = require("@tests/gen/vp8video_bench")
local function run(tag: string)
for _, c in VB do
local b = buffer.fromstring(c.ivf)
local frames = {}
local p = 32
while p + 12 <= buffer.len(b) do
local n = buffer.readu32(b, p)
table.insert(frames, { p + 12, n })
p += 12 + n
end
local dt = bench(string.format("vp8 decode %dx%d%s", c.width, c.height, tag), 3, c.width * c.height * 1.5 * #frames, function()
local dec = Vp8.newDecoder()
for _, f in frames do
dec:decodeFrame(b, f[1], f[2])
end
end)
print(string.format("%-8s %-30s %8.1f fps", runtime, " (" .. #frames .. " frames)", #frames / dt))
end
end
run("")
if runtime == "luajit" then
require("@formats/host")
run(" (jit tuned)")
end
end