Skip to content
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

Some tone mapping requires the average luminance between frames #311

Open
ProgramMax opened this issue May 3, 2023 · 10 comments
Open

Some tone mapping requires the average luminance between frames #311

ProgramMax opened this issue May 3, 2023 · 10 comments

Comments

@ProgramMax
Copy link
Collaborator

SMPTE ST 2094-10 requires the average luminance between frames in order to apply its tone mapping.
Currently, this metadata is not provided in PNG.

(There is MaxFALL information, which is the maximum of the averages. But that is separate from the actual content average.)

If SMPTE ST 2094-10 is a tone mapping method we wish to support (which is likely), we will want a metadata chunk which carries this information.

@svgeesus
Copy link
Contributor

Is there an existing standard for metadata which provides this, or does the SMPTE spec expect it to be computed on-the-fly?

Also does it use actual luminance (computed from a weighted sum of linear-light rgb values) or is it a max of gamma-encoded rgb values?

@ProgramMax
Copy link
Collaborator Author

I assume the average luminance is supposed to be pre-computed and not on-the-fly. This is only an assumption. But it seems like on-the-fly would result in the tone mapping constantly adjusting and I don't recall any smoothing in SMPTE ST 2094-10. So it could have large jumps between frames.

I have no idea if it is gamma-encoded or linear-light. If I get another look at SMPTE ST 2094-10, I'll try to check.

@digitaltvguy
Copy link
Contributor

digitaltvguy commented May 15, 2023

I assume a different average luminance value is only needed for animated PNG since MaxFALL value of one frame will be the same as the ST 2094-10 Average? ....since the MaxFALL of a still, single frame would be the Max.....

@ProgramMax
Copy link
Collaborator Author

Correct.
Although, if SMPTE ST 2094-10 doesn't require MaxCLL, perhaps the cLLi chunk is a bit unwieldy even for single-frame PNGs.

@palemieux
Copy link
Contributor

The average in ST 2094-10 is based on the average of code values, whereas MaxCLL is the average of linear light levels, so the two are not identical.

ST 2094-10 is not the only tone mapping algorithm, and we might wish to consider one that does not rely on the average, but only on min and max values -- which can be inferred from the ST 2086 metadata.

@ProgramMax
Copy link
Collaborator Author

It isn't within our power to choose which tone mapping method the client uses, right?

@palemieux
Copy link
Contributor

palemieux commented May 16, 2023

I think we should recommend one.

See a few examples at https://www.sandflow.com/public/tone-mapping/.

@digitaltvguy
Copy link
Contributor

digitaltvguy commented May 18, 2023

Should we add a reference white chunk instead of an average luminance? This defines the level for compositing in HDR Canvas also doesn't it?

@palemieux
Copy link
Contributor

Should we add a reference white chunk instead of an average luminance?

I do not understand how this is useful and/or replaces MaxFALL ?

@digitaltvguy
Copy link
Contributor

It doesn't. It's in addition. Since China prefers a higher reference white, not documenting the reference white can cause an issue with tone-mapping (highlight compression would likely happen more aggressively above reference/graphic white). This is how the all single-master workflows work right now in live-linear broadcasts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants