Repository navigation
fix(tonemap): preflight VAAPI software decode with the upload playback uses - #2732
Conversation
…k uses On a VAAPI executor that decodes in software, the tone-map source preflight uploaded HDR frames as 8-bit nv12, while playback uploads them as 10-bit p010le, so it checked a conversion playback never runs. The upload is now chosen in one place, tonemap.SoftwareUploadFilter, which the preflight and the runtime graph both use: nv12 for SDR sources and p010le for HDR ones.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…reflight-upload # Conflicts: # internal/tonemap/preflight.go
Review summary (reviewed 53957b2)I found no defects. The VAAPI software-decode preflight now uploads HDR frames as What I checked
Validated features: #1174 C3 (VAAPI HDR-to-SDR on the hardware path) is not run yet, so this PR doesn't change a passed case. When C3 is run on AMD/Mesa, it covers this change. User manual: unaffected. The change is internal to the preflight. Apple/Android: no client-visible change; jellycompat is unaffected. Remaining for maintainers: nothing blocking. The path is still untested on real VAAPI tone-mapping hardware, and the description says so. Fit: 9/10 · Readiness: 9/10 — ready
|
Problem
Closes #2269
Related issue: #1171
Validation tasks: changes #1174 C3 (not run yet)
On a VAAPI executor that decodes in software, the tone-map source preflight tests a different conversion from the one playback runs. It uploads HDR frames to the GPU as 8-bit
nv12, while playback uploads them as 10-bitp010le. The preflight is there to prove the frozen recipe works before the first manifest is published, so depending on the driver it could reject a file playback would convert correctly, or pass one without testing the 10-bit path.Approach
The upload is now built in one place,
tonemap.SoftwareUploadFilter:nv12for SDR sources andp010lefor HDR ones, as playback already did. The preflight'stonemap_vaapipath uses it,intelOpenCLPreflightUpload(added in #2734 for QSV and Intel VAAPI on OpenCL, which already uploadedp010le) now calls it instead of repeating the choice, andsoftwareToneMapUploadFilterin playback uses it too, so preflight and playback can't drift apart again.Validation
go test ./internal/tonemap/: passes. The VAAPI preflight test now checks PQ, HLG and SDR uploads; the PQ and HLG cases fail on main.go test ./internal/playback/ -run 'Upload|SoftwareDecode|SoftwareVideoDecode|ToneMap': passes apart fromTestPrepareFileDoesNotDropHardwareToneMapGraphOnSoftwareRetry, which fails the same way on main on macOS (its fake ffmpeg script never writes its invocation log there). Left to CI on Linux.go veton both packages: clean. Lint: left to CI.Evidence
The start of the preflight's video filter for a PQ source on a VAAPI executor with software decode, on main (365e3d4) and this branch (9c76b58):
Nothing else in the command changes, and the runtime graph was already
p010le. A viewer only sees a difference when the preflight's answer changes for a file, which I haven't reproduced on hardware.Risks
Since #2734, Intel VAAPI tone maps HDR on OpenCL, whose preflight already uploaded
p010le. This change covers the remainingtonemap_vaapipath, mostly AMD/Mesa VAAPI, where 10-bit uploads haven't been checked on hardware either. A driver that can't take ap010leupload now fails the preflight instead of passing it, which is the point: playback would have failed on the same upload.Checklist
AI Disclosure
SoftwareUploadFiltermatches the old runtime choice for every source kind, that the QSV preflight order is unchanged, that every VAAPI and QSV software-decode graph in playback goes through the shared helper, and that the new subtests fail on main. It found no correctness problem.Note
Fix software-decoded VAAPI preflight to use 10-bit upload format for HDR
Adds
tonemap.SoftwareUploadFilter, a shared helper that picks the 8-bit upload format for SDR sources and the 10-bit format for non-SDR sources, then builds the hardware-upload filter. Previously the software-decoded VAAPI preflight graph always used the 8-bit format; playback and the Intel OpenCL preflight now share the same helper instead of local copies.Macroscope summarized 53957b2.