forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on d0fd4cb851cc4a634bbb98f4eff9631fe63170d0

2026-11-25

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.
ec-hw: AV1 film grain on the Vulkan pathAhmet Kaan Gümüş · b0a8e4e
ec-hw: AV1 film grain on the Vulkan path

RADV accepts filmGrainSupport=true but its output is the ungrained
decode, so grain is applied on the CPU after readback with ec-av1's
spec 7.18.3 synthesis. Shown frames are grained, references stay clean,
show_existing_frame re-applies the loaded parameters. 8-bit I420 only;
RGB and 10-bit grain still fall back to VA.

hw_decode gains a grain case (ffmpeg and VA: 0.000000).
Merge parity/reset branchAhmet Kaan Gümüş · 9777d9aBrowse files
vk: 10-bit H.265 Main10 and AV1 encode from P010, Vulkan 10-bit decode output; ec-hw encode_16 and HwDecoder::open_16/next_frame_16Ahmet Kaan Gümüş · 82a0fd5
vk: 10-bit H.265 Main10 and AV1 encode from P010, Vulkan 10-bit decode output; ec-hw encode_16 and HwDecoder::open_16/next_frame_16

Shim: P010 input plane upload, Main 10 / high_bitdepth parameter sets, encode_16 on H.265 and AV1 sessions; RGB and DMA-BUF input refused at 10 bits; 10-bit caps query maps to Unsupported.
ec-vk: bit_depth in H265/Av1 encoder configs, encode_16.
ec-hw: EncoderConfig.bit_depth 10 on Vulkan (H.264 stays Unsupported), HwEncoder::encode_16; Mode::I420_16 decode output for Vulkan and VA-API, shared fill_i420_16 in picture.rs.
examples/hw_ten: 30-frame 1280x720 round trip, PSNR and VA comparison.
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.
hw_parity example; intra_rate runs both backends; Vulkan device-lost maps to the GPU reset epochAhmet Kaan Gümüş · ca831ce
hw_parity example; intra_rate runs both backends; Vulkan device-lost maps to the GPU reset epoch

vk-video-ffi: VK_ERROR_DEVICE_LOST surfaces as Error::DeviceLost, one helper for every Vk error mapping.
ec-hw: DeviceLost bumps the reset epoch via report_gpu_reset; Vk sessions check the epoch on use, new Vk sessions wait out the grace period; the thread-local Gpu is reopened after an epoch change.
lanes: hwvideo statusAhmet Kaan Gümüş · abe484fBrowse files
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>
lanes: hwvideo statusAhmet Kaan Gümüş · 5244564Browse files

2026-11-24

ec-opus: CELT encoder replaced by a port of the libopus 1.6 float encoder (celt_flp: celt_encoder.c, bands, vq, quant_bands, pitch, MDCT/FFT); every Opus packet now byte-identical to libopus 1.6 across VoIP/Audio/LowDelay, mono/stereo, CBR/VBR, FEC on/off, 8-128 kb/s, 2.5-60 ms frames (CELT-only, hybrid, SILK, mode switches, redundancy)Ahmet Kaan Gümüş · e844676
ec-opus: CELT encoder replaced by a port of the libopus 1.6 float encoder (celt_flp: celt_encoder.c, bands, vq, quant_bands, pitch, MDCT/FFT); every Opus packet now byte-identical to libopus 1.6 across VoIP/Audio/LowDelay, mono/stereo, CBR/VBR, FEC on/off, 8-128 kb/s, 2.5-60 ms frames (CELT-only, hybrid, SILK, mode switches, redundancy)

- tonality analysis bit-exact: opus_fft instead of the conjugate inverse FFT, double-precision log/log10/sqrt/floor where libopus uses them, input clamp at +6 dBFS, lsb_depth silence test; always on (libopus runs it at complexity >= 7), detected bandwidth always applied
- libopus low-rate TOC-only packets; self-delimited and multistream 40/60 ms framing; CBR padding is zeros
- hybrid HB_gain is 1 - 2^(-celt_rate/1024) (float SHR32 is a no-op); LowDelay runs dc_reject with total_buffer 0
- silk_LPC_fit chirp constant SILK_FIX_CONST(0.999, 16) = 65470 (was 65471), shared with the decoder
- prev_channels tracked every frame, so stereo->mono switches take libopus's two-frame toMono path
- i16 encode() uses lsb_depth 16 like opus_encode
- old celt_enc.rs encoder, Encoder::last_celt_diag and the probe tests built on it removed
ec-opus: libopus 1.6 opus_encode_native decisions and switch mechanicsAhmet Kaan Gümüş · e7e5914
ec-opus: libopus 1.6 opus_encode_native decisions and switch mechanics

- decide(): stateful port of the libopus mode/bandwidth/stream-channel logic (prev_mode +-4000 hysteresis, auto_bandwidth hysteresis, first, allowBandwidthSwitch / inWBmodeWithoutVariableLP gating, voice_ratio from analysis music prob, stereo_width, decide_fec, SILK<->hybrid by bandwidth); auto-mode configs match libopus on every frame (mono speech, VoIP/Audio, CBR/VBR, FEC on/off, 8-64 kb/s)
- redundancy: 5 ms CELT redundant frames CELT->SILK and SILK->CELT, silk_bw_switch, compute_redundancy_bytes, SILK budget minus redundancy, redundancy signalling, rangeFinal ^= redundant_rng; SILK prefill on CELT->SILK and bandwidth switch; CELT reset + 2.5 ms prefill on mode change
- stereo: stream_channels mono downmix in CELT (CELT_SET_CHANNELS) and SILK, toMono, TOC stereo bit, stereo width + stereo_fade
- hybrid VBR: unconstrained CELT at max(501, bitrate - silk rate), SILK offset to CELT, HB_gain gain_fade; hybrid VBR bytes within 0.5% of libopus (was +10%)
- 40/60 ms CELT/hybrid: per-20 ms budget, repacketizer code 1/2/3 + CBR padding, per-sub-frame analysis info
- delay buffer moved to the Opus layer (libopus delay_buffer)
- SILK-only stays byte-identical to libopus, including bandwidth-switch packets (except the CELT redundant tail)