Commit Graph
252 Commits
Author SHA1 Message Date
FredApps 5935df1c53 Merge pull request #4879 from storytold/codex/filmcraft-lpcm-shared
Use shared DVD and Blu-ray LPCM decoding
2026-11-16 09:14:43 +01:00
FredApps 578783be11 Merge pull request #4878 from storytold/codex/filmcraft-codec-config-fields
Use shared video and audio codec configuration parsing
2026-11-16 09:13:16 +01:00
FredApps d33bbb2d12 Merge pull request #4877 from storytold/codex/filmcraft-jpeg-app14
Use shared JPEG metadata and sample conversion
2026-11-16 08:53:26 +01:00
FredApps c762c181ca Merge branch 'codex/filmcraft-shared-raw-video' into codex/filmcraft-codec-config-fields
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/codecs/src/video.rs
2026-11-16 08:17:55 +01:00
FredApps d66e87a44b Merge branch 'main' into codex/filmcraft-lpcm-shared
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-16 08:17:20 +01:00
FredApps 03a21bc047 Test the Motion JPEG component-count error from the shared converter 2026-11-16 08:05:56 +01:00
FredApps 5d6efbdb98 Test the shared uncompressed video decoder adapter 2026-11-16 08:03:22 +01:00
FredApps b5ecceb7d4 Merge branch 'main' into codex/filmcraft-shared-raw-video
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-16 07:08:19 +01:00
FredApps 4ee05c6376 Merge branch 'main' into codex/filmcraft-jpeg-app14
# Conflicts:
#	crates/codecs/Cargo.toml
2026-11-16 07:07:30 +01:00
FredApps ae7eba86b3 Merge remote-tracking branch 'origin/main' into w-pcm
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-16 01:06:07 +01:00
FredApps e8541904fc codecs: HE-AAC through craft-audio's SBR decoder; drop local upsampler, ADTS and LATM glue (craft-libs #778) (#4849)
* codecs: decode HE-AAC with craft-audio's SBR tool; drop the local upsampler, ADTS and LATM glue

craft-libs #1130 gave craft-audio's AAC decoder the HE-AAC SBR high band
(Decoder::set_sbr). PacketDecoder::aac now turns it on when the stream
plays at twice its core rate, instead of interpolating the AAC-LC core
with the local Upsample2x; a reset keeps the choice.

The rest of the AAC glue moves to the same crate, at the existing
156b491b pin: aac_output_rate wraps craft_audio::aac::output_rate,
adts_split and adts_frame_len read craft_audio::aac::AdtsHeader, and
LatmConfig / latm_config / latm_split are craft-audio's (which also read
a program config element and skip ascLen).

Refs storytold/craft-libs#778

* codecs: reorder AAC with a 5.1-shaped program config element like configuration 6

Configuration 0 now takes the speakers its PCE spells out through
craft_audio::aac::speaker_config before the WAV reorder, so an MP4 esds or
LATM StreamMuxConfig carrying a centre-first 5.1 PCE no longer sends
C, L, R, Ls, Rs, LFE to the wrong speakers. Layouts that cannot be told
keep the decoded order.

* codecs: keep the learned SBR header when a seek resets the AAC decoder
2026-11-15 22:53:44 +01:00
Dylan M. Taylor 59c6de0b91 Merge pull request #4846 from storytold/refactor/dnx-craft-video
codecs, export: DNxHD / DNxHR from craft-video; remove crates/dnx (craft-libs #778)
2026-11-15 14:17:57 -05:00
Dylan M. Taylor 482e911496 codecs: use shared MPEG and AC-3 descriptor parsing 2026-11-15 18:26:28 +00:00
Dylan M. Taylor 3dc6ff20b2 codecs: use shared DVD and Blu-ray LPCM decoding 2026-11-15 18:16:40 +00:00
Dylan M. Taylor 7db40b726c codecs: use shared JPEG sample conversion 2026-11-15 18:12:39 +00:00
Dylan M. Taylor 6d3127cac0 codecs: use shared video configuration parsing 2026-11-15 18:11:20 +00:00
Dylan M. Taylor 26c2758309 codecs: use shared Adobe JPEG metadata reader 2026-11-15 18:08:08 +00:00
Dylan M. Taylor 1d2b90fef2 codecs: use shared uncompressed video decoder 2026-11-15 18:00:49 +00:00
Dylan M. Taylor 2d4cdcb22b codecs: fix shared Y4M layout test type 2026-11-15 16:41:43 +00:00
Dylan M. Taylor efc74da96f codecs: use shared interleaved PCM decoder 2026-11-15 16:27:23 +00:00
Dylan M. Taylor dac71afbd4 codecs: use shared Y4M stream parser 2026-11-15 16:19:33 +00:00
FredApps 900d090647 codecs, export: decode and encode DNxHD / DNxHR with craft-video; remove crates/dnx
FilmCraft's local VC-3 codec moved to craft-libs as craft-video's dnx
module (craft-libs #702-#708, with the #4101 scan-line fix ported in #833).
Turn on craft-video's dnx feature at the existing 156b491b pin and point
the MOV / MXF probes, the DnxDecoder and the DNxHR export encoder at it.

The shared decoder budgets 256 MiB of planes per coding unit by default,
which would refuse 8K DNxHR 444 with alpha. Keep FilmCraft's previous
1 GiB whole-frame ceiling: check it on the first coding-unit header
before anything is allocated, and raise the shared per-unit budget to
match. Tests cover the 16384x16384 rejection (ported from the removed
crate) and the 8K 444 + alpha admission.

Refs storytold/craft-libs#778, storytold/craft-libs#781
2026-11-15 15:41:46 +01:00
Dylan M. Taylor 724078d64d Merge remote-tracking branch 'origin/main' into codex/filmcraft-prores-refresh
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-13 14:01:47 +00:00
Dylan M. Taylor 221f042557 refactor(codecs): route MJPEG through craft-jpeg (#4773)
* refactor(mjpeg): decode through shared craft-jpeg

* fix(mjpeg): satisfy fixed-width chunk lint

* fix(mjpeg): pin shared crates and attribute fixtures
2026-11-13 08:38:16 -05:00
Dylan M. Taylor a5c58c279a Merge remote-tracking branch 'origin/main' into codex/filmcraft-prores-cutover
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-13 10:03:09 +00:00
Dylan M. Taylor c27afcf28f Preserve FilmCraft ProRes decode limits on shared codec 2026-11-13 09:34:14 +00:00
Dylan M. Taylor bdc5969cdc Merge remote-tracking branch 'origin/main' into codex/filmcraft-prores-cutover
# Conflicts:
#	Cargo.toml
#	crates/codecs/Cargo.toml
2026-11-13 09:20:47 +00:00
Dylan M. Taylor 53836ee9c8 Use craft-video for ProRes decode and encode 2026-11-13 08:05:44 +00:00
Dylan M. Taylor 46c373d91a Merge current FilmCraft main into MP3 cutover 2026-11-13 08:02:37 +00:00
Dylan M. Taylor 3c564b9ced Format MP3 decoder error mapping 2026-11-13 07:01:46 +00:00
Dylan M. Taylor fe744cbcdb Preserve MP3 unsupported error classification 2026-11-13 06:53:05 +00:00
Dylan M. Taylor 71948c5b03 Merge remote-tracking branch 'origin/main' into codex/shared-mp3-audio-cutover
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-13 06:44:02 +00:00
Dylan M. Taylor 3665274989 Audio: decode standalone MP3 with craft-audio 2026-11-13 06:40:46 +00:00
Dylan M. Taylor 180ab6bb8b VP8: use shared craft-video decoder 2026-11-13 03:56:40 +00:00
dotCooCoo ff8046f558 Updates: take the craft-libs crates from craft-libs main at 47b6bbad
craft-docpath, craft-media, craft-audio, craft-video, craft-timeline,
craft-captions, craft-ui and craft-update move together from
storytold/craft-libs at 09dcbc22 to 47b6bbad, which includes
storytold/craft-libs#923: the check whether the running copy can install
itself now runs on the update-check thread instead of in Updater::tick.
Cargo.lock changes only the source revision of these crates and of the
craft-libs crates they pull in (craft-fonts-build, craft-i18n, craft-xml).

At 47b6bbad craft-video's HEVC decoder also decodes 4:2:2 streams and
reports the sampling in Picture::chroma. HevcDecoder::convert labeled
every frame 4:2:0, so a 4:2:2 frame's full-height chroma planes would
have been read as half-height planes. It now maps the picture's chroma
format to the frame's, with a test for 8-bit and 10-bit pictures.
2026-11-12 14:25:41 -08:00
Khawar Zamman Wani 0ed546f8df codecs: resampled audio does not depend on where a read starts (#4710)
* codecs: resampled audio does not depend on where a read starts (#4673)

The MP4, Matroska, AVI, MPEG, MXF and Ogg Opus readers computed each
output sample's resample position relative to the request start, so f64
rounding gave the same sample different weights under different request
cuts. They now share filmcraft_media::resample_window_into, which works
from the absolute output index like read_resampled and the WAV reader.

* tests: use white noise and rates where cut dependence shows in the output (#4673)

* tests: build the cut-independence fixtures in the crates, with full-precision samples (#4673)

* mxf test: write the file with craft-media's writer (#4673)

* tests: read at a large ratio so source positions reach the millions (#4673)

* mpeg test: drop redundant parentheses (#4673)

* review: blend an out-of-window left neighbour, tighten the helper tests (#4673)
2026-11-12 17:59:34 +01:00
Dylan M. Taylor 504fe9fc5e Containers, MP3 encoder and video decoders come from craft-libs
Containers, MP3 encoder and video decoders come from craft-libs

* Containers, MP3 encoder and video decoders come from craft-libs

The AVI, MPEG-TS/PS, MP3 encoder, H.264, HEVC, VP9, AV1, MPEG-2 and APV
crates are removed. craft-media (avi, mpegts), craft-audio (mp3-encode)
and craft-video (h264-decode, hevc-decode, vp9-decode, av1-decode, mpeg2,
apv), which were cut from them, replace them. Every craft-libs crate is
pinned at craft-libs 50f21899.

* MXF comes from craft-libs; craft-libs at df469bb2

crates/mxf is removed for craft_media::mxf. Both writer entry points name
FilmCraft (company, product, version) as the old writer did, so the bytes
and the product UID are unchanged; the export and AAF tests check it.

* docs: the VP9 and AV1 hostile_lengths WASI run points at craft-video
2026-11-11 22:48:59 -05:00
Dylan M. Taylor db60ee45c2 Audio codecs and Ogg come from craft-libs (#4676)
* Audio codecs and Ogg come from craft-libs

The AAC, AC-3, FLAC, MP1/MP2 and Opus crates and the Ogg demuxer are
removed. craft-audio and craft-media, which were cut from them and carry
their later changes, replace them.

* codecs: an Opus stream without a header packet is a decode error; craft-libs at b72cb4d6

An Ogg file whose first packet is larger than the header cap is filed as data,
so an Opus stream can arrive without its OpusHead; indexing headers[0] panicked.
The new craft-libs pin brings the Opus granule bounds from #4049 (craft-libs #859).
2026-11-11 17:26:13 -05:00
Dylan M. Taylor 0ba402b403 codecs: evict interior GOP cache frames when both ends are protected (#4187)
* codecs: evict interior GOP cache frames when both ends are protected

The over-budget eviction loop looked only at the first and last cached
frames; when those were the request and the newest decode it stopped,
leaving a reordered batch cached far above the budget. It now evicts the
interior frame farthest from the request instead.

* address review: pick the interior eviction victim from the ordered map instead of scanning

* address review: evict the new decode when only it and the requested frame remain over the ceiling

* address review: an intra-only request returns the frame it decoded even if the cache evicted it

* address review: keep the nearest decoded frame when the cache evicts the only fallback
2026-11-11 16:22:02 -05:00
Dylan M. Taylor 0d8eea995f audio: bound project-driven buffer sizes before allocating (#4170)
* audio: bound project-driven buffer sizes before allocating

- read_resampled (standalone audio, Ogg PCM), GeneratorSource::audio and
  the Ogg Opus reader check the requested shape with
  validate_audio_buffer_shape before allocating, as the AVI/MP4/MKV/MXF
  readers already do; Opus also gets the shared channel limit before any
  packet is decoded.
- Varispeed clamps a clip's stored speed to 100x before it sizes the
  source window of a playback block.
- Nested sequences are mixed at the same bounded sample rate that sized
  their requests (audio::bounded_sample_rate), so a damaged rate cannot
  multiply request sizes at each nesting level.

* address review: reject a zero Opus sample rate and bound the request before deriving frames

* address review: reject a zero output rate in read_resampled; block starts use the capped varispeed

* address review: transition handles shift by the capped read speed

* address review: keyframed volume and pan keep the clip's own timing across transition handles

* address review: keep raw_channels' doc comment on raw_channels
2026-11-11 16:21:38 -05:00
Dylan M. Taylor 4bec22bd03 codecs: bound the search for a random-access sample and honour cancellation in it (#4229)
* codecs: bound the search for a random-access sample and honour cancellation in it

* address review: poll cancellation before the sample-zero exit of the random-access search

* address review: refuse an oversized random-access candidate before reading it

* Merge origin/main; address review: check an unknown-size candidate after its read, report the Matroska size with its prefix, and keep sample_size to the containers with a test

* Raise the random-access probe limit to 65 536 so a long unkeyed GOP still seeks
2026-11-11 14:01:00 -05:00
Dylan M. Taylor 26586148b8 codecs, dng: refuse a LATM payload longer than its frame and a raw sample vector shorter than its image before allocating (#4263) 2026-11-10 18:03:13 -05:00
dotCooCoo 87c8e669d8 Updates: the updater reports installing, ready, installed and failed, and installs at exit
craft-libs moves to a branch that merges storytold/craft-libs#687 and #696
(c7c84230). All four craft-libs dependencies move together.

- The check result dialog also opens whenever the updater's status is not
  idle, so the first start after an update reports that it installed or why
  it failed. Restart to Update in the dialog asks the window to close.
- on_exit starts an update that waits for the exit, after the session shuts
  down.
- crates/codecs: craft-media now has one ByteSource trait for the ISO BMFF
  and Matroska demuxers, so the second impl for Src is removed.
2026-11-08 08:12:16 -08:00
FredApps f75d0b0c8d Merge pull request #3283 from vangel76/codecs-mxf-reorder-small-read
codecs: read 2 KiB instead of 16 KiB of each picture for AVC reordering at open
2026-11-08 16:15:32 +01:00
vangel76andClaude Sonnet 5.5 00657be829 MXF: propagate picture head read errors and read heads lazily
A failed read of a picture head is now an error instead of an empty
head that silently fell back to stored order, and the heads are read
one at a time again instead of being collected first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 17:10:52 +01:00
FredApps d324be9c91 Merge pull request #4067 from vangel76/fix/ogg-opus-timing-overflow
ogg: Opus timing no longer overflows on extreme granule positions
2026-11-07 16:49:18 +01:00
Romain PINSOLLE 85448940ef render: turn display-rotated video on the GPU (#3467) (#3484)
* render: turn display-rotated video on the GPU (#3467)

A portrait phone clip (4K60 HEVC with a 90° display matrix) dropped ~97 %
of its frames: every decoded 4K frame was turned on the CPU, which is too
slow at 60 fps, and with the GOP cache's lock held.

- GopCache caches decoded frames raw when they need a crop or a rotation;
  `frame_late` crops and turns them off the lock, and the new
  `frame_late_unturned` hands them over as decoded with the quarter turns
  still to apply.
- MediaSource gains `video_frame_unturned` (default: the upright frame, 0
  turns). MP4 and Matroska implement it; the pool's wrapping sources and
  the frame server's timed source pass it on.
- The render plan folds the turns into the layer matrix of plain layers,
  and into the GPU effect stage (`LayerFx::turns`): `fs_fx_source` reads
  the source on its decimated grid through the turn, and the CPU reference
  decimates then turns, so effects still see the upright picture.

Other paths (CPU-only effects, log media, a clean aperture, export) still
turn on the CPU as before.

* codecs: cache intra-only frames raw too (#3467)

Intra-only decoders (ProRes, DNx) cropped and turned every frame before
caching it, so frame_late_unturned found it already turned and the GPU
had nothing left to do. Their frames are now cached raw like long-GOP
output: frame_late still crops and turns them off the lock, and
frame_late_unturned hands them over as decoded.

* docs: document the unturned-frame entry points (#3467)

* codecs: follow main's frame lookup in the unturned paths (#3467)

main changed `from_tick` (Matroska) to take the frame rate and `snap`, and
MP4 looks frames up with `lookup_time(.., rate, snap)`. `video_frame_unturned`
still used the old calls: the Matroska one no longer compiled, and the MP4 one
could pick another sample than `video_frame` when `snap` is on. Both now use
the same lookup as their `video_frame`.

Also repairs the merge of main into this branch: a closing brace was lost in
the #3467 test (the test module did not compile) and a blank line was doubled
(cargo fmt --check failed).

* codecs: test every display turn, crop with turn, drafts and eviction of raw frames

* gpu: give the neutral-corrector test LayerFx its turns field

Merging main added a LayerFx initializer without the turns field, which
breaks compilation of the gpu tests (E0063).
2026-11-05 03:19:24 +01:00
vangel76andClaude Sonnet 5.5 cbc1be5707 Merge upstream/main into fix/ogg-opus-timing-overflow
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 01:54:48 +01:00
vangel76andClaude Sonnet 5.5 a30e085827 Merge upstream/main into codecs-mxf-reorder-small-read
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 01:41:22 +01:00
Dylan M. Taylor ce3db76e8c codecs: cap the decoded samples a standalone file or Vorbis stream keeps in memory (#4203) 2026-11-03 17:59:12 -05:00