-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MaxCLL and MaxFALL have no references #337
Comments
That annex is almost entirely just devoted to pseudo code for calculating averages and maximums. As far as how to calculate the light level values, the annex literally just says:
My understanding is that the non-linear to linear conversion can be done based on the contents of the cICP, sRGB, or gAMA chunks (perhaps with a fallback to gamma=2.2 or sRGB if none are present). But the proper strategy for then scaling the output from 0-1 range into a cd/m2 value is less clear. The mDCv chunk is the only one other than cLLi mentioning cd/m2, so presumably the range is sourced from there. But do you convert by linearly interpolating between min and max mastering display luminance? Or perhaps the minimum luminance is only informational and you actually just multiply by the max display luminance? And what if that other chunk isn't present? |
Our open-access SMPTE article [1] "On the Calculation and Usage of HDR Static Content Metadata" has some good discussion of how to set MaxCLL and MaxFALL |
In general, if you don't know how to set MaxCLL and MaxFALL, they should not be set. Default values aren't helpful to the metadata ecosystem. Any values that could be guessed at the file creation stage from other file properties could also likely be guessed in a decoding process from file properties. If a value must be set and is setter does not know the correct value, there is a special value 0 that is reserved to mean "unknown". If a default value were used instead, then a receiver that receives a file containing the default value won't know if that value is actually the correct value or if the creator didn't know what value to use and thus used the default value. This creates an unreliable metadata ecosystem, which is avoided when using the value 0 that means "unknown". |
For a PNG encoder, I agree that it is worth emphasizing that saying "unknown" is far better than making up values. But for a PNG viewer, the plan is to say the contents of the cLLi chunk SHALL be used for tone mapping (#319). Which means that authors of decoders/viewers probably do need to know the meanings of the fields in the chunk if they want to follow that recommendation. But since the fields are defined in terms of how they're calculated, those authors need to understand the calculation process! Even a short non-normative description and/or a link to an (ideally freely available) reference summarizing the ful conversion process between integer pixel values and light levels could go a long way |
It is only defined for color models that use an absolute luminance level. Which means BT.2100 PQ, (and Jzazbz and ICtCp, but those are not RGB models so can't be used in PNG anyway). So maybe we should be more explicit that these are for PQ content. Most RGB models use relative luminance, and so they should not have MaxCLL and MaxFALL anyway. |
@michaeldsmith PNG has a bunch of informative references to tutorial material and your article would make an excellent addition to that! |
This is valuable feedback and we should ensure that other readers of the PNG specification don't have to similarly try to read between the lines to figure out how to do this. So, for a PNG decoder:
A validator like PNGcheck could usefully give a warning if SDR or relative HDR content (BT.2100 HLG) contains OK let's do advice for a PNG encoder:
The spec has advice for when only one of MaxCLL or MaxFALL is known (write zero). I would like to check that knowing only one is actually useful. We should also say that if you don't know both, don't write the chunk at all rather than writing two zeroes. |
|
@svgeesus , did you mean: |
Just checking that a scenario where the encoder can't access every frame in the PNG to calculate MaxFALL and MaxCLL isn't possible? e.g. a live video to PNG converter. If it is, does this need the use of 0 for MaxFALL and MaxCLL mandated? |
Is there a benefit in this rather than just not writing the chunk? Although perhaps, such a streaming encoder could go back and edit the values once the stream is ended. |
When discussing pixel luminance values in the specification, it is not obvious if the achromatic Y or the maximum of R, G or B for that pixel is meant. |
In general luminance in the PNG spec should mean Y (calculated from linear-light R G B) as it does everywhere else in color science; and if we mean max(R' G' B') we should say so explicitly (and not call it luminance). |
@svgeesus - please feel free to reference the article |
@svgeesus - the MaxCLL and MaxFALL definitions use Instead of calling the resulting value a "luminance" we called the result a "light level" since it is not a luminance, except in some cases when the pixel values are on the gray axis pixels R=G=B. I think if you use "MaxRGB light level", it is most clear when talking about MaxCLL and MaxFALL values. @ simontWork @svgeesus - What are the units of the result of PQ_EOTF(R'), or PQ_EOTF(G') or PQ_EOTF(G') ? I think it is a bit awkward to talk about. In BT.2100, see Footnote 4b
In SMPTE ST2084, there is a whole section 4.3 about it |
I think knowing MaxCLL but not knowing MaxFALL is still useful, as the MaxCLL value can be used to set an upper bound for tonemapping input values. For example, see the last section of the paper that I linked to above, Figure 14 shows how MaxCLL can be used for tonemapping. |
…339) * Added improved description to cLLi chunk and references Added improved description to cLLi chunk and references to CTA 861-3 Annex P and SMPTE ST 2067-21 Section 7.5 * additional descriptive info on cLLI added more language around how cLLi optimizes tone mapping * added SDR and HDR references to BT.709 and BT.2100 respectively (issue #346) Tied to issue #346 --------- Co-authored-by: Chris Lilley <chris@w3.org>
Fixed by #351 |
Shouldn't we add a reference to CTA 861.3-A-2016 which is freely downloadable. It even has normative calculation methods in an annex.
The text was updated successfully, but these errors were encountered: