Skip to content

fix(tonemap): tone-map Dolby Vision 8 from its base layer on QSV and Intel VAAPI - #4104

Merged
Quick104 merged 1 commit into
mainfrom
fix/issue-2268-dv-standard-base-apply-dovi
Nov 13, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/issue-2268-dv-standard-base-apply-dovi

Conversation

@Quick104

@Quick104 Quick104 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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_opencl ran these sources on its default apply_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: tonemapx reshapes only through an RPU with vdr_rpu_profile 0 (Profile 5), and since #2444 pinned the peak its output is byte-identical with apply_dovi on or off for the Profile 7, 8.1 and 8.4 sources tested.

Approach

tonemap_opencl now gets apply_dovi=0 for every source kind except dolby_vision, from a helper the tonemap_cuda graph 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 tonemapx build 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.md now states the rule and what a GPU filter without the option loses.

Validation

  • Go: build, gofmt, go mod tidy -diff, go vet, make lint-changed, make lint-router-recovery: pass.
  • make test-go: passes except TestCopyRemuxSubtitleRenditionRealFFmpeg and TestRunStatsWithRealFFmpeg. Both fail the same way on main on the host used, which has FFmpeg 6.1.1 instead of the image's jellyfin-ffmpeg.
  • Generated contracts and docs hygiene: 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.
  • The existing test that pinned the Intel graph to carry no apply_dovi now requires apply_dovi=0 on the Intel and NVENC graphs. It fails on main for that reason and passes here.
  • Reproduced on an isolated Silo dev deployment built from main, then rebuilt from this branch (build 74e8df11), with the image's jellyfin-ffmpeg 8.1.3. The tonemap_opencl stage 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.
  • Software was checked on 15 frames from five real titles (three Profile 8.1, two Profile 7) and on the 8.4 clip: the graph as built, apply_dovi=1 and apply_dovi=0 give byte-identical output.
  • Not run: Intel hardware. OpenCL ran on a CPU runtime (PoCL), with hwupload in 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_opencl stage on the synthetic Profile 8.4 clip, capable GPU (tradeoff off) against low-end GPU (tradeoff on), 24 frames:

PSNR SSIM Mean Y/U/V on the capable GPU
Before (main) 23.5 dB 0.975 146.1 / 127.0 / 113.0
After 48.8 dB 0.999 127.8 / 132.8 / 124.0

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

  • Dolby Vision files with a single-layer RPU and a standard base look different on QSV and Intel VAAPI nodes that ran the filter without tradeoff mode: Profile 8.4 visibly, Profile 8.1 by an amount too small to see. They now match every other executor.
  • The hdr_to_sdr_tonemap recipe 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.
  • A tonemap_opencl build without the apply_dovi option now converts no HDR kind on that executor. jellyfin-ffmpeg has had the option since 5.1, and upstream FFmpeg already rejects this graph's tonemap=bt2390. tonemap_cuda already had this requirement.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code in T3 Code; Codex in T3 Code for one plan review
  • Tool(s): Claude Code, Codex, GitHub CLI, jellyfin-ffmpeg 8.1.3, dovi_tool 2.3.4, PoCL
  • Model(s): claude-fable-5-2 (implementation and review); gpt-6.1-sol and claude-opus-5-5 (plan review); claude-sonnet-5-5 (one review finder and the validation check)
  • Involvement: Fully AI-generated at the maintainer's direction; the maintainer has not yet reviewed the diff
  • Adversarial review: Before implementation, gpt-6.1-sol attacked the plan and claude-opus-5-5 cut it down. The first plan set apply_dovi=0 on 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 a tonemapx build 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 of 74e8df11 found 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

…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]>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f656d03f-0a91-4a1b-a78a-88b0981483b1
Commits

Reviewing files that changed from the base of the PR and between 2e05489 and 74e8df1.

Files selected for processing: 3

  • docs/architecture/playback-protocol-v3.md
  • internal/tonemap/tonemap.go
  • internal/tonemap/tonemap_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T19:58:44.521000Z 74e8df1 PR opened
🔒 Security Review ✅ Completed 2026-11-13T20:01:26.748447Z 74e8df1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-triage silo-triage Bot added size/M 50–199 added + deleted lines (all files); change volume, not priority. bug Something isn't working go Pull requests that update go code impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish labels Nov 13, 2026
@Quick104
Quick104 merged commit aa9684d into main Nov 13, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/issue-2268-dv-standard-base-apply-dovi branch November 13, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Dolby Vision 7 and 8.x tone-map differently on NVENC than on software and QSV

1 participant