ws-video2-theora: Theora speed (fused prediction + IDCT add, inlined token decode, table-driven tokens), bench lines, guide section
tools/bench.luau: a ws-video2-theora block (320x240 testsrc2 / mandelbrot, decode and decode + image()). docs/guide/video.md: an Ogg Theora section (tested snippet; inputs from the new tools/fixtures/docs_theora.py) and the formats / writers tables.
This commit is contained in:
1 parent
4dcb005180
commit
1013925a85
6 files changed
+342
-222
No files matched your search
@@ -1078,3 +1078,42 @@ do
|
||||
jitTune(false)
|
||||
end
|
||||
end
|
||||
do
|
||||
-- ------------------------------------------------------------------------------------- ws-video2-theora: fps
|
||||
-- Theora (codecs/video/Theora): 320x240 clips, 50 frames, keyframe every 25: testsrc2 at 600 kbit/s (mostly static:
|
||||
-- few coded blocks) and a mandelbrot zoom at 1200 kbit/s (every block coded, moving); decode alone and decode +
|
||||
-- image() (the yuv420p copy every VideoDecoder frame makes)
|
||||
local Theora = require("@formats/codecs/video/Theora")
|
||||
local Ogg = require("@formats/containers/Ogg")
|
||||
local Base64 = require("@formats/core/Base64")
|
||||
local TB = require("@tests/gen/theora_bench")
|
||||
local function run(tag: string)
|
||||
for _, c in TB do
|
||||
local d = Ogg.open(Base64.decode(c.file) :: buffer)
|
||||
local hdrs, data = {}, {}
|
||||
for p in d:packets(d:find("theora")) do
|
||||
table.insert(if #hdrs < 3 then hdrs else data, Ogg.copy(p))
|
||||
end
|
||||
for _, image in { false, true } do
|
||||
local n = c.width * c.height * 3 // 2 * #data
|
||||
local dt = bench(string.format("theora %s %dx%d%s%s", c.name, c.width, c.height, if image then " +img" else "", tag), 3, n, function()
|
||||
local dec = Theora.new(hdrs) :: any
|
||||
for _, p in data do
|
||||
dec:decode(p)
|
||||
if image then
|
||||
dec:image()
|
||||
end
|
||||
end
|
||||
end)
|
||||
print(string.format("%-8s %-30s %8.1f fps", runtime, " (" .. #data .. " frames)", #data / dt))
|
||||
end
|
||||
end
|
||||
end
|
||||
jitTune(false)
|
||||
run("")
|
||||
if runtime == "luajit" then
|
||||
jitTune(true)
|
||||
run(" (jit tuned)")
|
||||
jitTune(false)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user