Repository navigation
NAT-550: Add opt-in HDR-to-SDR tone mapping - #173
Merged
eugene-mux merged 4 commits intoOct 28, 2026
Merged
Conversation
eugene-mux
force-pushed
the
em/nat-550-hdr-tone-mapping
branch
from
October 22, 2026 23:02
76171b3 to
8d68e26
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 812fb82. Configure here.
daytime-em
approved these changes
Oct 28, 2026
eugene-mux
merged commit Oct 28, 2026
a51b41c
into
feature/nat-534-hevc-standard-ingest
2 checks passed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Add opt-in HDR-to-SDR tone mapping for supported H.264/HEVC HLG and PQ inputs, preserving the codec family. Preserve remains the default; unsupported or failed conversions retain original-file fallback.
Changes
Validation
Note
Medium Risk
Changes video export, HDR/color handling, and capability gating on the standardization path; mitigated by opt-in API, strict preflight, and original-file fallback on failure.
Overview
Adds an opt-in HDR→SDR tone-mapping path for supported H.264/HEVC HLG and PQ inputs when
toneMapsToSdris set (e.g. viaHdrHandling.ToneMapToSDR), while preserve stays default and failures still fall back to the original file.Planning & gates:
SdrEncodingTargets.fromno longer blanket-rejects tone mapping; it requires BT.2020 color evidence, matching codec/profile/pixel format, and records source frame rate for decoder preflight. Capability checks add API 29+, an OpenGL YUV-target probe, HDR decoder format validation, and BT.709 limited SDR encoder format support.Export: Media3 composition uses
HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL(not metadata-only HDR keep), and the strict encoder factory insists onColorInfo.SDR_BT709_LIMITEDwhen tone mapping.Validation: Post-export checks add
OutputExpectation.Color—tone-mapped outputs must show BT.709 / SDR video transfer / limited range in inspected metadata, not just SDR dynamic range.Reviewed by Cursor Bugbot for commit 812fb82. Bugbot is set up for automated code reviews on this repo. Configure here.