Commit Graph
121 Commits
Author SHA1 Message Date
FredApps a380d33f46 Merge pull request #1699 from storytold/codex/lpcm-shared
Share DVD and Blu-ray LPCM decoding
2026-11-16 07:04:47 +01:00
FredApps b3643af647 Merge pull request #1616 from storytold/codex/omf-bounds
aaf: preserve bounded FilmCraft OMF traversal
2026-11-16 04:50:18 +01:00
FredApps d26e89917a omf: charge depth-limited visits and share a document search budget; AIFF-C needs an integer PCM code 2026-11-16 03:05:05 +01:00
FredApps 4daca46778 pcm_export: use is_multiple_of 2026-11-16 03:01:21 +01:00
FredApps b99a64fc5b pcm_export: refuse zero channels, zero sample rate and partial frames 2026-11-16 03:01:11 +01:00
FredApps 5f4e05d951 audio: rustfmt after main merge 2026-11-16 01:56:22 +01:00
FredApps 22ead09553 Merge remote-tracking branch 'origin/main' into w1621
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-16 01:48:39 +01:00
FredApps 7f78225721 Merge pull request #1614 from storytold/codex/shared-pcm-essence
audio: share compatible PCM essence wrappers
2026-11-16 01:43:05 +01:00
FredApps 69c0ff7068 Merge remote-tracking branch 'origin/main' into w-codex/omf-bounds 2026-11-16 00:48:12 +01:00
FredApps 1d413b992d Merge pull request #1688 from storytold/codex/flac-main-reconcile
Reconcile native FLAC decoder with merged QOA support
2026-11-16 00:17:47 +01:00
FredApps a5f31480eb Merge remote-tracking branch 'origin/main' into w-codex/pcm-export-shared
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-16 00:08:48 +01:00
FredApps 6c947d655b Merge remote-tracking branch 'origin/main' into pcm-essence
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-16 00:05:49 +01:00
FredApps c26b32c8ac Merge pull request #1636 from storytold/codex/shared-pcm-packet
audio: share interleaved PCM packet decoding
2026-11-16 00:05:15 +01:00
FredApps d1a431c4b5 audio: pure-Rust Vorbis encoder (1-8 channels, quality, tags, wasm) and an Ogg page writer (#1642)
* audio: pure-Rust Vorbis encoder, and an Ogg page writer in craft-media

Replace the libvorbis wrapper (vorbis_rs, C, desktop only) behind
`vorbis-encode` with FilmCraft's clean-room Vorbis I encoder by
@JordyUSA (storytold/filmcraft#4481), and move its Ogg page writer into
craft-media's `ogg` module.

craft-audio:
- `vorbis::encoder::{Encoder, EncoderConfig, Error}`: 1-8 channels in
  Vorbis order, any sample rate, quality -1 to 10 (VBR), streaming
  packets with granule positions.
- `encode_ogg_vorbis` with `OggVorbisOptions` (quality, vendor, tags,
  serial) writes a whole Ogg Vorbis file with a comment header.
- `encode_ogg(buf, kbps)` and `OGG_BITRATES` keep working: the bit rate
  picks the quality whose nominal rate it is (`quality_for_bitrate`).
- `encode` with `EncodeFormat::Ogg` takes 1-8 channel WAV-order layouts
  and writes them in Vorbis order, and `RateControl::Quality`.
- Ogg is built on wasm32 too.
- Residue partitions hold whole sample frames (48, 40, 48 or 56 values
  for 3, 5, 6 and 7 channels): libvorbis decodes each partition from
  channel 0, so 32-value partitions came out scrambled for those counts.
- The first audio packet gets a page of its own, so a short file's
  first audio page is never also its last (ffmpeg then kept the padding).

craft-media: `ogg::PageWriter`, `opus_tags`, `vorbis_comment`.

Part of storytold/craft-libs#778.

* audio, media: address review on the Vorbis encoder and Ogg writer

- Encoder: read cursor into the pending input, compacted once per call,
  so a large encode() call no longer moves the tail on every block.
- Tests: check ffmpeg's libvorbis decoder only when ffmpeg has it.
- PageWriter::finish: the end granule replaces the last page's only when
  a packet completes on it (RFC 7845 4.4); documented and tested.
- README: Ogg Opus packet granules are the samples decoded so far.

* audio: pick Ogg by extension on wasm32 too

The Vorbis encoder is pure Rust now, so encode_format_for("ogg") follows
the vorbis-encode feature alone, as EncodeFormat::Ogg.is_built() and
ENCODE_EXTENSIONS already do.
2026-11-15 22:59:29 +01:00
FredApps 5a7a63a21d Merge pull request #1593 from storytold/i778/opus-encoder-effectcraft-speedups
craft-audio: port EffectCraft's later Opus encoder speed-ups
2026-11-15 22:26:13 +01:00
Dylan M. Taylor 30596f73c5 Merge pull request #1707 from storytold/extract/wav-marker-metadata
audio: extract WAV cue, adtl, RF64 and XMP marker metadata
2026-11-15 15:43:10 -05:00
Dylan M. Taylor 27b1134e23 Share Opus FFT and CELT allocation primitives 2026-11-15 18:57:27 +00:00
Dylan M. Taylor d4edc55578 Merge branch 'codex/shared-pcm-packet' of https://github.com/storytold/craft-libs into codex/lpcm-shared 2026-11-15 18:50:29 +00:00
Dylan M. Taylor 5dcddf5bf0 Merge branch 'main' of https://github.com/storytold/craft-libs into codex/shared-pcm-packet
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-15 18:50:21 +00:00
Dylan M. Taylor 3f4de9ca11 Merge pull request #1637 from storytold/codex/adts-asc-config
audio: expose ASC prefix to ADTS configuration
2026-11-15 13:36:24 -05:00
Dylan M. Taylor 37f182592a Merge branch 'codex/shared-pcm-packet' of https://github.com/storytold/craft-libs into codex/lpcm-shared 2026-11-15 18:34:10 +00:00
Dylan M. Taylor a28cb61765 Cover interleaved PCM sample representations 2026-11-15 18:33:29 +00:00
Dylan M. Taylor 8ed0be0c4b Merge remote-tracking branch 'origin/main' into codex/pcm-export-shared
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-15 18:20:28 +00:00
Dylan M. Taylor c5749f5d06 audio: share DVD and Blu-ray LPCM decoding 2026-11-15 18:15:46 +00:00
Dylan M. Taylor affd53bf5f Merge remote-tracking branch 'origin/main' into codex/flac-main-reconcile
# Conflicts:
#	crates/audio/Cargo.toml
#	crates/audio/src/lib.rs
2026-11-15 17:52:06 +00:00
Dylan M. Taylor 2738efa08d Merge remote-tracking branch 'origin/main' into codex/shared-pcm-essence
# Conflicts:
#	crates/audio/src/lib.rs
2026-11-15 17:50:52 +00:00
Dylan M. Taylor 7b7568d95e Merge pull request #1608 from storytold/codex/wav-range-cutover
audio: share bounded range-backed WAV PCM access
2026-11-15 12:49:32 -05:00
Dylan M. Taylor 25b1cf2b6f audio: expose validated ADTS configuration fields 2026-11-15 16:30:22 +00:00
Dylan M. Taylor b958ba705f audio: expose ASC prefix to ADTS configuration 2026-11-15 16:29:38 +00:00
Dylan M. Taylor 64b7a7f21e audio: share interleaved PCM packet decoding 2026-11-15 16:26:40 +00:00
Dylan M. Taylor 9c3c82e1c6 audio: fix PCM export module documentation 2026-11-15 16:16:04 +00:00
Dylan M. Taylor ad9850f18f fix(audio): validate FLAC stream precision and complete consumption 2026-11-15 11:05:37 -05:00
Dylan M. Taylor f751827790 audio: share streaming PCM export encoding 2026-11-15 16:01:42 +00:00
Dylan M. Taylor 5ae0c89fdf audio: share compatible PCM essence wrappers 2026-11-15 15:50:50 +00:00
Dylan M. Taylor aa398af9dd audio: fix range test lint on workspace gates 2026-11-15 15:48:01 +00:00
Dylan M. Taylor badb790411 audio: expose WAV signature detection 2026-11-15 15:40:02 +00:00
Dylan M. Taylor 8e394d43fa audio: share bounded range-backed WAV PCM access 2026-11-15 15:39:42 +00:00
FredApps b850981f83 craft-audio: port EffectCraft's later Opus encoder speed-ups
The shared encoder was imported from storytold/effectcraft@c618429. EffectCraft's
copy has since gained @vangel76's speed-ups (effectcraft #2394, #2398, #2399,
#2402, #2403, #2404) and the strict-Clippy CELT stage refactor. Port them so
EffectCraft can drop crates/opusenc without slowing WebM export.

Packets are byte-identical to effectcraft-opusenc at d6c9ad66 (2100 packets
across SILK, hybrid and CELT, mono and stereo, 10-320 kb/s). The shared Error
API is unchanged.

Refs #778
2026-11-15 15:29:08 +01:00
el-j 2d5f2e4a73 craft-audio: flac_decode tests without index loops (CI clippy) 2026-11-15 15:25:56 +01:00
el-j ee20ae63fd craft-audio: qoa_oracle test without index loops (CI clippy) 2026-11-15 15:24:46 +01:00
el-j cdf4a2fa6e craft-audio: native FLAC decoder (flac-decode)
Adds flac::decode for whole files and flac::Decoder for single frames:
RFC 9639 subframes (constant, verbatim, fixed, LPC), Rice and escaped
partitions, wasted bits, all stereo modes, fixed and variable block
sizes, 4 to 32 bits, CRC-8 and CRC-16 checked. Not yet wired into
craft_audio::decode, which still uses symphonia for FLAC.

Part of #1546
2026-11-15 15:11:43 +01:00
el-j ff61266d63 craft-audio: QOA (Quite OK Audio) decoder and encoder
Adds the qoa module behind the qoa, qoa-decode and qoa-encode features:
whole .qoa files, 16-bit, 1 to 8 channels. Streaming files are
unsupported. An ffmpeg oracle test checks that ffmpeg decodes our files
to exactly the samples our decoder returns.

Closes #1541
2026-11-15 12:38:57 +01:00
Dylan M. Taylor c4fb292825 Use canonical parity check in WAV iXML fixture 2026-11-14 23:02:09 -05:00
Dylan M. Taylor 44802bd54d craft-audio: preserve iXML WAV time-reference fallback 2026-11-14 22:57:45 -05:00
Dylan M. Taylor 92e665a5e8 Exercise Vorbis block boundaries with distinct channel signals 2026-11-14 18:33:24 -05:00
Dylan M. Taylor 354acd6a54 Cover Vorbis in format contract tests and assert streaming refusal 2026-11-14 18:15:14 -05:00
Dylan M. Taylor dc2b83d7f4 Document Vorbis rate semantics and validate standalone options 2026-11-14 18:13:31 -05:00
Dylan M. Taylor 9efb0a1575 Complete standalone Vorbis feature and option validation 2026-11-14 18:12:40 -05:00
Dylan M. Taylor 8ae42d1aeb Merge main and reconcile Vorbis encoding with current audio APIs 2026-11-14 18:12:03 -05:00
Dylan Taylor 630c570789 fix: update tests for vorbis-encode feature (ogg support) 2026-11-14 10:16:33 -05:00