Repository navigation
present: Use 100 nits for the BT.2446 SDR constants - #1244
Merged
Merged
Conversation
P_SDR and LOG_P_SDR were folded at about 87 nits, so the SDR side of Method A disagreed with hdr_uniforms and SDR white mapped to 0.9995 of the peak. Set both to the formula's values at L_SDR = 100 and add a test that reads the literals from the MSL and checks them against the formula.
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.
The BT.2446 Method A inverse tone map uses SDR constants in
present.mslthat do not match the formula next to them. SDR white maps to 0.9995 of the peak instead of the peak, and midtones come out darker than the curve intends.Cause
P_SDR = 5.4395284707is1 + 32 * (L / 10000)^(1/2.4)at about 87 nits, not atL_SDR = 100. At 100 nits the formula gives 5.6969577.LOG_P_SDR = 1.6937747is not the natural log of either value. ln(5.6969577) = 1.7399323.hdr_uniformscomputes the HDR side from the same formula at 100 nits, so the two sides disagree, also at peak 1.0.Changes
P_SDRandLOG_P_SDRare set to the formula's values at 100 nits.bt2446_sdr_constants_match_the_formulareads the literals from the MSL and checks them against the formula and againsthdr_uniforms(1.0). It needs no Metal device.Effect
Alternatives
P_SDRin Rust and passing it in the uniform buffer: grows the 16-byte uniform for a value that never changes.Verification
P_SDR is 5.4395284707, the formula gives 5.696957656390622 at L_SDR = 100) and passes after.cargo +nightly fmt --check: clean.cargo +stable clippy --all-targets --config 'build.warnings="deny"', normal andPERF=1: clean.cargo +stable nextest run: 850 passed, 2 skipped; 852 passed withPERF=1.make audit: clean.make docand the e2e suite. No windows code changed.