colorspace: various fixes to pl_hdr_nominal_luma_ex
- Jul 01, 2023
-
-
Niklas Haas authored
Make this less confusing re: HLG, now that we no longer allow users to change the OOTF.
-
Niklas Haas authored
As advertised/documented. Also clamp to the upper bound of 10k nits (sane PQ value range), and handle one hypothetical edge case in which this function would still produce impropertly sanitized outputs.
-
Niklas Haas authored
The old logic incorrectly inferred SDR min_luma from the static max_luma, even if maximum luminance information is known from the metadata. Rewrite the entire code flow to avoid this confusing nested definition and simply apply all relevant metadata types in order of priority, from top to bottom, with fallback to static/fixed metadata at the end. Closes: !487
d525487d -
Niklas Haas authored
Add a series of explicit tests to ensure not regressing this logic during refactors. Note that this function is currently bugged, enshrine these bugged outputs for the time being. Will be fixed in the following commit.
103ca057 -
Niklas Haas authored
In particular, how values of 0 are treated as "unknown / missing".
38d0a682 -
Niklas Haas authored
To be more informative about what values we're setting and why. I also decided to drop the HDR black level default from 1e-7 to 1e-6, after consideration of the human minimum JND.
86318d03 -
Niklas Haas authored
min_luma missing should not count against HDR10 metadata validity, especially given that this value does not matter in practece for PQ clips.
d1f3b0e3 -
Niklas Haas authored
It's better to filter those illegal values out closer to the source (i.e. when parsing the struct).
d2b42bf5 -
Niklas Haas authored
When requesting a dynamic metadata type, we currently fall back to the fixed 10k from PQ. It makes no sense to do so, we should support fallback to static metadata always - especially as we already do this for min_luma.
04e3fd6a -
Niklas Haas authored
Sanity clamp here, to avoid regressing badly broken metadata samples.
b6f2c374
-