Repository navigation
fix(tonemap): tone-map Dolby Vision 8 from its base layer on QSV and Intel VAAPI - #4104
Conversation
…Intel VAAPI A Dolby Vision source with a standard base layer (compatibility IDs 1-6) resolves to that base's source kind, and every executor is meant to convert the base layer. tonemap_opencl ran those kinds on its default apply_dovi, which reshapes through any single-layer RPU unless the filter's tradeoff mode is on, and that mode depends on the GPU model. A Profile 8.4 file therefore came out visibly different on an Arc or Iris Xe node than on a low-end Intel node, an NVENC node, or the CPU. The OpenCL graph now sets apply_dovi=0 for every kind except the Dolby Vision kind, through the helper tonemap_cuda's graph now shares. The software graph is unchanged: tonemapx reshapes only through a Profile 5 style RPU. Closes #2268 Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 27 minutes. View limit details
|
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:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Problem
Closes #2268
Related issue: N/A
Validation tasks: unblocks #1173 C3; unblocks #1174 C3
Other clients: Apple N/A (server-side transcode output, no client change); Android N/A (same); Roku N/A (same)
A single-layer Dolby Vision file with a standard base layer (Profile 8.1 and 8.4) tone-mapped to SDR differently depending on which GPU transcoded it. On Intel Arc, Iris Xe and UHD 750/770, the QSV and Intel VAAPI path applied the stream's RPU. On low-end Intel integrated GPUs, on NVENC and on the CPU, Silo converted the base layer. A Profile 8.4 file came out visibly different between the two, and a session that moved between executors could change colour mid-stream. This change makes QSV and Intel VAAPI convert the base layer too, so every executor produces the same picture.
The issue names NVENC as the executor that differs. On current main it is the Intel path.
tonemap_openclran these sources on its defaultapply_dovi, which applies any single-layer RPU and forces the input to PQ unless the filter's tradeoff mode is on. jellyfin-ffmpeg turns that mode on for integrated GPUs with fewer than 40 compute units whose name lacks "Arc", "Iris", "Xe", "770" or "750". The software filter does not have this problem:tonemapxreshapes only through an RPU withvdr_rpu_profile0 (Profile 5), and since #2444 pinned the peak its output is byte-identical withapply_dovion or off for the Profile 7, 8.1 and 8.4 sources tested.Approach
tonemap_openclnow getsapply_dovi=0for every source kind exceptdolby_vision, from a helper thetonemap_cudagraph now shares. The NVENC string is unchanged.The software graph keeps the filter default. Setting the option there would not change its output, and it would make a
tonemapxbuild that refuses the option lose every HDR kind, which the capability probe and the protocol doc say it keeps.No API or client change. jellycompat transcodes, prepared downloads and transcode nodes build this graph from the same function.
docs/architecture/playback-protocol-v3.mdnow states the rule and what a GPU filter without the option loses.Validation
gofmt,go mod tidy -diff,go vet,make lint-changed,make lint-router-recovery: pass.make test-go: passes exceptTestCopyRemuxSubtitleRenditionRealFFmpegandTestRunStatsWithRealFFmpeg. Both fail the same way onmainon the host used, which has FFmpeg 6.1.1 instead of the image's jellyfin-ffmpeg.verify-playback-fixtures,verify-local-paths,verify-size-ratchet,verify-case-collisions,verify-bidi: pass. The web checks were not run; no web file changed.apply_dovinow requiresapply_dovi=0on the Intel and NVENC graphs. It fails onmainfor that reason and passes here.main, then rebuilt from this branch (build74e8df11), with the image's jellyfin-ffmpeg 8.1.3. Thetonemap_openclstage each commit builds was run on a synthetic Profile 8.4 clip (HLG base, RPU made with dovi_tool 2.3.4) with tradeoff mode forced off and on. The figures are under Evidence.apply_dovi=1andapply_dovi=0give byte-identical output.hwuploadin place of the VAAPI map. NVENC was not run either; its string is unchanged. No real Profile 8.4 file was available.Evidence
The picture changes for affected titles on affected GPUs. Output of the
tonemap_openclstage on the synthetic Profile 8.4 clip, capable GPU (tradeoff off) against low-end GPU (tradeoff on), 24 frames:main)The 48.8 dB that remains is tradeoff mode's own approximation: the same clip without an RPU shows the same figure before and after. After the change, the capable-GPU output is byte-identical to that clip without an RPU. Output on the low-end path is unchanged. On a real Profile 8.1 frame the capable-GPU output moves by 57 dB, and a Profile 7 frame is unchanged.
Surface and build: FFmpeg output of each commit's filter stage, jellyfin-ffmpeg 8.1.3, build
74e8df11; no client capture.Evidence: https://evidence.siloserver.org/r/silo-server/issue-2268/
Risks
hdr_to_sdr_tonemaprecipe version stays at 1, as it did for fix(tonemap): pin the software tone-map peak so Dolby Vision isn't darkened #2444 and fix(playback): tone-map Dolby Vision Profile 5 through RPU-aware executors #2267. During a rolling upgrade, a session that moves between an old and a new Intel node can change colour on these titles until every node is upgraded. Prepared downloads made on an affected node before the upgrade keep their old picture.tonemap_openclbuild without theapply_dovioption now converts no HDR kind on that executor. jellyfin-ffmpeg has had the option since 5.1, and upstream FFmpeg already rejects this graph'stonemap=bt2390.tonemap_cudaalready had this requirement.Checklist
AI Disclosure
apply_dovi=0on the software graph too. Opus cut that as a change with no effect on output; Sol found it would break the probe test and the doc's promise for atonemapxbuild without the option, so the software graph was left alone. A code review of the diff (three finders and a validation check) found no code defect and no passed validation case changed; it led to two corrected sentences in the protocol doc. A simplify pass renamed one helper. After the pull request opened, an independent adversarial review by gpt-6.1-sol of74e8df11found nothing and posted no review. It read the source and ran the focused tests; it did not rerun the image measurements or test on hardware.🤖 Generated with Claude Code