forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 978e6857d64772912559c8d8a4e6ee7cd309bdccFiltered to crates/engine/src/colorspace.rsClear filter

2026-08-13

chore: rename ponytail: comment marker to corner-cut:Ahmet Kaan Gümüş · 9ba8e0a
chore: rename ponytail: comment marker to corner-cut:

Marker convention renamed after uninstalling the ponytail plugin;
semantics unchanged (deliberate corner-cut, known ceiling + upgrade path).
Token-only rename, 81 comment lines, no code change.

2026-08-12

🔒 chore(privacy): the tests name a key, the machine names the fileAhmet Kaan Gümüş · a893c91
🔒 chore(privacy): the tests name a key, the machine names the file

Nothing in this tree says what is in anybody's library or where it lives.
The handful of tests that are worth nothing against a fixture -- a real
HDR10 grade, a header-stripped BluRay remux, a disc's PGS tracks -- asked
for absolute paths written into their source, and the comments around them
recorded which films the measurements were taken on.

Both go. `engine::real_library::film(key)` reads `real_library.toml` at the
workspace root, which is gitignored: three logical keys named for what the
file *is* (`hevc_4k_hdr`, `h264_dual_audio`, `hevc_4k_pgs`), mapped to
wherever that machine keeps them. A missing manifest, a missing key or a
missing file each say so on stderr and the test passes, which is the
existence gate every one of these already had, in one line instead of five.
`real_library.toml.example` documents the shape and what each key must be.

The comments keep the technical fact and lose the title: a peak of 1759
cd/m^2 is still 1759, the 37 BCP-47 elements are still 37, and the Opus
pre-skip is still measured against ffmpeg -- on "a real 5.1 Opus remux"
rather than on a named one. The synthetic paths in the app's unit tests
("/films/…") were never real and are now anonymous too.

2026-08-11

✨ feat(demux): a film's real peak brightness is parsed, not assumedAhmet Kaan Gümüş · 5726307
✨ feat(demux): a film's real peak brightness is parsed, not assumed

MaxCLL/MaxFALL and the mastering display's luminances, off all three
places they live: a Matroska Colour element (0x55BC/0x55BD and the
MasteringMetadata floats behind 0x55D0), an mp4 sample entry's clli and
mdcv boxes, and -- for the web rips where the container carries none of
it -- the HEVC SEI messages of the same names in the first access unit.

Carried on Demuxer::light() as ContentLight, whose peak() prefers the
measured content light over the display the grade was approved on.
Nothing reads it yet: wiring it into the tone map, which today assumes a
constant, is its own change.
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the gradeAhmet Kaan Gümüş · f390c37
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the grade

The export path read a PQ or HLG source's tags, wrote an SDR file and left the
pixels on their HDR curve: a washed-out, flat picture in a file that says
BT.709. `engine::tonemap` existed and nothing called it.

One `ToneMapper` per source stream -- the 9 537-node table is built beside the
per-source rate and colour, not per span -- and one call per frame, into the
grade scratch the path already owns, ahead of `apply_yuv`. That order is
playback's: the grade is a decision made against the SDR picture on the canvas,
so applying it to HDR codes would export a picture nobody saw.

The matrix remap that used to be the whole of the answer now asks `remap_into`,
which knows the tone map hands back BT.709 whatever the source was coded as: an
HDR clip is never *also* given the 2020 matrix treatment, and one on a canvas
below 720 lines still takes its 709 -> 601 step.

An SDR project is byte-identical: no table is built, no branch is taken.
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that oneAhmet Kaan Gümüş · 907dfc5
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that one

Exports carried no colour tags at all: the numbers went out as they came off
the decoder and every reader downstream had to guess. A 601 clip beside a 709
one went out as two spaces in one file, and nothing said so.

Now every export declares a space -- BT.709 at 720 lines and up, BT.601 below,
the same rule a reader with no tags applies -- in the Matroska `Colour` element
and the mp4 `colr` box, and a clip coded against the other matrix is rewritten
into it before it is graded. Same-space clips take the path they always did and
not a byte is touched.
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads itAhmet Kaan Gümüş · 070ffe6
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads it

Three tiers, per field: the container's own tags (Matroska `Colour`, mp4
`colr`), then the bitstream's (H.264/HEVC SPS VUI, AV1 `color_config`),
then the ffmpeg/mpv resolution rule -- 720 lines or taller is BT.709,
below it BT.601, limited either way. A code that says nothing, or says
something with no implementation here, falls to the next tier rather than
answering wrongly.

`VideoMeta` carries the answer; nothing consumes it yet. Everything still
renders through the hardcoded BT.601 it always did, which is the bug this
is the foundation for fixing.

The bit-level walks are where this can quietly go wrong: an SPS whose
scaling lists are counted wrongly lands the VUI read in the middle of a
coefficient. Both are measured -- H.264 and HEVC against hand-built
parameter sets (no encoder here writes SPS scaling lists), the rest
against fixtures tagged in the container, tagged only in the bitstream,
and tagged nowhere, plus the two real films: a 4K HDR remux that reads
BT.2020/PQ and a fully untagged 720p one that reads BT.709.