mirror of
https://github.com/games-on-whales/gst-wayland-display.git
synced 2026-10-15 12:51:57 +00:00
[PR #66] patches: fix vulkanh265enc reference sets and IDR output flag #65
Labels
No labels
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/gst-wayland-display#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/gst-wayland-display/pull/66
Author: @salty2011
Created: 9/25/2026
Status: 🔄 Open
Base:
feat/vulkan-encode← Head:fix/vulkanh265enc-rps📝 Commits (6)
5597fc4patches: vulkanav1enc + encode-family fixesf1e67afdocker: apply the full patch chain in the vulkan image8bc3630patches: address review on AV1 caps and live-retarget threading6b4dd3bci: build the patched GStreamer with tests and run the Vulkan testse9e1237patches: narrow vulkanh265enc to the profiles it can encodef81f3f0patches: fix vulkanh265enc reference sets and IDR output flag📊 Changes
11 files changed (+7115 additions, -97 deletions)
View changed files
➕
.github/workflows/gst-patches.yml(+58 -0)📝
.gitignore(+1 -0)📝
ci/README.md(+14 -0)➕
ci/gst-patches.sh(+84 -0)📝
docker/vulkan.Dockerfile(+9 -6)📝
patches/README.md(+31 -7)➕
patches/gstreamer-vulkan-rc-retarget-no-reset.patch(+137 -0)➕
patches/series(+7 -0)➕
patches/vkh264enc-rc-fix.patch(+286 -0)➕
patches/vulkanav1enc.patch(+6026 -0)📝
patches/vulkanh265enc.patch(+462 -84)📄 Description
Stacked on #62. Review only the last commit,
f81f3f0. The rest is #62 and drops out of this diff once it merges.Summary
vulkanh265encwrote H.265 streams that decoders reconstruct from the wrong pictures whenever a picture had more than one reference, which is the default (num-ref-frames=3). With B frames, decoders also dropped a frame at the end of every GOP.POCs advance by 2 per frame, so each entry left at 0 named an odd POC that doesn't exist. Meanwhile the driver was handed
len(list0)distinct pictures as active references, while a decoder resolved them all to the one picture flagged as used.New test,
elements_vkh265enc(added toci/gst-patches.sh). It parses the encoder's output withGstH265Parserfor P and B GOPs, and checks:no_output_of_prior_pics_flagEvidence
RTX 5090, driver 610.57.04, GStreamer 1.28.4 with
patches/series. Decoding uses ffmpeg-err_detect +explodeandvulkanh265dec, which gave identical results in every run. PSNR is the decoded Y plane against the lossless source, compared raw to raw.Before: 1080p60, 600 frames, CBR 8 Mbps, defaults:
Could not find ref with POC <odd>b-frames=2: 300 access units, 296 decodedThe new test against the old code:
After: same encode: 0 decode errors, 92.6 dB, 0/600 below 30 dB.
ci/gst-patches.sh: 6/6 OK. 25 serial repeats: 150/150.b-frames=2,b-frames=3 b-pyramid=true,idr-period=240, and Main 10 from P010.waylanddisplaysrc vulkan=true ! vulkanh265enc: 240/240 frames, 0 errors.b-frames=2.Not fixed here. All of these are the same on #62 without this commit:
b-pyramid=truevalidation errors:VUID-vkCmdEncodeVideoKHR-flags-08347/08348. It puts B pictures in the reference lists without checkingB_FRAME_IN_L0/L1_LIST, and stockvkh264encdoes the same. The output still decodes cleanly.waylanddisplaysrc vulkan=true ! vulkanh265enc b-frames=2hangs;vulkanh264enc b-frames=2doesn't.gpuphase crash:test_vulkan_encode_pipelinenow gets past H.265 start, and then hits a crash in stockvulkancolorconvert: RGBA→NV12 incalculate_reorder_indexes, which crashesvulkanh264enctoo.Merge Danger
Door: two-way
Patch-only change to a vendored encoder. A revert restores the old bytes exactly.
Blast Radius: H.265-only
It changes the H.265 slice headers every
vulkanh265encstream carries, P frames included. The new headers are what a conforming decoder already expects; the old ones only decoded correctly when every picture had a single reference. H.264 and AV1 are untouched.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.