codecs/compress/Deflate: Inflate.raw takes an optional sink (output window: 32 KB history + a chunk) and feed (input
window over split ranges); Deflate.zlibStream(buf, ranges, sink, window?). The existing entry points are unchanged
(bench: no regression under luau -O2 or LuaJIT).
tools/gen_registry.py now also writes src/Rosetta/Sniffs.luau: each format's sniff copied
(tools/sniff_extract.py) with the top-level locals, types and load-time loops it reaches;
requires outside core/ become proxies that require on first field access. 198 of 199
sniffs are copied (model/fbx reads Binary.MAGIC at load time: its module sniffs).
Registry entries gain sniff (0 copy, 1 copy reaching a codec / container, 2 module) and
variant (the module has variant(r)).
init.luau detect: the extension's formats first, then by sniff cost and registry order;
a sniff runs only while its cap (1, or LATE) could still win, ties to registry order, so
results equal the eager path. F.detect loads the winner only when it has variant().
tests/detect.luau: every copied sniff against its module's on samples of every fixture
module (tools/fixtures/detect.py), scores within 0..1, and F.detect against the eager
reference with no name, the right / wrong / unknown extension and per category.
Outside init / Registry / gen_registry: tools/fixtures.py (LAST generators run after
the others and rerun when their outputs change), tools/lint_rules.py (Sniffs is api
layer, skipped by DUP), docs/STYLE.md and docs/API.md notes, build/ regenerated.
- codecs/video/Video/Pool: Images a decoder made, handed back and reused (only its own; fresh meta)
- H264 / Vp8 / Mpeg2 output Images come from a Pool; H264 / Vp8 decoder:release, VideoCodecDecoder.release
- Video.open: opts.reuse recycles the previous frame's Image at the next nextFrame; v:release(frame); the yuv Image
under an rgba / scaled frame (never seen by the caller) goes back to the codec at once
- tests/video/control.luau: yield hook (identical frames, H.264 / VP8 / MPEG-1, conversions), disposable packets in
every container, skipDisposable bit-exact at the right index, reuse identical and recycled, fuzz
- docs/guide/video.md: Skipping and reusing frames; docs/API.md
- H264: picture and grid allocations split between yield calls (a 1080p picture's tables are 1.6 M slots)
- Vp8: Decode.decodeFrame hook three times per macroblock row and once per loop filter row; Options.yield
- Yuv.toRgba / Yuv.scale: optional hook every 16 rows; imageToRgba / imageScale take an out Image and the hook
- Video.open passes opts.yield to the conversions, the VP8 and MPEG-1/2 decoders
- codecs/video/Video/Disposable: H.264 nal_ref_idc 0 (avcC length-prefixed / Annex B), VP8 frames refreshing no
reference; containers/Demux sets packet.disposable for h264 / vp8 tracks; Video.isDisposable(track, packet)
- skipDisposable: H.264 keeps skipped pictures in output order (pts pool / POC bookkeeping), VP8 applies the header
state then skips; receive() returns false for a skipped picture, VideoFrame.index counts it
- Types: Packet.disposable, VideoCodecDecoder.receive may return false
- tools/fixtures/videoctl.py: VP8 two temporal layers (IVF + WebM)
- compat math.clamp is vararg: LuaJIT never starts a root trace at a vararg function but still inlines it. The plain
shim, called from interpreted code, collected aborted root traces until it was blacklisted, after which every trace
through it aborted: in one process, png (or anything earlier) left jpeg / webp / tiff / ImageOps 2-10x slower.
- Dct.fdctQuantize: branch-free quantiser and a divisor table (q * 8) from Jpeg.Encode; the sign branch among the column
pass's live values made LuaJIT retry side traces it could not compile (register coalescing) forever. Also faster
in luau -O2 (~5%) and native (~10%). Outputs unchanged.
- tools/bench_mixed.luau + bash tools/bench.sh mixed: core, audio, video, image in one LuaJIT process against the
per-codec benches, marking lines more than 1.3x slower mixed.
New shared modules under codecs/audio/Aac: Sbr (bitstream, band tables,
delta decoding), SbrBits, SbrQmf (32-band analysis / 64-band synthesis QMF
through DCT-IV), SbrHf (HF generation and adjustment), Ps (baseline PS),
SbrTables (ISO tables, from syom 0.8.1, MIT). Explicit signalling enables
SBR at construction; implicit SBR / PS is found by Decoder:probe /
Aac.probeFrames. audio/aac and audio/m4a report the output rate and take
opts.sbr = false for the core only; m4a scales iTunSMPB by the media tick.
Outside the folder: containers/AudioWrap writes an AAC-LC ADTS header for
HE-AAC AudioSpecificConfigs (the decoder finds SBR in the stream); the api's
default openAudio hook forwards opts.sbr.