Commit Graph
188 Commits
Author SHA1 Message Date
4DBug c65a66695f merge ws/video2 2026-10-31 15:31:56 -05:00
4DBug 9694c652ec merge ws/video2-legacy (FLIC, Cinepak, MSV1, QT RLE / SMC, Smacker; video/fli, video/smk) 2026-10-31 15:23:13 -05:00
4DBug 77479b6a2f merge ws/video2-theora (Theora codec, ogv) 2026-10-31 15:22:40 -05:00
4DBug 74c3b63615 merge ws/voxel 2026-10-31 15:08:58 -05:00
4DBug 9fe5f8d658 ws-roblox: docs/guide/roblox.md (tested snippets: places, building trees, meshes) + docs_roblox inputs; F.Rbx (codecs/model/Rbx) exported by the api; bench lines (rbxm / rbxmx / robloxmesh); STYLE.md codec list gains Lz4 and Rbx 2026-10-31 15:06:55 -05:00
4DBug 2be536bd98 ws-voxel: docs/guide/voxel.md (NBT / SNBT, schematics, regions, Qubicle; tested snippets) + inputs generator; bench lines for NBT, SNBT, packed arrays, schem, qb 2026-10-31 14:56:33 -05:00
4DBug 36770d7a8b ws-video2: docs/guide/video.md MPEG-2 section (tested snippet, tsBytes clip), formats table; docs/video.md layers 2026-10-31 14:53:04 -05:00
4DBug f86e12f051 ws-voxel: model/qb (Qubicle Binary read + write: RGBA / BGRA, z orientation, RLE, visibility masks; exact colours in Voxels.colors) 2026-10-31 14:52:15 -05:00
4DBug d22c72c1bc ws-video2: MPEG-2 field-picture / concealment-vector fixtures (a syntax-level writer in tools/fixtures/mpeg2.py), bit-exact; LuaJIT-friendlier hot paths; mpeg2 bench line 2026-10-31 14:50:27 -05:00
4DBug 286d193f14 ws-voxel: model/mca (Anvil regions read-only: gzip / zlib / LZ4Block / stored / external .mcc chunks; 1.18+, 1.13-1.17 and pre-1.13 chunk layouts) into Voxels with exact block states; block entity shapes moved into codecs/model/Minecraft 2026-10-31 14:47:05 -05:00
4DBug 3e33639272 docs: legacy video (guide section, formats table rows, docs/video.md layers row); docs_legacy inputs 2026-10-31 14:43:48 -05:00
4DBug 1013925a85 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.
2026-10-31 14:43:22 -05:00
4DBug d99b026b07 legacy video: bench lines (320x240 / 320x200 fixtures), Smacker frame decoder through 10-bit lookup tables 2026-10-31 14:41:29 -05:00
4DBug 09354cbd12 merge ws/roblox (codecs/compress/Lz4 for Anvil LZ4 chunks); registry regenerated 2026-10-31 14:38:23 -05:00
4DBug fea56f4391 ws-voxel: model/schematic (.schem v1-3, .schematic, .litematic read + write), codecs/model/Minecraft (block states, default colours, legacy ids, packed arrays)
Types change (backward compatible): Types.Voxels gains optional blocks (VoxelBlocks: exact block states as
u16 indices into a state palette, block entities, entities) and colors (exact u32 RGBA per cell).
2026-10-31 14:37:43 -05:00
4DBug bf639260e4 video/smk: Smacker (SMK2 / SMK4) with its video codec and audio
containers into containers/Demux (palette updates ride on each video packet as packet.palette); the Smacker video
codec (header Huffman trees with the escape cache, MONO / FULL (+ SMK4 doubled modes) / SKIP / FILL blocks) lives in
codecs/video/Legacy/Smacker and registers as 'smackvid'; Smacker's packed DPCM-Huffman audio (8 / 16-bit, mono /
stereo) and raw PCM tracks decode in video/smk/Audio, the Decoder built by the format over codecs/audio/Stream
(Smk.openAudio; open() installs it as the openAudio hook). Fixtures encoded by tools/fixtures/smk.py: video and
audio bit-exact with ffmpeg.
2026-10-31 14:37:39 -05:00
4DBug 3a1965486f ws-roblox: model/robloxmesh (.mesh 1.00-5.00, 6.00/7.00 chunked with raw COREMESH read; Draco COREMESH UNSUPPORTED; 2.00 / 4.00 write with skinning subsets and LODs) mapped to Scene; rbxm / rbxmx variant() for F.detect (rbxl / rbxlx); api tests 2026-10-31 14:33:15 -05:00
4DBug 5585ce53ce ws-video2: MPEG-1 tests bit-exact against ffmpeg -idct int (308 of 312 frames; 4 with concealed macroblocks) 2026-10-31 14:30:45 -05:00
4DBug 3146ec0936 merge master (ws/apifix) into ws/video2 2026-10-31 14:26:00 -05:00
4DBug 29c8bd1a11 ws-video2: codecs/video/Mpeg2 (MPEG-1/2 core, Main profile, 4:2:2, field pictures, dual prime), bit-exact with ffmpeg -idct int
Mpeg1 is now the Mpeg2 module under its old name (core, tables and VLCs moved to Mpeg2/). Dsp.mc takes separate
source / destination strides; Dsp.edge emulates edges. containers/MpegEs: field-picture pairs are one access unit
(pictureStructure). Registry: mpeg1 and mpeg2 decode through Mpeg2.newVideoDecoder; more MPEG-2 FourCCs.
2026-10-31 14:25:51 -05:00
4DBug b5964d4afc merge master 2026-10-31 14:25:41 -05:00
4DBug 58d7e08397 ws-voxel: wip: codecs/model/Minecraft, model/schematic, Types.Voxels blocks / colors 2026-10-31 14:25:41 -05:00
4DBug bd696dea1e merge master (ws/apifix) into ws/roblox 2026-10-31 14:25:18 -05:00
4DBug a1d2e7218c video/fli: FLI / FLC / FLX animations (read)
Header (FLI 1/70 s, FLC ms, depths 8 / 15 / 16 / 24), frame chunks into containers/Demux, open() through the
registry's flic decoder (codecs/video/Legacy/Flic); the ring frame is dropped unless opts.ringFrame. Fixtures
encoded by tools/fixtures/fli.py (every chunk type) with ffmpeg's decode as the reference: bit-exact.
2026-10-31 14:24:29 -05:00
4DBug 4dcb005180 ws-video2-theora: video/ogv, Ogg video (Theora + Vorbis / Opus / FLAC)
Demuxes every logical stream of the first Ogg group into containers/Demux:
Theora (frame times from granules, Xiph-laced headers as track.config, comment
tags in meta.tags), Vorbis / Opus / FLAC audio (headers in track.config) for the
api's openAudio hook; open = Video.open. Sniff claims only Ogg files with a Theora
BOS page. encode remuxes Theora (+ Vorbis / Opus pages from AudioWrap, interleaved
by time). codecs/video/Theora gains info / comment helpers.
2026-10-31 14:22:39 -05:00
4DBug 8e3873c9fb codecs/video/Legacy: Cinepak, Microsoft Video 1, QuickTime RLE / SMC and FLIC decoders
Registry decoders (codecs/video/Video BUILTIN: cvid, CRAM / MSVC / WHAM, 'rle ', 'smc ', AFLC), rgba8 pictures
painted over the previous picture, palettes from track.palette (or packet.palette). Bit-exact with ffmpeg on
28 AVI / MOV / MKV fixtures (tools/fixtures/legacy.py: ffmpeg's encoders plus encoders in _legacy_mux.py for
QuickTime RLE 1/2/4/8-bit, 8-bit MS Video 1 and Cinepak). Also fixes QtPalette's big-endian reads.
2026-10-31 14:20:17 -05:00
4DBug ea9c0b36df ws-roblox: codecs/model/Rbx (RbxTree, typed values, CFrame rotation ids, binary property columns), model/rbxm (binary rbxm / rbxl read + write; LZ4 / Zstd / raw chunks; unknown chunks and property types round trip raw), model/rbxmx (XML rbxmx / rbxlx read + write); tests vs rojo 7.7 + lune 0.11 both ways
init.luau: KIND_CATEGORY gains rbxtree = model (F.save of an RbxTree finds the model category).
2026-10-31 14:19:46 -05:00
4DBug 8183f4d2d7 ws-video2-theora: codecs/video/Theora, a Theora decoder (port of libtheora 1.2.0, BSD)
Headers (identification, comment via VorbisComment, setup: loop-filter limits,
quant ranges -> dequant tables, the 80 Huffman trees as collapsed lookup tables),
intra / inter frames, coded SB / block flags, MB modes (8 alphabets), MVs (VLC /
CLC, last / prior, 4MV with per-format chroma averages, half / quarter-pel),
block qi, DCT tokens with EOB runs, DC prediction, the spec IDCT, loop filter,
golden / previous refs, 4:2:0 / 4:2:2 / 4:4:4, picture-region crop, empty-packet
dupes. Bit-exact with ffmpeg on every frame of 12 fixtures (tests/codecs/theora).

Outside the folder: codecs/video/Video BUILTIN entry theora gets a decoder
(track.config = Xiph-laced headers, as Matroska's CodecPrivate);
licenses/libtheora-BSD.txt + NOTICE row.
2026-10-31 14:16:35 -05:00
4DBug 5bbb4227c2 ws-apifix: API.md / STYLE.md / README: music as audio, video as animated image, F.save extra files, variant(r), caps.extraFiles, F.music builder, bitrate in bit/s; type baseline 92 2026-10-31 14:14:11 -05:00
4DBug 998177e5ab ws-voxel: codecs/text/Nbt (NBT Java / Bedrock / network varint, SNBT parse + print, typed values), data/nbt, data/snbt
Shared change: codecs/compress/Deflate gains Deflate.peek(buf, off, len, n) (the first n inflated bytes of a
gzip / zlib / raw stream, for sniffing gzip-wrapped NBT) through a backward-compatible prefix flag on
Inflate.raw; gunzip's header parsing moved into a local helper both use.
2026-10-31 14:12:46 -05:00
4DBug 1ed25296ba ws-roblox: codecs/compress/Lz4 (LZ4 block decode + encode, decodeInto with history for linked blocks), tests vs python-lz4 both ways, bench line 2026-10-31 13:53:23 -05:00
4DBug fca79bd858 ws-docs: guide pages cad, font, layered, music, playlist, subtitles, tilemap, video; runnable examples per category; README converting note 2026-10-31 13:25:10 -05:00
4DBug 0552f0ebf8 ws-docs: guide pages archive, audio, data, image, scene, vector; recipes (first part); docs input generators 2026-10-31 13:16:12 -05:00
4DBug cdcbd76b9e ws-docs: tools/docs_check.py (guide snippets and examples become tests under both runtimes), docs inputs generator 2026-10-31 13:05:43 -05:00
4DBug 51b08575c4 ws-cleanup: codecs/ grouped by domain; containers/Chunks, codecs/audio/Stream, codecs/image/Pixels, codecs/model/Mat4
C2, the hierarchy (tools/move.py, every reference rewritten mechanically):
- codecs/compress: Deflate Lzma Zstd Brotli Bzip2 Lzw; codecs/entropy: Huffman (from core) RangeCoder;
  codecs/image: Jpeg Dct Vp8 Vp8L Yuv Quantize Raster Blend Pixels; codecs/audio: Mdct Aac Alac Pcm Resample
  VorbisComment Tracker SoundFont Stream; codecs/video: H264 Mpeg1 Video; codecs/text: Json Xml Text Url;
  codecs/font: TrueType Cff; codecs/model: MeshFlatten Mat4. containers/ stays flat; core/ keeps Bytes Bits Err
  Crc32 Adler32 Base64 Md5 Input Sniff.
- LAYERS lint: codecs must sit in a domain folder; gen_registry lists codecs by domain (docs/FORMATS.md).
- Checked: build.py both targets, rojo build of build/roblox, the full suite on both runtimes.

C3, generic code out of format folders:
- containers/Chunks (new): the chunked-file walker (RIFF / RIFX / IFF / PNG / CAF layouts: endianness, size first,
  trailer, padding, lenient missing pad, open-ended ids, size hooks). containers/Riff walks with it (RF64 ds64
  through the resize hook); image/png, audio/aiff and audio/caf list their chunk handlers over it.
- codecs/audio/Stream (new): Stream.packets, the packet-decoder Decoder (read / seek with pre-roll / position,
  priming and end trimming) that aac, caf and m4a each carried (~70 lines each).
- codecs/image/Pixels: image/bmp/Pixels promoted (+ rgb555); image/ico's DIB decoder uses its row loops instead of
  its own (the AND mask / alpha rule stay ICO's).
- codecs/model/Mat4 (new): matrices / quaternions / TRS shared by FBX (Xform keeps only the FBX transform model),
  Collada (Math keeps only <lookat> / <skew>) and USD (its matrix helpers and general 4x4 inverse); Mat4.mul is
  Types.Scene.mul. The Collada normal matrix is now the inverse transpose (it was the inverse; same result for the
  fixtures' bind shapes).
- README rewritten (install for Rojo and LÖVE / LuaJIT, quick start per category, F.* and F.ops, host notes:
  FORMATS_NO_JIT_TUNE, paths, layout); docs/STYLE.md: the codec domains, "what belongs in a format folder" with the
  shared building blocks and the DUP rule, conventions (WAVE order, lower-case tags, loops, the api hooks
  decodeImage / encodeImage / openAudio / plugins / resolve, the codecs/video/Video registry), Err.from, the type
  baseline. New tests: tests/containers/chunks, tests/codecs/mat4. Type baseline 93.
2026-10-31 12:25:03 -05:00
4DBug 763f4a7c04 ws-cleanup: shared plumbing: Err.from, core/Sniff, Pcm.drain, Bits.msbPut; DUP lint; tools/move.py
- core/Err.from(message, offset?, kind?): the private-submodule -> Err plumbing (a kind, or a 'code: ' prefix /
  'truncated' / 'past the end' in the message) that Brotli, Bzip2, Zstd, Jpeg, WOFF2, FBX, plist, msgpack and
  bmfont each wrote.
- core/Sniff (new): Sniff.text(r, n, trim?) (the start of a text file without its BOM), Sniff.dropBom(s),
  Sniff.magic(r, s); 13 text formats' sniff / decode BOM handling goes through it.
- codecs/Pcm.drain(dec, source?, maxFrames?): a format's decode() through its open(); the collect-the-Decoder
  loops of aac, aiff, au, caf, flac, m4a, mp3, opus, vorbis and wav are one call each.
- core/Bits.msbPut: the MSB-first bit writer the MP3 / MP2 / FLAC encoders each copied.
- tools/lint_rules.py DUP: a function body of 12+ code lines repeated token for token in another module fails.
- tools/move.py: moves a module and rewrites every reference (requires, deps, headers, fixture INPUTS, docs).
- tools/fixtures/zstd.py: the incompressible corpus is smaller (zstd.luau 15.1 -> 13.4 MB; every fixture module is
  now under 14.3 MB).
- tools/bench.luau: MPEG-1 also runs with the api's LuaJIT trace limits; the sections that compare tuned / default
  limits set them explicitly (jitTune), so the order of sections no longer leaks the tuning.
2026-10-31 12:00:59 -05:00
4DBug 3243404374 ws-cleanup: type diagnostics 1109 -> 94 unique; lint gate against tools/lint_types_baseline.txt
ws/cleanup-types (merged before) annotated Types, init, core, codecs, containers, ops, host and the formats;
this commit fixes the rest in the modules ws-cleanup added (AudioOps, Resample, Vorbis / FLAC / Opus encoders).
tools/lint.sh now counts unique diagnostics (the analyzer printed every required src module twice: master's
'2499' was 1109 unique) and fails when the count rises above tools/lint_types_baseline.txt (94);
LINT_TYPES_UPDATE=1 lowers it.
2026-10-31 11:30:29 -05:00
4DBug 6b26845afe ws-cleanup: merge master (ws/h264) 2026-10-31 11:12:11 -05:00
4DBug c0eafd29a5 ws-cleanup: consistency (lower-case tags, WAVE channel order, loops = play count, Err messages, caps)
- Audio tags keys are lower case everywhere (Types.Tags): FLAC no longer returns TITLE / ARTIST (the raw fields stay
  in meta.source.comments; also for Vorbis and Opus); Vorbis / Opus / FLAC read and write tags through
  codecs/VorbisComment (TRACKNUMBER -> track, DISCNUMBER -> disc, DESCRIPTION -> comment); MP3 albumArtist ->
  albumartist and year -> date (ID3 TYER / TDRC, ID3v1); RIFF INFO / CAF / MP4 freeform names are lower-cased (MP4
  writes iTunSMPB / iTunNORM back in their usual spelling; m4a reads tags.itunsmpb).
- Channel order: Vorbis (and Opus mapping family 1) decode to WAVE order like FLAC / WAV / AAC (both used to return
  the Vorbis order); the Vorbis encoder takes WAVE order and writes Vorbis order. Pcm.WAVE_FROM_VORBIS / Pcm.reorder;
  Vorbis.packetDecoder gives pd.order. Tests reorder oggdec's / opusdec's raw (Vorbis-order) references.
- img.loops is the play count in GIF, APNG and WebP (they already agreed; Types / WebP docs said "loop count");
  tests/api round-trips loops 0 / 1 / 3 through all three.
- Err: messages without the format name (png / midi encoders said "png encode: ..."); codecs/Bzip2 and codecs/Zstd
  check arguments through Bytes.span.
- caps: mp3 encodeLayers = { 2, 3 }, opus encodeChannels = 2.
2026-10-31 11:01:22 -05:00
4DBug 7271e6e3fa ws-h264: F.video.open end to end on MP4 / MKV / TS / AVI / raw H.264 (bit-exact vs ffmpeg), display-order pts from the sorted packet times; JVT conformance test (48 streams bit-exact vs JM yuv, 4 refused); video/mp4 writer: a video edit list plays every frame (the B-frame delay no longer cut 2 frames off the end); tests tune LuaJIT through host 2026-10-31 10:53:34 -05:00
4DBug 4f2ceec735 ws-cleanup: one base64 (core/Base64)
core/Base64 takes over codecs/Base64's API (encode(buf | string, { url, pad, wrap }, offset, length), decode of both
alphabets, decodeDataUri, dataUri) plus line wrapping (opts.wrap) for plist; codecs/Base64 is removed and glTF /
DAE require core/Base64. The private copies in data/plist (Base64.luau), data/yaml (Parse / Emit) and codecs/Brotli
(the static tables) are gone. tests/codecs/base64 merged into tests/core/base64.
2026-10-31 10:50:40 -05:00
4DBug 84101d919e ws-h264: merge master 2026-10-31 10:29:56 -05:00
4DBug d4486dccce ws-h264: merge ws/video; codecs/Video registers h264 (avc1/avc3/H264/... FourCCs, V_MPEG4/ISO/AVC) via H264.newVideoDecoder; video/h264 raw Annex B format (demux by access unit, copy-writer from MP4/MKV samples); MMCO 5 resets frame_num (JVT MR2/MR4/MR5); meta.yuv from the VUI 2026-10-31 10:29:56 -05:00
4DBug 2eaed46eea merge ws/video: containers mkv/avi/mp4/ts/ps/y4m (+writers), codecs Jpeg/Mpeg1/Vp8 inter/Video registry, AudioWrap, F.video.open 2026-10-31 10:22:17 -05:00
4DBug f00b838205 ws-video: bench.luau merge fix 2026-10-31 10:11:34 -05:00
4DBug 51eec67789 ws-video: merge ws/video-vp8 (final); F.open wraps images as videos only for category video (F.video.open); F.video.fromFrames for image sequences 2026-10-31 10:11:01 -05:00
4DBug 0c7b316998 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 2026-10-31 10:08:08 -05:00
4DBug 6fcf717214 ws-h264: tests (bit-exact vs ffmpeg, AVCC, NAL-at-a-time, unsupported, fuzz), bench lines; LuaJIT speedups (no table-allocating if-expressions, arithmetic bit reads, branch-free CABAC decisions, split MC filters) 2026-10-31 10:07:39 -05:00
4DBug b0b47007dc ws-video: merge ws/video-vp8 (VP8 inter frames) 2026-10-31 10:05:56 -05:00
4DBug 3dd0b59784 ws-video: bench block (whole pipeline fps for MJPEG AVI / MPEG-1 TS / VP8 WebM / Y4M at 320x240 and 640x480, y4m -> MJPEG AVI), docs/video.md (API, layers, how a codec plugs into the registry), NOTICE row for mpegts-luau 2026-10-31 10:05:09 -05:00