effectcraft/crates
daijro 74b151cedc Footage: reduced-resolution renders get movie frames converted at their size
Cause: at Half, Third and Quarter resolution (the viewer's Auto resolution
in most windows) every movie frame was converted from Y'CbCr to f32 RGBA at
full size and then resampled down. In the browser (wasm, one thread) that
was about 8 ms converting a 1080p frame, 6 ms resampling it and 2 ms
zeroing a 33 MB buffer, per layer and frame, for a frame shown at a
quarter or a ninth of its pixels; the footage frame cache held the
full-size frames.

Fix: FootageSource::frame_at_size asks for a frame shown at a given size
(default: the full frame, as before). The renderer asks for it where it
resampled footage (below 3/4 scale; not for proxies, fields or Interpret
Footage's pixel options, which need the full frame). MediaPool makes opaque
4:2:0 movie frames of the footage's own size there: it box-filters them to
half size in Y'CbCr before converting (each 2x2 block of luma, and the
[1 6 1]/8 neighbourhood of its chroma sample, which is the mean of the
upsampled chroma its pixels get), resamples the rest of the way and caches
the result per size. Conversion is linear until colours clip, so this is
the RGB box filter resample starts with, except in blocks where some
colours clip. Other frames convert at full size and resample as before.
In the browser the conversion and resampling take about 4 ms instead of
16. Docs (architecture).

Tests:
- convert::scaled_conversion_matches_resampling_the_converted_frame: half,
  third, quarter and odd sizes of an unclipped 4:2:0 frame are within 1e-5
  of resampling the converted frame; larger sizes, odd frame sizes and
  4:4:4 convert at full size.
- tests_footage_size::reduced_renders_take_footage_resampled_by_the_source:
  a source that resamples frames itself renders the same frames as one
  that doesn't, at 8 and 32 bpc and every resolution, and is asked only
  below 3/4 scale, and not with Invert Alpha.
- footage::h264_frames_at_reduced_sizes (ffmpeg fixture): 1080p H.264
  testsrc2 frames, whose saturated colours clip, at 960x540, 640x360,
  480x270 and 323x182 are 58-62 dB from the resampled full frames, and
  are cached per size.
- convert's ignored 1080p bench also times the conversion at a third.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 16:44:49 -05:00
..
automation Text: text layers are always rasterised at their on-screen scale (#390) 2026-10-09 23:17:32 +07:00
av1enc G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
color G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
effects Effects: CC Particle World follows the comp camera (#397) 2026-10-10 00:35:25 +07:00
engine Web: the layer and footage caches stay small enough for eight stacked clips 2026-10-09 16:44:15 -05:00
export Export: a Render Queue job renders every frame on the project's renderer (#414) 2026-10-09 22:26:17 +07:00
expr Merge pull request #6 from storybored379/pr/expr-runtime-stack-leak 2026-10-05 12:10:53 +07:00
geom Never crash: deny panic lints in the already-clean crates and apps 2026-10-04 14:52:39 -04:00
gpu Effects: CC Particle World follows the comp camera (#397) 2026-10-10 00:35:25 +07:00
hevcenc Untrack crates/hevcenc/target (36 MB of build output) and ignore nested target/ 2026-10-06 15:02:20 -04:00
host Effects: EXtractoR picks layers and channels of multi-layer EXRs (#295) 2026-10-09 17:32:09 +07:00
interchange Never crash: reject timeline documents nested too deeply 2026-10-04 14:05:57 -04:00
keyframe Plug-ins: Ease Presets moves out of core into a bundled ScriptUI panel 2026-10-09 21:03:12 +07:00
lottie G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
media Footage: reduced-resolution renders get movie frames converted at their size 2026-10-09 16:44:49 -05:00
model G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
opusenc G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
path G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
pdf G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
plugin G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
project Import: Interpret Footage ▸ Preserve RGB keeps the file's values (#411) 2026-10-09 23:57:12 +07:00
psd G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
raster Effects: EXtractoR picks layers and channels of multi-layer EXRs (#295) 2026-10-09 17:32:09 +07:00
render Footage: reduced-resolution renders get movie frames converted at their size 2026-10-09 16:44:49 -05:00
script Plug-ins: Ease Presets moves out of core into a bundled ScriptUI panel 2026-10-09 21:03:12 +07:00
segment Merge pull request #374 from storytold/fix/368-tflite-budgets 2026-10-09 09:25:24 -04:00
svg G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
text UI: Arabic, Hebrew, Indic and Thai names can be typed and are drawn (#394) 2026-10-10 00:53:21 +07:00
time Never crash: Tick and timecode arithmetic can't overflow or divide by zero 2026-10-04 14:20:33 -04:00
track G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
ui-egui Audio: a FLAC opens once and off the UI thread; conforming is bounded (#408) 2026-10-10 00:53:21 +07:00
vp9enc VP9: frames never end in a byte that reads as a superframe marker (#161) 2026-10-07 14:15:33 +07:00