forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 03dc6e9978cbbbba112bf5c6ad925845ede8c744Filtered to crates/ec-hw/src/enc/headers.rsClear filter

2026-08-14

feat(hw): hardware encoding for H.264 and HEVC, AV1 behind an opt-inAhmet Kaan Gümüş · 7368f27
feat(hw): hardware encoding for H.264 and HEVC, AV1 behind an opt-in

IDR-then-P with a single reference, CQP or CBR, one frame in and one
coded frame out. HEVC encoding is in the tree rather than on a branch,
which is the whole point of writing this one: the conformance window is
a field of the sequence, so 1916x1080 comes out the size it went in.

The packed headers are the application's job here. This driver
advertises `SEQUENCE | PICTURE | SLICE` and then writes none of them
itself, so the crate writes the H.264 parameter sets and slice headers,
and reuses `ec-h265-syntax` for the HEVC ones — the same code that
parses them. Two driver behaviours are pinned down by comment where they
were found by measurement: the parameter sets only reach the stream when
a slice header accompanies them, and the HEVC slice header this driver
composes omits `slice_loop_filter_across_slices_enabled_flag`, so the
PPS has to say the flag is absent or every P picture decodes as
`alignment_bit_equal_to_one = 0`.

AV1 encoding is refused unless a caller sets `allow_av1`. That guard is
not caution for its own sake: a probe at the driver's own minimum encode
size took the GPU down with a hard recovery on 2026-08-14, and there is
no error to return from a context that no longer exists.