w3c / ttml2

Timed Text Markup Language 2 (TTML2)
https://w3c.github.io/ttml2/
Other
40 stars 16 forks source link

Change to Appendix Q.2 #496

Closed simontWork closed 6 years ago

simontWork commented 6 years ago

Description:

The gamma value used in item three of Q2 includes a psychovisual rendering for sRGB under reference conditions. The HLG signal does not include such an adjustment, therefore this gamma value should be 2.0 not 2.2. Uncorrected this error would result in pictures looking too dark in the mid-tones. A note is required to clarify that this gamma is intentional and not an error.

Required change:

The following equation:

(r2.2,g2.2,b2.2) → (r,g,b)

should be changed to:

(r2.0,g2.0,b2.0) → (r,g,b)

The note at the end of Q.2 should have the following text added:

The gamma index 2.0 is intentionally different from gamma 2.2 specified in IEC/4WD 61966-2-1: Colour Measurement and Management in Multimedia Systems and Equipment - Part 2-1: Default RGB Colour Space – sRGB. The value 2.2 from the specification is specific to the viewing environment specified therein, and includes a psychovisual rendering adjustment for those conditions. This adjustment is not required for an HLG signal, which excludes display rendering.

nigelmegitt commented 6 years ago

@simontWork the document you reference should be entered as an informative reference (appendix L) - please could you provide a link here for use in the change?

simontWork commented 6 years ago

https://webstore.iec.ch/publication/6169

timborer commented 6 years ago

The reference is already in K under SRGB

nigelmegitt commented 6 years ago

Thanks @simontWork I've opened a pull request to apply those changes. In passing I noticed that there were some missing subscripts which I've now added, in step 11. If that's wrong please shout!

I made one tiny wording edit to your proposed note, changine "from the specification" to "from that specification" for clarity. It seemed to me that rather than being an addition to the existing note it is a new note in its own right, so I added it that way. Again, if I misunderstood let me know and I'll edit it to be a new paragraph in the same note.

nigelmegitt commented 6 years ago

@timborer Oops! Thanks. Will fix.

svgeesus commented 6 years ago

This is weird, because 61966-2-1 does not specify a gamma 2.2 transfer function.

The transfer function is C'=12.92 C for C ≤ 0.0031308 C'=1.055 C1/2.4 -0.055 for C > 0.0031308

(Whether you then apply a supplemental psycho-visual correction is a somewhat orthogonal issue)

svgeesus commented 6 years ago

Also the reference should include amendment 1, so it is in fact https://webstore.iec.ch/publication/6168

timborer commented 6 years ago

Hi Chris, The version of 61966-2-1 that I have clearly specifies a display gamma of 2.2 in equation 1 (I’m using working draft 4 at the moment – if someone would like to supply me a more up to date version it would be most welcome). The display gamma is the display LUT multiplied by the display characteristic. In the past the display characteristic was that of a CRT. Now, even though we have a plethora of display types with differing display characteristics, the actual display units (the “glass” as it is known) still present a gamma characteristic to the preceding signal processing (this is achieved by means of a non-linear DAC). The display gamma converts the signal into displayed light on the screen. The characteristic you refer to is the encoding characteristic (employed in the notional or real camera). It converts relative linear scene light into a signal. There is a non-linearity, to allow for various psychovisual effects, between the scene light and the displayed light. So displayed light is NOT (in general) linearly proportional to the scene light. That is, the scene encoding characteristic (the OETF in ITU terminology) multiplied by the display characteristic (the EOTF) is not a linear function. The encoding characteristic, defined in section 3, includes a linear section near black. With a camera, and in ITU-R BT.709, this linear portion of the encoding characteristic is related to reducing the noise in the camera signal. The linear portion of the curve, combined with the display characteristic (which does not simply invert the encoding characteristic) implements “coring” (i.e. reduction of small signal values, google “video noise coring”) to reduce camera noise. This is rather anachronistic and is achieved in different ways in modern cameras. In the latest ITU recommendation (ITU-R BT.2100), after considerable discussion, this linear part of the encoding characteristic was omitted. Because the linear portion near black is related to noise reduction we need to consider the effective encoding characteristic without this linear portion. We can estimate this by working backward from the display gamma and removing the psychovisual component. SRGB is widely considered compatible with ITU-R BT.709, indeed there is an annex in 61966-2-1 to this effect. In BT.709 the psychovisual gamma is 1.2, the display gamma is 2.4 (specified in BT.1886), leaving a scene encoding characteristic of gamma 0.5. You can also work forward from the BT.709 OETF to estimate the same result (without relying on knowing the psychovisual gamma), this is done in Poynton, C. Perceptual uniformity in Digital Imaging,” Proc. Gjøvik Color Imaging Symposium (GCIS 2009): 102–109 ( lightly edited version of which is available online in www.poynton.com/notes/PU-PR-IS/Poynton-PU-PR-IS.pdf) and elsewhere. sRGB is typically viewed in considerably brighter conditions than BT.709 reference viewing conditions. So it makes sense that sRGB display gamma is lower, at 2.2, that BT.709 display gamma at 2.4. Since we are considering the use of HDR on the web we are focusing on pictures. So the compatibility of sRGB with BT.709 is important (arguably BT.709 being most relevant of pictures and sRGB for graphics). So, finally after that long explanation, we are assuming that the effective encoding gamma curve (OETF) for sRGB is the same as for BT.709, equal to 0.5. The exponent 2.0 in the reciprocal of 0.5 and is used to undo the OETF (i.e. apply the inverse OETF) to regenerate scene linear light. HLG is an encoding of relative scene linear light. Once we have the scene linear light then we can simply apply the HLG encoding OETF to get the HLG signal. Note that the HLG signal, like sRGB and BT.709, does not include a psychovisual adjustment. This is applied at the display rendering where the screen brightness and viewing conditions are known (or can be assumed). This allows HLG to be correctly rendered irrespective of the display brightness and in varying viewing environments. Hope this rather longwinded explanation make the application of the exponent 2.0 less weird. Best regards, Tim

Dr Tim Borer MA, MSc, PhD, CEng, MIET, SMIEEE, Fellow SMPTE Lead Engineer Immersive & Interactive Content BBC Research & Development BBC Centre House, 56 Wood Lane, London W12 7SB

On 20/11/2017 00:47, Chris Lilley wrote:

This is weird, because 61966-2-1 does not specify a gamma 2.2 transfer function.

The transfer function is C'=12.92 C for C ≤ 0.0031308 C'=1.055 C^1/2.4 -0.055 for C > 0.0031308

(Whether you then apply a supplemental psycho-visual correction is a somewhat orthogonal issue)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/ttml2/issues/496#issuecomment-345565047, or mute the thread https://github.com/notifications/unsubscribe-auth/AgMSzEdIveKwsrtZeFnBB3RbhsfyRPraks5s4MwsgaJpZM4QiD4D.

simontWork commented 6 years ago

The transform needs to run in a television subtitle graphics plane.

Even if we agreed that the correct method was to invert the encoding function (which we don't), there is not usually any ability to do conditional mathematics on the graphics plane. You would need to approximate the transform with a gamma curve.