Commits
2026-11-25
2026-10-23
Restore edith_codecs after local data loss (2026-10-23)Ahmet Kaan Gümüş · b7434a2
Restore edith_codecs after local data loss (2026-10-23) On 2026-10-23 an automated agent ran `rm -rf $HOME` and deleted the local repository with all of its history. This commit restores the working tree from the newest surviving copy, the host-c server lane mirror. That mirror matches local main as of the testcut Phase 2 reports, including the tool cache, the nextest fast profile and changed-crates.sh. The history before this commit was not recovered.
2026-08-20
feat(hw): expose HEVC prefix-SEI HDR peak and VUI colour tags on Frame/DecoderAhmet Kaan Gümüş · 7669974
feat(hw): expose HEVC prefix-SEI HDR peak and VUI colour tags on Frame/Decoder
edith's replica needs MaxCLL/MaxFALL for HDR films whose container never
carried them (they live only in HEVC content_light_level/mastering_display
SEI) — ec-hw's decode() dropped every SEI NAL on the floor. HevcDecoder now
merges ec_core::color::hevc_sei_light per access unit (sticky across frames
that carry none) and resolves VUI colour tags from the SPS; H264Decoder
resolves VUI tags only (no SEI parsing for that codec yet); VP9/AV1 report
None (not implemented). New Frame::colour()/Decoder::colour() surface it,
bundled as ec_hw::frame::Colour{description, light} over the existing
ec-core ColorDescription/ContentLight types.
Tests: hdr_film_light_level_sei_is_exposed pins MaxCLL/MaxFALL 1230/419 and
primaries/transfer/matrix 9/16/9 against the real ReelD rip;
sdr_h264_colour_never_panics proves the VUI-only path doesn't panic on an
SDR fixture (skips when no fixtures generated, same convention as the rest
of gpu.rs).fix(ec-hw-hevc): drop RASL pictures after a seek's random-access CRAAhmet Kaan Gümüş · e1b58c9
fix(ec-hw-hevc): drop RASL pictures after a seek's random-access CRA Root cause (crates/ec-hw/src/dec/hevc.rs): a CRA that opens a mid-stream random-access point stores its RASL leading pictures *after* itself in decode order even though they display *before* it (H.265 open-GOP coding). Those RASL pictures predict from pictures before the CRA, which a decoder started at that CRA — exactly what a seek does — never decoded. The old code decoded and output them anyway: bump() orders output purely by POC, so the (garbage) RASL pictures came out ahead of the CRA itself, shifting every subsequent output index by however many RASL pictures the GOP has. Per 8.1.3, `NoRaslOutputFlag` is 1 for the first picture of a coded video sequence — which the first IRAP after a `reset()` (mid-stream start) always is. RASL pictures (nal_type 8/9) associated with such an IRAP must not be decoded or output (8.1.3 / C.5.2.2). `HevcDecoder` now tracks that flag (`no_rasl_output`, set in `start_picture` on every IRAP) and skips `start_picture` entirely for a RASL access unit while it holds, so the picture is dropped whole rather than handed to the driver or bumped out. New test `hevc_seek_matches_linear_mkv` (crates/ec-hw/tests/gpu.rs) drives this through the real entry surface: it primes a fresh `Decoder` with the stream's parameter sets, `reset()`s it (a seek's exact contract per the existing reset() doc comment), feeds it from the CRA access unit preceding display frame 30 of test_hevc.mkv, and asserts the first decoded picture matches a linear decode of frame 30. Confirmed failing before this fix (mismatched I420 planes) and passing after. cargo test -p ec-hw --test gpu -- --test-threads=1: 18 passed (17 pre-existing + the new one), 0 failed.
2026-08-14
fix(hw): HEVC picture order counts follow prevTid0Pic, not the last pictureAhmet Kaan Gümüş · 5f55768
fix(hw): HEVC picture order counts follow prevTid0Pic, not the last picture A 4K HDR release decoded at 19 dB against the software decoder: right most of the time, wrong wherever it mattered. Two clauses, one cause. 8.3.1 predicts the picture order count MSB from `prevTid0Pic` — the previous picture with TemporalId 0 that is neither a leading picture nor a sub-layer non-reference. Predicting from the previous picture instead works on a stream without temporal sub-layers (every fixture here) and puts the MSB a wrap out on one that has them, which hands the driver the wrong references and the wrong output order. The same NAL types say which pictures may be referenced at all: a "_N" type is a sub-layer non-reference, and storing it as a short-term reference lets the next picture's reference picture set match it by picture order count. Also passes `st_rps_bits` through, so a driver that skips a reference picture set the slice header carried itself knows how long it was, and adds an `EC_HW_DEBUG` trace of the per-picture DPB state — this bug was found with it. Five files from the real library now decode identically to the software decoder, including the one that failed: 2160p HEVC Main10 HDR, 1080p HEVC 10-bit, 1080p AV1 10-bit and two 1440p H.264 screen captures.
feat(hw): stateless decoding for H.264, HEVC, VP9 and AV1Ahmet Kaan Gümüş · eb589d4
feat(hw): stateless decoding for H.264, HEVC, VP9 and AV1 One decoder per codec behind one `Decoder`. The driver keeps nothing between pictures, so everything the format spreads across frames lives here: the H.264 decoded picture buffer with its picture order counts, reference numbering, list initialisation and modification and marking (clause 8.2); HEVC's reference picture sets and bumping; VP9's and AV1's reference slots with `show_existing_frame`. Frames leave in display order. Three of the four incumbent defects are addressed by construction: - The RT format follows the *stream's* bit depth, so a Main10 stream gets a 10-bit config and a P010 surface instead of losing two bits per sample. - A `frame_num` gap is a normal condition — a seek, a lost packet, an encoder that skipped a picture — and the missing pictures are inferred per 8.2.5.2 rather than ending the hardware session. The inferred frames share the newest reference's surface, which is both a better guess than grey and the only choice this driver accepts. - Surfaces come from a pool and mappings are guards, so a long export neither reallocates nor leaks. The scaling matrices are sent for every H.264 picture whether or not the stream carries any: a driver that never receives them dequantises with a zero matrix and hands back a uniformly grey frame.