Commit Graph
2792 Commits
Author SHA1 Message Date
Dylan M. Taylor 111b522d05 feat(figcraft-format): add bounded native archive access 2026-11-13 06:41:10 +00:00
Dylan M. Taylor 3c67a98e54 Merge latest craft-libs main 2026-11-13 06:38:48 +00:00
Dylan M. Taylor 8cdd25ce0a feat(figcraft-format): add native document header contract 2026-11-13 06:38:38 +00:00
Dylan M. Taylor e356ff84a4 Initialize raster decode limits directly 2026-11-13 01:38:06 -05:00
Dylan M. Taylor b4ada28f19 Fix format registry clippy and add ASE support 2026-11-13 01:37:48 -05:00
alehel 7af2f8e868 craft-media: AVI muxer (AviWriter)
Write AVI files: hdrl with avih and one strl (strh, strf, strn, indx) per
stream, odml/dmlh, an interleaved movi and idx1. Past the RIFF limit
(default 1 GiB) the file continues in OpenDML RIFF AVIX extensions with
ix## standard indexes and an indx super index per stream.

- VideoSpec::for_codec builds the stream from CodecParams; MPEG-4 Part 2
  is tagged FMP4.
- Audio is timed by bytes (PCM-style) or one packet per chunk.
- Bad options and chunks are errors; finish() closes a readable file
  after a failed write.

Tests read the files back through this crate's demuxer by every index,
and through ffmpeg (decode identical to the sources, seeks through the
index, ffprobe fields), in one RIFF and across AVIX extensions. The
MPEG-4 encoder tests play its packets from an AVI file.
2026-11-13 07:34:28 +01:00
alehelandClaude Opus 5.5 fe8c1f697a craft-audio: keep the SBR history when a new program config fails
The SBR decoders now record the layout they were built for and are rebuilt when the
decoder's layout differs, instead of being cleared in set_layout. An access unit whose new
program config fails puts the layout back, and with it the SBR decoders still match.

Refs #1121

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:34:10 +01:00
alehelandClaude Opus 5.5 48f5283ec8 craft-audio: cite no section number for l_A
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:34:10 +01:00
alehelandClaude Opus 5.5 fa9ca36697 craft-audio: SBR review fixes
- A VARFIX pointer of 1 marks no transient envelope, like 0.
- A start at QMF channel 32 is valid; kx is checked once the crossover is known.
- The noise and harmonic gains take q / (1 + q) first, so two clamped levels no longer
  overflow to infinity and NaN.
- A header that runs past its fill element is refused before it replaces the one in use.
- A new program config layout drops the SBR decoders, whose history was the old order's.
- The ffmpeg oracle requires a high band to compare on every channel but the 5.1 LFE.

Refs #1121

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:34:10 +01:00
alehelandClaude Opus 5.5 f68e4369eb craft-audio: decode the HE-AAC SBR high band
aac::Decoder::set_sbr(true) decodes HE-AAC at twice the core rate with the
SBR tool of ISO/IEC 14496-3 §4.6.18: QMF analysis and synthesis, frequency
band tables, patching with LPC inverse filtering, envelope adjustment with
limiter, boost, noise and sinusoids. TrackDecoder uses it in place of the
2x upsampler. Tables are transcribed from ETSI ES 201 980 Annex I.

Matches ffmpeg's decoder on AudioToolbox HE-AAC streams of 1-6 channels:
the same 962-sample delay, ~54 dB SNR, high band level within 0.01 dB.
Parametric stereo is still not decoded.

Refs #1121

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:34:10 +01:00
alehel 1df8d98c85 craft-video: MPEG-2 encoder, first step: I and P pictures (#1133)
The start of MPEG-2 encoding in craft_video::mpeg2 (feature
mpeg2-encode): progressive frame pictures, closed I/P GOPs, 4:2:0 Main
Profile and 4:2:2 Profile, constant quantiser or single-pass average
bitrate with adaptive quantisation, half-sample motion search.

The encoder shares the decoder's code tables, IDCT, dequantisation and
motion compensation, so the decoder outputs exactly the encoder's
reconstruction. B pictures, a VBV guarantee, interlaced coding and DVD
or broadcast presets are later steps of #1133.

The mpeg2 feature is split into mpeg2-decode and mpeg2-encode; mpeg2
still turns on both.
2026-11-13 07:34:05 +01:00
Dylan M. Taylor 47bf5650b0 Expose shared InDesign signature 2026-11-13 01:31:26 -05:00
Dylan M. Taylor 96c8487984 Add shared InDesign conversion facade 2026-11-13 01:30:54 -05:00
Dylan M. Taylor bdba99322e Use canonical winprint repository URL 2026-11-13 01:28:04 -05:00
Dylan M. Taylor 6ba1ca33ca Recognize InDesign files in shared registry 2026-11-13 01:27:11 -05:00
Dylan M. Taylor 1f9c271f7d Recognize legacy Word extension in shared registry 2026-11-13 01:26:09 -05:00
Dylan M. Taylor 32529b94e8 Resolve plain text format extensions 2026-11-13 01:24:40 -05:00
Dylan M. Taylor fdfb188855 Use array chunks for raster pixels 2026-11-13 01:24:36 -05:00
Dylan M. Taylor fc9ecb40e7 Extend shared file-format registry 2026-11-13 01:22:58 -05:00
Dylan M. Taylor a47b78256c Expose shared embedded ICC extraction 2026-11-13 01:15:30 -05:00
Dylan M. Taylor 80731087bf Merge remote-tracking branch 'origin/main' into codex/1154-main-refresh 2026-11-13 06:10:02 +00:00
Dylan M. Taylor c6ae974743 Expose shared decoded DNG JPEG XL previews 2026-11-13 01:09:49 -05:00
Dylan M. Taylor 79923702ff Merge remote-tracking branch 'origin/main' into fix/psd-head-view 2026-11-13 06:06:44 +00:00
Dylan M. Taylor 21d7c1267e metafile: draw GDI+ percentage hatch styles 2026-11-13 06:05:42 +00:00
Dylan M. Taylor 913b1aa97f Merge remote-tracking branch 'origin/codex/craft-time-soundcraft' into codex/soundcraft-format 2026-11-13 06:05:40 +00:00
Dylan M. Taylor 07a4cd0fc7 #778: preserve consumer VP8 frame limits 2026-11-13 06:05:39 +00:00
Dylan M. Taylor 10a2d6dd14 Merge remote-tracking branch 'origin/main' into codex/craft-time-soundcraft 2026-11-13 06:05:34 +00:00
Dylan M. Taylor 93d75f44d7 Merge remote-tracking branch 'origin/main' into feat/stencilcraft-format 2026-11-13 06:05:00 +00:00
Dylan M. Taylor d6ed8c20f1 Merge pull request #1161 from dylanmtaylor/codex/workspace-gate-main
ci: route workspace checks through shared gate
2026-11-13 01:04:23 -05:00
Dylan M. Taylor 85145d8dfd Expose shared raster source and tone inspection 2026-11-13 00:58:35 -05:00
Dylan M. Taylor 4b8dde4c12 test(stencilcraft-format): exercise reader scalar root variants 2026-11-13 05:52:28 +00:00
Dylan M. Taylor eb379cf3d2 test(stencilcraft-format): cover scalar JSON roots 2026-11-13 05:51:08 +00:00
Dylan M. Taylor 8bac629c0f Preserve CFA anchor in shared raw metadata 2026-11-13 00:46:33 -05:00
Dylan M. Taylor d8cc88a772 Add image document formats to shared registry 2026-11-13 00:39:59 -05:00
Dylan M. Taylor ba24fe2435 Move bounded EPS rectangle parsing to craft-eps 2026-11-13 00:39:37 -05:00
Dylan M. Taylor c1a1b976d0 Resolve raster subformats centrally 2026-11-13 00:34:48 -05:00
Dylan M. Taylor 8d3c753b5e Recognize G-code filename extensions 2026-11-13 00:34:11 -05:00
Dylan M. Taylor 79c2003ac9 Add shared file format detection 2026-11-13 00:30:56 -05:00
Dylan M. Taylor 7c3a099ad8 Read native format JSON from streams 2026-11-13 05:21:58 +00:00
Dylan M. Taylor 3bdf0eaadd Format shared image codec crate 2026-11-13 00:17:35 -05:00
Dylan M. Taylor 9430f2807e Add shared image codec facade 2026-11-13 00:17:04 -05:00
Dylan M. Taylor 3afade5163 Expose renderer-neutral SVG preflight 2026-11-13 00:13:31 -05:00
Dylan M. Taylor e95c99e7bc Support common raster output formats by path 2026-11-13 00:10:01 -05:00
Dylan M. Taylor dc705aa364 Re-export common RGBA pixel types 2026-11-13 00:09:00 -05:00
Dylan M. Taylor 1dbfad04fd Support extension-based raster encoding 2026-11-13 00:08:05 -05:00
kiwi4boy 79b4fd0144 craft-xlsx: review fixes: CONVERT, shared formula tokens borrowed, cell metadata with its formula
From the first review round:

- 468 (0x1D4) is CONVERT, with 3 arguments. [MS-XLSB]'s Ftab table has no row for it, though
  its grammar lists convert-params among the fixed-argument functions; Excel writes
  =CONVERT(1,"m","ft") in .xlsb as a PtgFunc calling 0x1D4 (observed in Excel). It was the only
  unassigned number from 0x17C to 0x1E4. The module doc says it isn't the specification's row.
- A BrtShrFmla's tokens and extra data are borrowed from the worksheet part instead of copied: a
  record may claim up to 256 MiB, and each shared formula is kept for the rest of the sheet, so
  the copies could cost as much again as the part. BrtArrFmla's are used at once and borrowed too.
- A formula record's cell metadata goes with its formula: when the formula is kept as its value
  (tokens the reader can't decode, an unreadable BrtArrFmla), the cell loses its `cm`, which
  would otherwise mark a dynamic-array formula that isn't there. A value cell keeps its cell
  metadata, as the file has it.

The CONVERT and cell-metadata tests fail without this commit. The Excel-saved workbook still
reads with all 33 formulas as in its .xlsx.
2026-11-13 00:04:32 -05:00
Dylan M. Taylor 5407ea8220 Document required kerf field in native format example 2026-11-13 00:04:29 -05:00
Dylan M. Taylor 4ecdcd78da Export common raster codec facade 2026-11-13 00:03:41 -05:00
Dylan M. Taylor 8c41139369 Add shared raster codec facade and versioned JSON headers 2026-11-13 00:01:32 -05:00
Dylan M. Taylor ca7a73bd2c ci: allow longer Windows workspace gate 2026-11-13 04:50:46 +00:00