Commit Graph
50 Commits
Author SHA1 Message Date
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 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 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 44a599f00c ws-cleanup: codecs/compress/PackBits; UTF-16 and half floats from one place
- codecs/compress/PackBits (new, from image/tiff/Pixels): decode (lenient count + a clean flag for strict callers)
  and encode; image/tiff and layered/psd (which carried its own decoder) use it. tests/codecs/packbits.
- codecs/text/Text.utf16(buf, offset, length, bigEndian?): the UTF-16 -> UTF-8 conversion codecs/font/TrueType,
  archive/7z and layered/psd each wrote (lone surrogates -> U+FFFD everywhere now).
- image/tiff/Pixels and data/cbor use core/Bytes.half instead of their own float16 decoders.
2026-10-31 12:28:33 -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 6b26845afe ws-cleanup: merge master (ws/h264) 2026-10-31 11:12:11 -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 7169f2cc2c ws-cleanup: codecs/Resample, codecs/RangeCoder; Opus / MP3 / MP2 encoders resample through it
- codecs/Resample (new): Kaiser-windowed sinc resampler, polyphase (exact phases when to / gcd <= 4096, else 4096
  interpolated phases), quality low / medium / high (8 / 16 / 32 zero crossings), streaming (new / process / flush),
  whole buffer (Resample.buffer) and a codecs/Pcm source wrapper (Resample.source). tests/codecs/resample: SNR
  87 dB (44.1 -> 48 kHz, medium) .. 108 dB (high), alias rejection, streamed = whole, identity.
- audio/opus/Encode: input through codecs/Pcm (Pcm.source + collect) and codecs/Resample instead of its private
  resampler and Decoder loop; tags through codecs/VorbisComment.
- audio/mp3 encode: rates the layer cannot hold are resampled to the next rate up (opts.sampleRate picks one,
  opts.resampleQuality); was Err.ARG "no resampling".
- codecs/RangeCoder/{Decoder,Encoder}: the RFC 6716 range coder moved out of audio/opus (same code, no speed change).
- audio/opus/Mdct stays private: routing CELT through codecs/Mdct measured 2-3x slower CELT decoding and different
  output bits (documented in its header).
- (this commit also carries the Opus side of the tags / channel order consistency: codecs/VorbisComment for OpusTags,
  meta.source.comments, mapping family 1 decoded to WAVE channel order with Pcm.reorder / Pcm.WAVE_FROM_VORBIS.)
2026-10-31 10:50:56 -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 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 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 ba996820b5 ws-video: merge ws/video-codecs (codecs/Jpeg, codecs/Mpeg1) 2026-10-31 09:53:26 -05:00
4DBug 110061960a ws-video-vp8: VP8 inter frames (libvpx 1.17 port): references, modes / motion vectors, split, six-tap / bilinear prediction, inter loop filter levels, hidden frames, reset; tests vs ffmpeg on 27 test vectors + 24 libvpx clips 2026-10-31 09:46:45 -05:00
4DBug 6e3a044556 ws-video-codecs: mjpeg fixtures as base64 / zlib (8.6 -> 1.0 MB); codecs/Jpeg: no type assertion as an assignment target (darklua) 2026-10-31 09:42:30 -05:00
4DBug 4d71539740 ws-video-codecs: codecs/Mpeg1 absorbed from mpeg1-luau e2e2898 (jsmpeg port, MIT: licenses/jsmpeg-MIT.txt + NOTICE); requires and headers, frameImage (yuv420p / rgba8 copies); IDCT kept (bit-identical to codecs/Dct islow in put mode, but MPEG adds residuals before clamping); tests/codecs/mpeg1.luau + tools/fixtures/mpeg1.py (base64 / zlib fixtures, 5.6 MB) 2026-10-31 09:41:27 -05:00
4DBug c0e8a89050 ws-video-codecs: codecs/Jpeg: 4:2:2 / 4:4:4 as ffmpeg writes them (2x2/1x2, 1x2) for yuv output; tests/codecs/jpeg.luau + tools/fixtures/mjpeg.py (ffmpeg mjpeg frames bit-exact vs TurboJPEG planes / djpeg, PSNR vs ffmpeg, stripped DHT, AVI1, fields, yuv420p encode byte-identical with tj3CompressFromYUV8) 2026-10-31 09:35:34 -05:00
4DBug e1ffb21494 merge ws/m4a 2026-10-31 09:23:57 -05:00
4DBug 646d18f056 merge ws/webp 2026-10-31 09:12:40 -05:00
4DBug d19c949e95 ws-webp: merge ws/absorb (containers/Riff); image/webp reads and writes its chunks through containers/Riff (private chunk reader removed); bench lines merged; registry regenerated 2026-10-31 09:08:44 -05:00
4DBug 381510c3c5 merge ws/3d: obj stl ply off vox gltf/glb, ops/MeshOps, codecs Base64/MeshFlatten, api sibling files + texture encoding 2026-10-31 09:08:22 -05:00
4DBug 29a95ce24f ws-m4a: merge ws/absorb (audio/opus, containers/Ogg, ...) for the CELT encoder; m4a fixtures load their helper by path (tools/fixtures/ on sys.path shadowed the xml package) 2026-10-31 09:07:22 -05:00
4DBug 83d43f6c6d ws-m4a: codecs/Aac (AAC-LC decoder: ASC / PCE / ADTS, all tools, SBR/PS extension hook), codecs/Alac (decoder + encoder), audio/m4a (AAC + ALAC read, ALAC write, tags, gapless, seek), audio/aac (ADTS), audio/caf (lpcm/alac/aac/ulaw/alaw read, lpcm/alac write); fixtures checked by ffmpeg / fdkaac / MP4Box 2026-10-31 09:03:04 -05:00
4DBug ca262e19df merge ws/imgA: jpeg gif tiff tga qoi pnm ico hdr, codecs Dct/Lzw/Quantize, ops/ImageOps, api image hooks 2026-10-31 09:00:39 -05:00
4DBug b51f5be542 merge ws/absorb: bmp wav mp3 flac opus zip playlists (+APNG, writers), containers Ogg/Riff/Zip, codecs Url/Text 2026-10-31 09:00:09 -05:00
4DBug e8d2ba81c2 merge ws/data: codecs Json/Xml, data json xml csv ini toml yaml msgpack cbor plist 2026-10-31 08:59:44 -05:00
4DBug 5977b60df6 ws-webp: codec tests (vp8, vp8l), bench lines, type fixes 2026-10-31 08:58:17 -05:00
4DBug 905109cb64 absorb: merge ws/data 907f365 (codecs/Json, codecs/Xml) for playlist/xspf 2026-10-31 08:56:03 -05:00
4DBug 28590c51c3 absorb: playlist/m3u (M3U/M3U8 + HLS) and playlist/pls from playlist-luau 3fc7fd3, + a PLS writer; shared codecs/Url (RFC 3986, locate) and codecs/Text (BOM, CP1252, lines); tests vs urllib.parse.urljoin, Python cp1252, Python-written playlists
Two shared codecs added outside the assigned folders (a format never requires another format): codecs/Url and codecs/Text, used by the three playlist formats.
2026-10-31 08:55:44 -05:00
4DBug fb909438a5 ws-3d: codecs/Base64 (RFC 4648 standard + url, padding optional, whitespace-tolerant decode, data: URIs); shared: glTF data URIs now, YAML !!binary / Brotli's dictionary / SVG could use it instead of private copies 2026-10-31 08:47:36 -05:00
4DBug dc974d8fae imgA: merge ws/imgA-gif (image/gif + codecs/Quantize) 2026-10-31 08:44:55 -05:00
4DBug 58b6671183 imgA: image/jpeg (absorbed jpeg-luau decoder + arithmetic coding, meta, EXIF orientation, encoder byte-identical to cjpeg) and codecs/Dct
- codecs/Dct: jpeg-luau's islow / reduced IDCTs + a forward islow DCT with jcdctmgr.c's quantiser; tests/codecs/dct.luau
- image/jpeg: Decode (marker parser, absorbed + reader ranges, SOF9/SOF10 + DAC, EXIF / ICC / COM / JFIF density),
  Scan + Color (absorbed), Arith (jdarith.c port), Encode (baseline / optimised / progressive, 444/422/420, restarts,
  APP1/APP2/COM from meta), Tables (annex K)
- tests: 115 cjpeg/jpegtran/Pillow files, 444 decodes bit-exact with djpeg at 1, 1/2, 1/4, 1/8 (104 arithmetic),
  38 encodes byte-identical to cjpeg (so djpeg decodes them), orientation, meta, truncation, fuzz
- licenses: libjpeg-turbo LICENSE + README.ijg, NOTICE rows
- tools/bench.luau: jpeg block; tools/bench.sh runs every fixture generator (bench blocks read their outputs)
2026-10-31 08:44:15 -05:00
4DBug a1edea0e44 data: codecs/Xml (XML 1.0 DOM + pull events + serializer: UTF-8/16/Latin-1, entities incl. internal DOCTYPE with expansion limit, CDATA, comments, PIs, namespaces as qualified names + node.ns / clark, xml:space); ElementTree + expat fixtures; bench lines 2026-10-31 08:38:55 -05:00
4DBug f6ce1da736 ws-arch: merge ws/arch-lzma 2026-10-31 08:38:55 -05:00
4DBug 9fadc7155f ws-arch: merge ws/arch-zstd 2026-10-31 08:37:32 -05:00
4DBug 63a2e33387 ws-arch: merge ws/arch-brotli 2026-10-31 08:37:32 -05:00
4DBug a507a52bda imgA-gif: faster median cut (cached box scores, keyed sort) and nearest-colour search (green-sorted, pruned); gif + quantize bench block 2026-10-31 08:37:09 -05:00
4DBug 45cc667083 ws-arch: codecs/Zstd (RFC 8878 decoder from the spec: frames, skippable frames, raw/RLE/compressed blocks, Huffman literals, FSE tables, repeat offsets, XXH64 checksum on 32-bit halves) + archive/zst (single-stream archive); tests against the zstd CLI on both runtimes 2026-10-31 08:36:24 -05:00
4DBug 0bfd70e1ca ws-arch: codecs/Brotli (RFC 7932 decoder: all meta-block kinds, context modes/maps, static dictionary + 121 transforms, large windows) and archive/br (single-stream archive); tools/brotli_static.py generates codecs/Brotli/Static from the brotli sources (MIT, licenses/brotli-LICENSE.txt); fixtures via python brotli + CLI 2026-10-31 08:36:16 -05:00
4DBug 603689bc14 imgA-gif: image/gif (read + write, animation, transparency, loops, comments) and codecs/Quantize (median cut, octree, Floyd-Steinberg); ImageMagick / Pillow fixtures 2026-10-31 08:34:32 -05:00
4DBug b306a3bf5e ws-arch: codecs/Lzma: LZMA / LZMA2 decoders, .lzma (alone), the xz container (checks none / CRC-32 / CRC-64, BCJ x86 / PPC / ARM / ARMT / SPARC / ARM64 + delta filters, multi-block / multi-stream); tests against liblzma 2026-10-31 08:32:11 -05:00
4DBug ace198690f Merge branch 'ws/arch-bzip2' into ws/arch 2026-10-31 08:30:49 -05:00
4DBug 17106c2eb1 ws-arch: codecs/Raster: antialiased signed-area scanline rasterizer (lines, quads, cubics, affine transforms, nonzero + even-odd, clip, masks, fill with colour or paint function, polygon stroker with caps/joins); tests vs a supersampled winding reference 2026-10-31 08:30:45 -05:00
4DBug 19110e6199 data: codecs/Json (RFC 8259 parse / serialize: ordered keys, Types.null, bigInts as strings, pretty / ascii, events pull tokenizer, decodeAt / lines, streaming writer); JSONTestSuite + Python json fixtures; bench lines
Types (backward compatible additions in the Data section): Types.object / isObject / set / keys (ordered objects
and empty-object marking, shared by every data format), Types.Date (RFC 3339 typed dates for TOML / plist / CBOR /
msgpack: new / is / valid / parse / toUnix / fromUnix), XmlNode gains optional text / target / ns fields.
tools/bench.sh: also generates the json fixtures.
2026-10-31 08:30:05 -05:00
4DBug b7018b6bfb ws-arch: codecs/Bzip2 (bzip2 decompressor: Huffman groups, MTF/RUNA/RUNB, inverse BWT, RLE1, block + stream CRCs, concatenated streams) + archive/bz2 (single-stream archive); tests vs Python bz2 (libbzip2) on both runtimes 2026-10-31 08:27:55 -05:00
4DBug ba91879bc5 imgA: codecs/Lzw (GIF LSB + TIFF MSB early-change, old-style TIFF LZW) with Pillow / libtiff fixtures; api passes opts.decodeImage / encodeImage hooks to formats (embedded PNG in ICO, JPEG in TIFF)
Change outside the ws folders: src/Formats/init.luau gains withHooks(): F.load / F.save hand decoders / encoders
opts.decodeImage(buf) and opts.encodeImage(img, format) unless the caller passed its own, so a format can decode an
embedded image of another format without requiring it (LAYERS). Backward compatible: formats ignore unknown opts.
2026-10-31 08:25:55 -05:00
4DBug dcdf837753 ws-m4a: codecs/Mdct (MDCT / IMDCT / DCT-IV for any N divisible by 4 over a mixed-radix FFT; sine / KBD / Vorbis windows), shared with the Vorbis / Opus encoders 2026-10-31 08:25:18 -05:00
4DBug cdcb5b0b77 formats-luau foundation: build (darklua + token passes) for Roblox and LuaJIT, compat prelude, core, Types, host adapters, API + registry, lint, tests on both runtimes; absorb deflate (codecs/Deflate + new compressor) and png (image/png + new encoder) 2026-10-31 08:18:01 -05:00