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:
4DBug committed 2026-10-31 14:43:22 -05:00
1 parent 4dcb005180
commit 1013925a85
6 files changed
+342 -222

No files matched your search

+8 -5
View File
@@ -10,7 +10,7 @@
# rate, channels }
# tests/gen/theora_opus.luau, theora_flac.luau the same with mono Opus / FLAC audio
# tests/gen/theora_mkv.luau { file (base64 .mkv), frames }
# tests/gen/theora_bench.luau { file (base64 .ogv, 320x240) } for tools/bench.luau
# tests/gen/theora_bench.luau { { name, file (base64 .ogv, 320x240), width, height } } for tools/bench.luau
import base64, os, shutil, struct, subprocess, tempfile, zlib
FF = ["-hide_banner", "-loglevel", "error", "-y"]
@@ -199,7 +199,10 @@ def generate(ctx):
ff(["-i", os.path.join(tmp, "odd.ogv"), "-c", "copy", mkv])
ctx.emit("theora_mkv", {"file": b64(open(mkv, "rb").read()), "frames": framecrc(mkv, "yuv420p"),
"width": 174, "height": 98})
# the bench stream
bench = os.path.join(tmp, "bench.ogv")
ff(src("testsrc2", 320, 240, 25, 2) + ["-c:v", "libtheora", "-b:v", "600k", "-g", "25", bench])
ctx.emit("theora_bench", {"file": b64(open(bench, "rb").read()), "width": 320, "height": 240})
# the bench streams: an easy clip (testsrc2, mostly static) and a hard one (a mandelbrot zoom: every block moves)
bench = []
for kind, rate in (("testsrc2", "600k"), ("mandelbrot", "1200k")):
path = os.path.join(tmp, "bench_" + kind + ".ogv")
ff(src(kind, 320, 240, 25, 2) + ["-c:v", "libtheora", "-b:v", rate, "-g", "25", path])
bench.append({"name": kind, "file": b64(open(path, "rb").read()), "width": 320, "height": 240})
ctx.emit("theora_bench", bench)