forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on cbbd6e2ef6acafb00aeb55e460423f024126f90fFiltered to crates/ec-hw/src/lib.rsClear filter

2026-08-20

feat(hw): expose bit_depth on I420_16 and pin 10-bit readbackAhmet Kaan Gümüş · 54b87cd
feat(hw): expose bit_depth on I420_16 and pin 10-bit readback

I420_16 is the lossless P010 readback, but the value carried nothing to
say so: a 10-bit consumer had only the method name to tell it apart from
the truncating to_i420 path. It now carries bit_depth (always 10),
matching Frame's field.

Adds a unit test that uploads a synthetic P010 surface whose samples
(512, 513, 1023) alias under 8-bit truncation and asserts to_i420_16
preserves them exactly while to_i420 yields the >> 2 values. The crate
doc now states that 10-bit consumers must call to_i420_16.
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).

2026-08-14

feat(hw): the VA-API parameter buffers, surface pool and frame readbackAhmet Kaan Gümüş · 89d28a7
feat(hw): the VA-API parameter buffers, surface pool and frame readback

The foundation of the hardware crate: every codec parameter struct
libva defines for the paths this family uses, transcribed by hand from
the system headers and checked field for field by a `const` assertion
against `crates/ec-hw/abi-probe.c`. A transcription slip is a compile
error rather than a driver reading garbage.

Around them:

- `SurfacePool`, which allocates once and recycles: a surface returns to
  the free list when the reference buffer and the caller are both done
  with it, so nothing leaks and nothing is reallocated per frame.
- `Frame`, with the two ways to reach the pixels — DRM PRIME export for
  the zero-copy path, and `vaGetImage` readback into I420 (8 or 10 bit)
  for callers that want the samples. The readback image is created once
  per stream: one `vaCreateImage`/`vaDestroyImage` pair per frame costs
  ~20 ms at 1080p on this driver, more than the decode itself.
- A typed error for every failure. Nothing here panics: edith loads this
  path as a dlopen'd plugin whose fall back to software is only as good
  as that promise.