Commit Graph
134 Commits
Author SHA1 Message Date
4DBug 703af4cc71 ws-audio2: merge ws/audio2-adpcm (codecs/audio/Adpcm, Qoa; adx, vag, brstm/bcstm/bfstm, raw adpcm, qoa; wav/aiff/caf/xm ADPCM) 2026-10-31 15:10:09 -05:00
4DBug 39da2f6648 ws-audio2: merge ws/audio2-lossy (Musepack SV7/SV8, AC-3, AudioWrap AC-3 hook) 2026-10-31 14:57:05 -05:00
4DBug 41b72d9b8a ws-audio2: audio/ac3 + codecs/audio/Ac3: AC-3 decoding from ATSC A/52, AC-3 tracks of MKV / MP4 / TS / AVI
Written from the A/52:2018 specification (tables transcribed from it; no liba52 / ffmpeg code): every acmod with LFE,
coupling + phase flags, rematrixing, block switching, delta bit allocation, dither, CRC check, dynamic range off by
default (drc = 0 .. 1). E-AC-3 and bsid 9 / 10 are UNSUPPORTED. 101.8 - 108.6 dB SNR vs ffmpeg's float decode
(liba52's for block-switched streams: the packaged ffmpeg mis-decodes the first short transform).

Outside the folders: containers/AudioWrap passes ac3 tracks to audio/ac3 (one branch); a comment in
src/Formats/init.luau mentions it. The fixture clears the encoders' dithflags (positions from the new
Ac3 decoder field dec.blocks) so reference and decoder decode the same numbers.
2026-10-31 14:45:23 -05:00
4DBug 71bb89763e merge master (ws/apifix) into ws/audio2-chip 2026-10-31 14:28:00 -05:00
4DBug a3e234cc0d ws-audio2: MUS, XMI, HMP / HMI (music/mus, music/xmi, music/hmp) -> Types.Midi through codecs/audio/MidiRender (merge, tempoBytes); event streams match wildmidi -x 2026-10-31 14:27:51 -05:00
4DBug 5e64334e85 Merge branch 'master' into ws/audio2-adpcm 2026-10-31 14:26:41 -05:00
4DBug 0ce8dd143f ws-audio2: regenerate the registry 2026-10-31 14:26:41 -05:00
4DBug 5b8f7cba39 ws-audio2: regenerate docs/FORMATS.md after merging master 2026-10-31 14:26:34 -05:00
4DBug f6349219d8 Merge branch 'master' into ws/audio2-lossy 2026-10-31 14:26:22 -05:00
4DBug 22615b503e ws-audio2: audio/mpc + codecs/audio/Musepack: Musepack SV7 / SV8 decoding (libmpcdec r475 port, BSD)
Gapless (synthesis delay, SV8 leading silence, SV7 last frame length), seeking (SV8 by packet with one packet of
pre-roll: exact; SV7 by frame with 32 frames of pre-roll like libmpcdec), APEv2 tags via codecs/audio/ApeTag (merged
from ws/audio2-lossless), ID3v2 skipped. Fixtures build mpcenc / mppenc / a float libmpcdec dumper from the pinned
upstream tarballs through nix; 132-140 dB SNR vs libmpcdec float, 82.7 dB vs ffmpeg's s16 decode.
2026-10-31 14:14:29 -05:00
4DBug 363b14932f ws-audio2: codecs/audio/Adpcm (IMA / ima4 / IMA WAV / MS / ADX / PS-ADPCM / DSP decode, IMA + MS encode, Decoder layouts) and audio/adpcm (raw streams)
- codecs/audio/Adpcm: decoder kernels bit-exact with ffmpeg (IMA, ima4, MS) and vgmstream (ADX, PS-ADPCM, DSP);
  IMA nibble / IMA WAV / MS block encoders. Adpcm/Decoder: streaming Decoders over the shared layouts (channel
  interleaved frames, nibble streams, self-contained blocks) with exact seeking through state snapshots.
- audio/wav: its IMA / MS block decoders moved to codecs/audio/Adpcm (wav tests unchanged and green).
- codecs/audio/Stream (shared, small and backward compatible): pcm() may return a buffer of f32 (copied with
  buffer.copy) instead of a table.
- audio/adpcm: headerless ima / ima_wav / ms / ima_qt / psx streams by options; encode ima / ima_wav / ms.
- licenses: vgmstream (ISC).
2026-10-31 14:10:23 -05:00
4DBug 848e4bfff6 ws-audio2: AHX and HVL (music/ahx, music/hvl) over codecs/audio/Hively, a port of hvl2wav's replay.c (BSD-3): bit-exact vs hvl2wav 2026-10-31 14:09:29 -05:00
4DBug 2f0ff81c95 ws-apifix: an outline font saved as BMFont writes its pages (opts.files; without a destination F.save returns them as a third value { [page file] = PNG bytes }; caps.extraFiles); pages named after the destination 2026-10-31 14:03:45 -05:00
4DBug 4dd6cd1400 ws-audio2: move music/midi/Render to codecs/audio/MidiRender (attach: summary + render method, shared by the MIDI variants); .kar lyrics -> meta.lyrics / karaoke / tags 2026-10-31 13:57:25 -05:00
4DBug 9941113b7b ws-cleanup: audio codecs out of the format folders (codecs/audio/Opus, Vorbis, Flac, Mpa)
The decoders / encoders are libraries, not the file format: audio/opus/{Celt, CeltTables, CeltEncoder, Mdct, Packet,
Silk, SilkTables, Decoder} -> codecs/audio/Opus; audio/vorbis/{Codebook, Packet, Setup, Tables} ->
codecs/audio/Vorbis; audio/flac/{Frame, Encode} -> codecs/audio/Flac; audio/mp3/{Core, Tables, Header, Encode2,
Encode3, EncTables, Analysis} -> codecs/audio/Mpa (tools/move.py; code unchanged). Each gets an index init.luau.
The format folders keep the file mapping: Ogg Opus / Ogg Vorbis (headers, granules, seeking, the Vorbis encoder's
Ogg writer), native / Ogg FLAC streams and metadata, ID3 / Xing / the MP3 frame index. docs: STYLE says a codec is
not the format. Full suite: 248 runs pass on both runtimes, lint green.
2026-10-31 12:47:02 -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 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 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 f2a4a33713 ws-video: video/mp4 (MP4 / MOV / 3GP on containers/IsoBmff: edit lists, fragments, dOps -> OpusHead, PCM entries, AAC priming as codec delay; writer: copied H.264 / HEVC / AV1 / MJPEG / AAC / ALAC / Opus / FLAC / MP3, MJPEG from frames, PCM in MOV, edit lists for B-frame / codec delays); IsoBmff Mux writes no empty DecoderSpecificInfo (ffmpeg refuses it); writer checks extended to MP4 / MOV / H.264 remux 2026-10-31 10:02:25 -05:00
4DBug 17c00a15df merge ws/3d2 2026-10-31 09:55:41 -05:00
4DBug ba996820b5 ws-video: merge ws/video-codecs (codecs/Jpeg, codecs/Mpeg1) 2026-10-31 09:53:26 -05:00
4DBug e044209ab1 ws-video: merge master (m4a, music, ...) 2026-10-31 09:50:42 -05:00
4DBug aa4963dc27 ws-video: video/mpegts (containers/MpegTs absorbed from mpegts-luau 6e16197, its unit queue fixed for LuaJIT; M2TS, resync before the first packet, private stream types by PES id), video/mpegps (containers/MpegPs: MPEG-1 / MPEG-2 packs, PSM, private stream 1; pictures cut from the joined ES, PTS from PES / GOP temporal references; raw .m1v), containers/MpegEs; tests vs ffprobe / ffmpeg 2026-10-31 09:50:42 -05:00
4DBug b275bdb498 Merge branch 'ws/3d2-step' into ws/3d2 2026-10-31 09:47:00 -05:00
4DBug a4751298ed Merge branch 'ws/3d2-usda' into ws/3d2 2026-10-31 09:47:00 -05:00
4DBug dd453c336e ws-3d2: merge ws/3d2-dae (model/dae); registry regenerated 2026-10-31 09:47:00 -05:00
4DBug 312cd3c10e ws-3d2: merge ws/3d2-3mf (model/3mf); registry regenerated, bench lines merged 2026-10-31 09:46:52 -05:00
4DBug d4affd565e ws-3d2/fbx: model/fbx (binary 7.x + ASCII read, binary 7.4 / 7.5 + ASCII write): node tree, Objects / Connections -> Scene (full transform model, layer elements, materials, textures, skins, blend shapes, animation stacks, cameras, lights); tests against assimp + Blender, round trips, fuzz; bench lines 2026-10-31 09:46:25 -05:00
4DBug a2763bee35 ws-video: video/avi tests (OpenDML / idx1 / scan, PCM / ADPCM / MP2 audio, raw RGB / I420, mux round trip), video/y4m tests (every C tag, 10-bit, writer), empty audio chunks are padding 2026-10-31 09:45:10 -05:00
4DBug 3e658042e3 ws-3d2/usda: model/usda - USD ASCII read / write (+ USDZ read), checked against OpenUSD (pxr), assimp's USD models and Blender exports
Reads stage metadata, xform op stacks (every rotate order, orient, transform, pivots / !invert!, resetXformStack),
time samples -> TRS animation, Mesh (all primvar interpolations + indices, GeomSubsets, holes, leftHanded),
UsdPreviewSurface / UsdUVTexture / UsdTransform2d materials with inherited bindings, cameras, UsdLux lights,
selected variants. USDC returns UNSUPPORTED. Writes Xform / Mesh / GeomSubset / Material / Camera / lights.
2026-10-31 09:41:47 -05:00
4DBug 788d0b5332 ws-3d2/dae: model/dae (Collada 1.4/1.5 + .zae) read: geometry (all primitive kinds, shared offsets), common-profile materials + images, node tree (all transform elements, instance_node), skin + morph controllers, cameras, lights, animations resampled to TRS channels (clips); write: Collada 1.4.1 / .zae (meshes, materials, images, nodes, cameras, lights). Tests against assimp's Collada models (nixpkgs assimp.src at fixture time), assimp exports of glTF samples vs their originals, assimp reading our output, round trips, fuzz 2026-10-31 09:41:27 -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 3ae152ac81 ws-video: video/mkv tests (ffprobe packets, ffmpeg audio, lacing / zlib / unknown clusters / subtitles, WebM remux), zlib content compression, codec-delay trimming of non-Opus audio (AudioWrap.trim), video/y4m, containers/Avi + video/avi (WIP tests) 2026-10-31 09:41:22 -05:00
4DBug 6941b63435 merge ws/audio 2026-10-31 09:37:28 -05:00
4DBug 443a7e45cb ws-3d2/step: cad/step (ISO 10303-21 read/write + injected B-rep plug-in)
- src/Formats/cad/step: Part 21 editions 1-3 parsed into Types.Cad fully in-library (header, named DATA sections,
  complex instances, every parameter kind, string escapes to UTF-8, comments, ANCHOR/REFERENCE/SIGNATURE kept raw);
  writer round-trips at the entity level (integral reals keep their real-ness via a list metatable mark).
- B-rep plug-in: a small injected table { read, write, tessellate } (or brep-luau's { Step, StepBrep, StepWrite, Tess }
  as is), taken from opts.brep / opts.plugins.brep; Step.toBodies / fromBodies / tessellate (-> Scene, z up, mm).
- Types.luau: StepEntity gains optional parts (complex instances) and section (edition 3); backward compatible.
- init.luau (api): withHooks also passes opts.plugins = F.plugins to decoders/encoders unless given; new facades
  F.cad.toBodies / fromBodies / tessellate (pass F.plugins, pcall, Err-wrapped). Backward compatible.
- tests/cad/step.luau + tools/fixtures/step.py: OCCT (gmsh) generated and public STEP files, Python census, OCCT reads
  our output back, brep-luau through a generated tests/gen/.luaurc alias (luau only), fuzz.
- tools/bench.luau: step parse / write lines.
2026-10-31 09:33:58 -05:00
4DBug 80383dcdd7 ws-3d2/3mf: model/3mf read / write (core, materials extension: base / colour / texture2d groups, composite, multiproperties; components, production p:path parts, units, metadata); tests against lib3mf 2.5 (its test suite), assimp, trimesh, our output read back by all three; bench lines 2026-10-31 09:33:43 -05:00
4DBug c56d2ac71d merge ws/music 2026-10-31 09:33:13 -05:00
4DBug 7754646a86 ws-music: music/it read + render (IT 2.14/2.15 decompression, NNA, filters, pitch-pan, OpenMPT note-fade coding), tracker tests tightened, MOD->XM + API checks, tracker bench lines, NOTICE 2026-10-31 09:31:34 -05:00
4DBug 967703a4d4 ws-video: video foundation: Types video section made concrete (Track / Packet / Demuxer / VideoFrame / VideoDecoder / VideoCodecDecoder), codecs/Video (codec registry by id / FourCC / Matroska id, generic VideoDecoder over a Demuxer, frames-backed videos, Source for writers), codecs/Yuv, containers/Demux (indexed demuxer), containers/Ebml, containers/AudioWrap; video/mkv (Matroska / WebM demux + mux, WIP: tests next)
api (init.luau, small, backward compatible): KIND_CATEGORY.video; withHooks adds opts.openAudio (audio tracks of video containers reach the audio formats through AudioWrap); F.load of a video format returns its VideoDecoder instead of draining it as audio; F.open passes the hooks and opens animated images as frames-backed videos (F.video.open(gif)); F.save of an Image to a video format wraps it (F.convert(gif, 'avi')); F.video.fromImage, F.video.codecs.
2026-10-31 09:31:21 -05:00
4DBug 9fd479e2d3 ws-audio: merge master (ws/m4a codecs/Mdct already in use since 6535a3c; audio/opus encoder, data, vec, 3d, webp) 2026-10-31 09:29:36 -05:00
4DBug cb05744367 ws-audio: Vorbis encoder (audio/vorbis/Encode: long blocks, floor 1 fit to the envelope, square-polar coupling, residue 2 with 6 classes + cascades, fixed Laplacian-Huffman codebooks, exact granules, Ogg via containers/Ogg Mux) wired into audio/vorbis encode; fixtures: ogginfo clean, oggdec exact lengths + SNR floors, ffmpeg; bench line 2026-10-31 09:29:09 -05:00
4DBug 2ca0d1f10a ws-video-codecs: codecs/Jpeg (the JPEG engine moved down from image/jpeg; byte-range API, yuv420p decode / encode, AVI1 fields); image/jpeg is a thin format over it 2026-10-31 09:28:38 -05:00
4DBug e1ffb21494 merge ws/m4a 2026-10-31 09:23:57 -05:00
4DBug 1749b9b9fc ws-m4a: m4a extensions (m4a, m4b, m4r) 2026-10-31 09:23:26 -05:00
4DBug 84d45c8190 ws-m4a: CELT-only Opus encoder in audio/opus (RangeEncoder + CeltEncoder ported from the libopus 1.6 encoder paths to mirror the absorbed decoder: 20 ms full-band CBR, mono and mid/side stereo, silence frames; Encode: Ogg Opus with OpusHead/OpusTags, end trimming, 48 kHz resampling); checked by opusdec / opusinfo / ffmpeg; Opus.caps.encode = true (opus test updated), deps += codecs/Mdct 2026-10-31 09:22:52 -05:00