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

Add support for compositing a TTML2 document onto HDR video #233

Closed
palemieux opened this issue Jan 11, 2017 · 23 comments
Closed

Add support for compositing a TTML2 document onto HDR video #233

palemieux opened this issue Jan 11, 2017 · 23 comments

Comments

@palemieux
Copy link
Contributor

palemieux commented Jan 11, 2017

Colors in TTML2 documents are specified using sRGB. This yields ambiguities when compositing such documents onto HDR video, whose allows peak luminance much higher than that associated with sRGB, e.g. ITU Rec 2100 allows luminance values up to 10000 cd/m^2 while sRGB specifies a reference white of 80 cd/m^2.

As a practical example, white sRGB caption text should rarely, if ever, be composited onto HDR video assuming that sRGB (255,255,255) maps to peak HDR white: the resulting text would be unacceptably brighter than the rest of scene, whose average luminance is typically far below peak HDR white. At what luminance level should sRGB captions be composited onto HDR images -- without having to define new colorspaces and encodings for TTML2?

To allow authorial control of the compositing of TTML2 documents onto HDR images, the attached proposes an tts:hdrAbsoluteLuminanceGain attribute, which allows the normalized rgb components of each pixel of a region to be mapped to absolute optical output components (in cd/m^2)

(R, G, B)= 80 cd/m^2 ∙ hdrAbsoluteLuminanceGain ∙ (r, g, b)

It would also be useful to note that, in the case of image-based subtitles, tts:tts:hdrAbsoluteLuminanceGain is not necessary if the image is an HDR image.

@skynavga
Copy link
Collaborator

skynavga commented Jan 12, 2017 via email

@palemieux
Copy link
Contributor Author

  • should be defined in ttp rather than tts namespace, since it is
    effectively a processing parameter that applies to entire document, i.e.,
    would/should not vary within document;

The parameter would apply to individual regions and would change across the timeline of the document, to match the underlying HDR video.

specification text would have to weigh in on handling of HDR images, i.e., can't just say nothing

Ok. Are you thinking of listing, as examples, the concrete transformations involved in compositing sRGB + tts:hdrAbsoluteLuminance onto an HDR image?

@simontWork
Copy link

It should be noted that ITU-R BT.2100 contains 2 signal specifications for HDR video, one of which is based on absolute light (PQ) and one of which is based on relative light (HLG). Any standard for the display of subtitles should contain methods for both systems.

For the relative system, a luminance mapping in either the linear scene light or linear display light domain, and a colour gamut conversion is required. One method of doing this is as follows:

  • Convert sRGB to CIE Yu'v'
  • Scale Y (and adjust gamma for critical, non-graphics applications)
  • Convert CIE Yu'v' to RGB2020_NCL
  • Apply HLG opto-electronic transfer function

@palemieux
Copy link
Contributor Author

@simontWork This proposal is intended to address compositing onto absolute luminance images. To address compositing on HLG images, either (i) a separate ticket should be filed or (ii) concrete tweaks to this proposal suggested (assuming a single parameter can handle both).

@nigelmegitt
Copy link
Contributor

@palemieux Given that this issue is non-specific about the HDR system, I think @simontWork 's comments are entirely relevant here, and actually rather useful since they suggest that no further parameters or style attributes are required to support relative system HDR.

@palemieux
Copy link
Contributor Author

@nigelmegitt I am not sure what @simontWork is proposing then. Perhaps you can shed some light?

@simontWork
Copy link

@palemieux For each colour used for subtitle text in the SDR domain, a simple mapping can be applied to provide RGB or YCbCr co-ordinates in the relative HDR domain, so there is no need for metadata (apart from signalling of the subtitle colour format if more formats than sRGB format subtitles are available).

@palemieux
Copy link
Contributor Author

palemieux commented Feb 13, 2017

For each colour used for subtitle text in the SDR domain, a simple mapping can be applied to provide RGB or YCbCr co-ordinates in the relative HDR domain,
so there is no need for metadata (apart from signalling of the subtitle colour format if more formats than sRGB format subtitles are available).

@simontWork Ok. Great. Are you suggesting that the One method of doing this is as follows be included in the specification? If so, can you provide a detailed mathematical walkthrough.

@simontWork
Copy link

@palemieux @nigelmegitt If we could have a placeholder in the document, we will draft the reply ASAP

@palemieux
Copy link
Contributor Author

Issues description updated with additional details.

@palemieux
Copy link
Contributor Author

@simontWork Any update on a proposal?

@nigelmegitt
Copy link
Contributor

@palemieux BBC is working on a simplified proposal.

@palemieux
Copy link
Contributor Author

What are the differences, if any, between the proposal and the edited version?

@skynavga
Copy link
Collaborator

skynavga commented Mar 30, 2017 via email

@palemieux
Copy link
Contributor Author

in tts:hdrAbsoluteLuminanceGain,

  • absolute is intended to differentiate from HDR schemes that do not use absolute luminance values
  • gain is important since the value is not luminance, i.e. does not have units of luminance, but instead a uniteless gain applied to luminance (current industry practice)
  • hdr is important since the gain should not be applied unless compositing to HDR images

So the name should remain.

@nigelmegitt
Copy link
Contributor

In #233 (comment) @palemieux articulated very well exactly the position that the BBC shares on this. The attribute needs to be renamed back to tts:hdrAbsoluteLuminanceGain or something else that carries a similar set of connotations, and the specification for it also needs to reflect that it should not be applied in all situations.

As per previous comments, we are still working towards providing an alternative algorithm that is usable in other HDR scenarios. This is currently going through our internal processes for reasons that will become clearer later.

@skynavga
Copy link
Collaborator

skynavga commented Mar 30, 2017 via email

@palemieux
Copy link
Contributor Author

See TTWG minutes at https://www.w3.org/2017/03/30-tt-minutes.html

@palemieux
Copy link
Contributor Author

See #283 (comment)

@nigelmegitt
Copy link
Contributor

Meeting 2017-04-20: Agreed to a working assumption of the name luminanceGain to be adopted via a PR to be raised by @palemieux . Also @nigelmegitt will propose an additional PR to add HLG support.

@nigelmegitt
Copy link
Contributor

nigelmegitt commented Apr 21, 2017

BBC (thanks especially to @simontWork but also others who know who they are) submits the following document containing a proposal for an addition to Appendix P illustrating a simple method for converting sRGB to HLG for HDR:

SimpleConversion_sRGBtoHLG[9].pdf

This algorithm does not make use of the tts:luminanceGain style attribute.

I will generate a pull request based on this proposal.

Update This submission is updated at #397 (comment) to fix a bug found within it.

@nigelmegitt
Copy link
Contributor

I split out the HLG work into #298 to make it easier to track the editing work for that separately.

@nigelmegitt nigelmegitt removed their assignment Apr 24, 2017
@skynavga
Copy link
Collaborator

Merged #294 and closing.

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