forge
Explore
Log in

Don't you dare go Hollow

Commits

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

2026-11-27

2026-11-26

2026-11-25

ec-hw: one level selection per codec for VA and Vulkan; AV1 and HEVC VPS timing_info; VA H.264 High 8x8 transformAhmet Kaan Gümüş · ab12e5b
ec-hw: one level selection per codec for VA and Vulkan; AV1 and HEVC VPS timing_info; VA H.264 High 8x8 transform

Level comes from crates/ec-hw/src/level.rs (smallest level fitting size, rate, DPB and bitrate; CQP ignores bitrate). The Vulkan shim takes the level and clamps it to the driver's maxLevel.
AV1 sequence header carries timing_info (VA packed header, Vulkan OBU and std struct).
HEVC VPS carries vps_timing_info when the SPS VUI does.
VA H.264 High sets transform_8x8_mode_flag in the PPS and picture parameters.
Merge branch 'worktree-agent-ab057528cdea26a6b'Ahmet Kaan Gümüş · 5d4b8b4
Merge branch 'worktree-agent-ab057528cdea26a6b'

# Conflicts:
#	crates/ec-hw/src/hw.rs
#	shims/vk-video-ffi/src/av1_encode.rs
#	shims/vk-video-ffi/src/h264_encode.rs
#	shims/vk-video-ffi/src/h265_encode.rs
#	shims/vk-video-ffi/src/session.rs
vk: VA rate feedback and HRD buffer on Vulkan, H.264 profile, colour configAhmet Kaan Gümüş · ff39f7f
vk: VA rate feedback and HRD buffer on Vulkan, H.264 profile, colour config

hrd_buffer_ms and RateFeedback move to a shared ec-hw rate module, used by
the VA and Vulkan encoders. Vulkan CBR now runs the 1000 ms buffer for
GOP >= 10 and applies the steered bitrate through set_rate, no IDR.

The H.264 profile maps to profile_idc, constraint_set1 (Constrained
Baseline), PPS transform_8x8_mode and entropy_coding_mode. A profile the
driver rejects is Unsupported. The colour description goes into the
H.264/H.265 VUI and the AV1 colour config, as VA writes it.

Adds the hw_config example: H.264 Main, BT.601 full range, GOP 15, forced
key frame at 7; Vulkan and VA match in ffprobe fields and key frames.
vk: NV12 and P010 DMA-BUF encode input (1 or 2 objects), per-session import cacheAhmet Kaan Gümüş · 7996a95
vk: NV12 and P010 DMA-BUF encode input (1 or 2 objects), per-session import cache

DmaBuf now lists fds, planes {fd, offset, pitch}, width, height, modifier
and a DmaBufFormat (Bgrx, Rgbx, Nv12, P010). NV12/P010 import as a
multi-planar DRM modifier image (DISJOINT with one object per plane) and
copy plane by plane into the encoder source. Imports are cached per
session (16 entries, LRU) keyed by fstat dev/inode, layout, modifier,
size and format; dmabuf_imports() reports the import count.

ec-hw gains DmaBufYuvFrame and encode_dmabuf_yuv (Vulkan only). The RGB
DmaBufFrame API is unchanged. dmabuf_smoke covers NV12 (H.264, H.265,
AV1) and P010 (H.265, AV1) byte-identical to host upload, plus the cache
case.
vk-video-ffi, ec-hw: VP9 decode over Vulkan VideoAhmet Kaan Gümüş · 2134128
vk-video-ffi, ec-hw: VP9 decode over Vulkan Video

Profile 0 8-bit and profile 2 10-bit 4:2:0 on the Vulkan path, so VP9 no
longer needs VA-API. The shim takes the parsed uncompressed header and
builds StdVideoDecodeVP9PictureInfo. ec-hw reuses ec-vp9-syntax for
parsing and superframes, and the shared RefSlots (renamed from av1_refs)
for the eight reference slots. The VA VP9 decoder uses RefSlots too.

hw_decode example gains three libvpx VP9 streams (8-bit 640x360 with
hidden altrefs, 8-bit 720p realtime, 10-bit), all bit-exact against ffmpeg.
vk-video-ffi: zero-copy DMA-BUF input (encode_dmabuf) for H.264/H.265/AV1, forwarded through ec-vk and ec-hwAhmet Kaan Gümüş · 2602aec
vk-video-ffi: zero-copy DMA-BUF input (encode_dmabuf) for H.264/H.265/AV1, forwarded through ec-vk and ec-hw

Import the dma-buf as a VkImage (DRM format modifier explicit layout), acquire it from the foreign queue family and copy it into the RGB converter input buffer on the upload lane; the existing compute pass does the NV12 conversion and downscale.
dmabuf_smoke: encode_dmabuf output is byte-identical to encode_rgb for linear and tiled modifiers, and for the 640x360 downscale.

Co-Authored-By: Claude <noreply@anthropic.com>

2026-11-16

ec-hw: 10-bit HEVC encode, pipelined submit/flush, prime submit, CBR/VBR closed-loop rate correction; remove edith-sinkAhmet Kaan Gümüş · ccbbd43
ec-hw: 10-bit HEVC encode, pipelined submit/flush, prime submit, CBR/VBR closed-loop rate correction; remove edith-sink

- submit/submit_16/submit_prime + flush: DEPTH-3 pipelined encode, pool zero-filled
- submit_prime: GPU copy of an imported surface into a pool surface, padding zeroed (bit-identical to the CPU upload path)
- rate control: once-a-second bias + debt correction; mesa 26.2.6 / fw 20261019 overshoot 12-19% on detailed content (ffmpeg vaapi too)
- edith-sink removed: the MCP export path covers it

2026-11-15

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-09-07

feat(ec-hw): 10-bit BD row, 10-bit fps, ec-bench 10-bit row, docsAhmet Kaan Gümüş · ebea85e
feat(ec-hw): 10-bit BD row, 10-bit fps, ec-bench 10-bit row, docs

The 10-bit BD row is film B's own 1920x1024 native crop, every arm in
the 10-bit domain: hw AV1 10-bit is +36.7% BD-rate against librav1e
speed 6 10-bit and +52.9% against libaom cpu-used 6 10-bit, with all
three ladders asserted monotone. av1_encode_speed gains a 3840x1608
10-bit row, and ec-bench an 'ec-hw av1 10-bit' encode row that skips as
a row without a VA device.
feat(ec-hw): AV1 encode on by default, and an ec-bench hardware rowAhmet Kaan Gümüş · 24f4e5c
feat(ec-hw): AV1 encode on by default, and an ec-bench hardware row

The opt-in existed because a 2026-08-14 submission crashed the GPU; on
mesa 26.1.8 the path encodes streams two decoders agree on, so the
refusal goes rather than outliving its evidence. ec-bench gains an
'ec-hw av1 encode' row that skips as a row when there is no VA device.

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.