w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.35k stars 639 forks source link

[css-color-hdr] Absolute luminance of PQ #10460

Open swick opened 1 week ago

swick commented 1 week ago

The spec makes the follow claim (https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-pq):

In contrast to SDR color spaces and some HDR color spaces, the PQ values are absolute rather than relative.

I think this is at best very confusing. For example, rec2100-linear has the exact same peak white luminance, black luminance and white luminance but isn't said to have "absolute values". Are the values behaving differently? I don't believe they should.

To take it even further, sRGB according to the "Controlling Dynamic Range" section (https://drafts.csswg.org/css-color-hdr/#controlling-dynamic-range) has (reference and peak) white defined at a luminance of 80 cd/m² and black at 0.2 cd/m². Is this not absolute? How is this different than the PQ absoluteness?

Personally, I don't think that PQ is any more or less absolute than any other fully color space + reference display + reference viewing environment combination, it just chose put the absolute luminance directly in the definition of the curve instead of implicitly over the definition of the reference display.

This has been abused to not properly anchor SDR and HDR content and, at the actual display, have HDR content at a fixed luminance, while SDR content will have different luminances depending on some brightness setting.

DanMan commented 1 week ago

One of the often overlooked potential issues with PQ based HDR for home viewing is that because the standard is absolute there is no way to increase the display's light output to overcome surrounding room light levels - the peak brightness cannot be increased, and neither can the fixed gamma (EOTF) curve.

Referring to PQ as an 'absolute' standard means that for each input data level there is an absolute output luminance value, which has to be adhered to. There is no allowance for variation, such as changing the gamma curve (EOTF), or increasing the display's light output, as that is already maxed out. (This statement ignores dynamic metadata, more on which later.)

Source: https://lightillusion.com/what_is_hdr.html

Personal opinion: One thing HDR10 tried to achieve is that the image at home ought to match what the engineer saw on his monitor (and then fall off where the TV is inferior). That's why you need to adjust your viewing surrounding, because you can't increase brightness to adjust for daylight viewing conditions. Something for which TV manufacturers have added new settings to mitigate the issue.

swick commented 1 week ago

Source: https://lightillusion.com/what_is_hdr.html

I would like to have a more authoritative source on this. The spec itself never talks about absolute luminance, it only assigns the reference display luminances to code points which could be done with any spec such as sRGB.

One thing HDR10 tried to achieve is that the image at home ought to match what the engineer saw on his monitor (and then fall off where the TV is inferior).

That seems to be true for any other spec as well. If you match the viewing environment at home, you should see what the engineer saw on his monitor.

svgeesus commented 1 week ago

I think this is at best very confusing. For example, rec2100-linear has the exact same peak white luminance, black luminance and white luminance but isn't said to have "absolute values". Are the values behaving differently? I don't believe they should.

Yes, they are - and the difference is the PQ transfer function which is defined in terms of absolute luminance values.

Contrast that with 2100 HLG, which is relative (0.75 code value is media white, which can be made brighter or dimmer).

sRGB according to the "Controlling Dynamic Range" section (https://drafts.csswg.org/css-color-hdr/#controlling-dynamic-range) has (reference and peak) white defined at a luminance of 80 cd/m² and black at 0.2 cd/m². Is this not absolute? How is this different than the PQ absoluteness?

That definition is also present in CSS Color 4 0.2. The Predefined sRGB Color Space: the [sRGB](https://drafts.csswg.org/css-color-4/#valdef-color-srgb) keyword. It is relative colorimetry: the reference display does indeed have a media white at 80 cd/m2 but industry practice is to turn this up or down to suit personal preference or viewing conditions.

This has been abused to not properly anchor SDR and HDR content and, at the actual display, have HDR content at a fixed luminance, while SDR content will have different luminances depending on some brightness setting.

It isn't clear how that is abuse.

DanMan commented 1 week ago

I would like to have a more authoritative source on this. The spec itself never talks about absolute luminance, it only assigns the reference display luminances to code points which could be done with any spec such as sRGB.

What do you mean "could be done"? How is that relevant?

The PQ format handles display luminance values up to a maximum of 10,000 cd/m2 as absolute values. It introduces a new transfer function considering efficient bit allocation on the basis of human visual characteristics that cover a wide luminance range. As an absolute luminance format, video signals have a unique correspondence with luminance values reproduced on the display, which means that the range of video signals that can be displayed depends on the peak luminance of the display. The EOTF of this format was specified in ST 208412) of the Society of Motion Picture and Television Engineers (SMPTE) in 2014 as a reference display standard for use in HDR production.

Source: https://www.nhk.or.jp/strl/english/publica/bt/70/2.html

NHK is basically the Japanese BBC. So it's absolute in the sense that there is a 1:1 mapping of video signal to luminance on the display. If a signal would result in a luminance that's too high for the display to show, the 2020 spec only allows for some way of falloff like clipping. One is not supposed to fit the luminance range into what the display can show across the whole spectrum. Only at the very top for out of range values.

Making it fit somehow is what HLG was made for.

svgeesus commented 1 week ago

@chrisn

swick commented 1 week ago

Source: https://www.nhk.or.jp/strl/english/publica/bt/70/2.html

Funnily it says, and I quote "The video signals of the HLG and PQ formats can be mutually converted. A framework for the conversion is described in Report ITU-R BT.2390."

If that's the case, then the PQ signal which got converted to HLG will be re-rendered by the HLG OOTF on the display to adjust for the viewing environment and whatever luminance was encoded in the PQ signal isn't the one which will be displayed.

PQ is no different than any other display referred signal. They all describe the absolute luminance on the reference display (i.e. the "absolute" luminance is referring to the reference display).

Displays do re-render the images to adjust between the differences between the reference display and reference viewing environment and the actual display and actual viewing environment. Mostly crude methods until now of backlight control, brightness and contrast sliders.

DanMan commented 1 week ago

the PQ signal which got converted to HLG…

…is then not a PQ signal anymore. So how does that matter?

PQ is no different than any other display referred signal. They all describe the absolute luminance…

So you agree it's absolute? I'm confused about what point you're trying to make. Again, the spec basically says that for video signal X, the display is supposed to render at luminance Y, does it not?

…on the reference display

Which the viewing display is supposed to follow as closely as possible, right? Exactly because display-referred LUTs match the colours on the reference monitor. If the viewing display didn't follow that, what's the point in having a display-referred LUT/TF in the first place?

Displays do re-render the images to adjust between the differences between the reference display and reference viewing environment and the actual display and actual viewing environment.

But you don't have much control over that as consumer. The display will switch the LCD backlight to max brightness, if a HDR10 signal is detected. You're then at the mercy of the display in terms of tone mapping. But that's irrelevant from the POV of the spec, which defines a 1:1 mapping of input signal to luminance. Don't you agree?

swick commented 6 days ago

Which the viewing display is supposed to follow as closely as possible, right?

No, this is probably the part that is so problematic. The reference display and viewing environment are in practice only followed when content is mastered but not when it is consumed. The solution has always been to "add a re-rendering step (OOTF) to account for non-reference viewing conditions" and is done by backlight/brightness/contrast control on displays most of the time. The quote is from css-color-hdr (https://drafts.csswg.org/css-color-hdr/#Compositing-SDR-HDR).

This is also exactly how SDR content is handled. sRGB has a reference viewing environment and a reference display which means an sRGB signal is "absolute luminance", but people do constantly re-render sRGB because they view it in varying viewing conditions.

If you call PQ an absolute luminance signal, so is sRGB.

It's not wrong to call them absolute luminance if you understand that this is only the case with a fixed display and viewing environment. If you have a variable viewing environment, neither sRGB nor PQ content should produce a constant luminance because the entire goal of the exercise here is to preserve the appearance.

Even more concerning, if you have an HLG signal and a fixed viewing environment, isn't the HLG signal not also producing absolute luminance?

Luminance is always absolute. If you have a fixed viewing environment and fixed display every signal produces absolute luminance.

What differentiates PQ and HLG isn't "absolute luminance", it is that PQ is display-referred and HLG is scene-referred.

But that's irrelevant from the POV of the spec, which defines a 1:1 mapping of input signal to luminance. Don't you agree?

No, see above. Even the spec currently allows for a color re-rendering step.

swick commented 6 days ago

I think the changes to css-color-hdr I would like to see are

  1. Get rid of absolute and relative luminance terminology
  2. Stress that PQ is display-referred and HLG is is scene-referred instead
  3. For composition, be clear about anchoring and specify that SDR, PQ and HLG signals shall be combined such that their reference white level will end up at the reference white level of the combined signal.
  4. Specify that a color re-rendering step is allowed on the combined signal.