Questions about PQ / HLG and OOTFs, EOTFs, OETFs, OETF^-1s and OMGs

Hi All,

sorry for the preamble which follows before my questions, but I think I should make sure I'm at least barking up the right tree! ;-)

I have been trying to get to grips with the all the OOTFs, EOTFs, OETFs and OETF^-1s involved in PQ and Hybrid-Log gamma.

For some time I have been playing around developing a web app called LUTCalc, and when Dolby first mooted PQ and the BBC started writing papers about log-based HDR displays I added in the various equations I could find. At that point I managed to misunderstand that the two systems took fundamentally different approaches to the display gamma. I used various LUTs I could find (including in Resolve) to check that my maths was working, but the curves were mostly just to help me as a cameraman start to get a handle on HDR.

Once Rec2100 was out and I had got around to reading it, I understood that the PQ curve definition is display light to PQ encoding, whereas Hybrid-log Gamma is scene linear directly to HLG encoding. I added in a PQ option including the PQ reference scene linear to display stage to the PQ encoding.

LUTCalc works in scene linear space for its adjustment tools.

Now that things have settled down I've had another, much more thorough revisit and have separated out the OOTFs from the PQ display to PQ equations.

As such, I have added the option to use PQ with the Rec2100 PQ reference OOTF and the Rec2100 HLG OOTF. The BBC's paper on converting between HLG and PQ uses the HLG reference OOTF.

I've added all this in and it SEEMs to make sense in its behaviour; if you want to take a look, I have just uploaded an online beta version to my 'testing' site: lutcalc.net/testing . I've been adapting the css to be 'responsive', so the UI may be a bit flakey at the moment, and as this is a colourist site I must warn that my range approach is 'quirky' (I'm working to make it more sensible without adding to the confusion) ;-), but the charts should be reasonably clear.

So, here come the questions:

First a quick one. Am I right that in PQ a value of 1.0 is always nominally 10,000 nits? That when you master to say 4000 nits it is the same PQ curve but the peak value is lower?

Next up, I had a look in the current Resolve LUTs to see if I'm on the right lines and in the 'HDR ST 2084' folder there are bunch of LUTs going between PQ and various conventional power-curve gammas. Trying to test out my sums as I have done before, I loaded several of them into LUTCalc. They seemed to fit with my original PQ implementation, where the PQ EOTF was being fed scene linear, i.e. 'Gamma 2.6 to HDR 4000 nits' takes in material which has had a gamma of 2.6 applied, degammas that back to linear, then feeds that into the PQ EOTF^-1 to end up with the PQ signal.

Is this right? Doesn't that mean that the OOTF in this case is effectively: OOTF[E] = E? I've added in an 'EOTF Only' but have I misunderstood something?

Lastly, moving to HLG, I had it drawn to my attention that the BBC has recommended setting reference levels to something different to the base standard. Basically, a 90% white card maps to 50% in the Rec2100 docs, but I was told that the BBC recommends setting 90% white card to 73%.

I found a reasonably technical BBC R&D paper online discussing this *, explaining that this gives decent compatibility with SDR material with a couple of stops headroom above the 90% white reference. A quick bit of fitting gave me a scaling factor to work with the nominal %HLG and cd/m2 values in the paper, and the logic makes sense, but considering the HLG encoding is scene linear to HLG, isn't this playing fast and loose with the standard or am I missing something?

As a cameraman, that throws up some concerns (not least that I now have no more headroom than a conventional camera with knee, just better expressed), but as an app developer how is this supposed to be factored into conversions to PQ. My current thinking is to include the scaling factor in both the OOTF and the HLG equation, so conversion to other spaces behaves correctly, but conversion to and from PQ cancels it out, avoiding clipping issues and assuming that 18% gray and 90% should fall where the standard expects in PQ. Is this the right thing to do?

Lastly, why does Rec2100 include both nits and cd/m2? Aren't they the same thing? :)

Sorry for the endless post and many thanks to anyone who plows through it and can shed some light for me,

Ben

* An Overview of the Hybrid Log-Gamma HDR System by Andrew Cotton & Tim Borer pages 44-45
 
Ben, LUTcals is really great. I have looked to it many times to help understand various cameras and colorspaces.
Regarding your questions, I'll can only comment on:
First a quick one. Am I right that in PQ a value of 1.0 is always nominally 10,000 nits? That when you master to say 4000 nits it is the same PQ curve but the peak value is lower?
Yes, this is my understanding.
 
Thanks Pepijn and Adam, very much appreciated!
Thanks also Adam for the response to the question.

In terms of the testing version I linked to, HLG's OOTF involves a luma component, which needed something of a change in the pipeline. I realised that I had forgotten to turn that bit on, oops!
The PQ option with HLG OOTF should now be working as expected.

As an aside, whilst I fixed that I added a feature I have been meaning to add for ages, but then had someone send me an email suggestion for, so felt I had to have a go. It is an option after all other settings to have a final colour space conversion, e.g. set your look happily for Rec709, then do a straight conversion to DCI-P3. I've included PQ and HLG, but I've only just put the basic effect together an haven't yet added the menus for target white choice. I've called it 'Display Colourspace Converter'.

Thanks,

Ben
 
Hi All,

just uploaded a second beta ( LUTCalc Testing ), should look a bit more sensible on IE / Edge, and from an HDR point of view I've firmed up the target white clipping in PQ. I've also changed the 'Rec2100 PQ (PQ OOTF)' behaviour when changing the target mastering level; hopefully it is now as it should.

Before I had things scale in linear space, essentially adjusting exposure to fill the range provided by the mastering level. Now it just clips (as it should, by my current understanding), but the same effect can be achieved by using the 'ASC-CDL' slope tool. In LUTCalc the ASC-CDL slope / offset / power settings are applied in scene linear space, so slope is a pure exposure adjustment.

'Rec2100 PQ (HLG OOTF)' behaves differently, again as it should, which allows for the translation between HLG and PQ.

I have also disconnected the input and output Lw and BBC / NHK settings from each other. Can't currently decide if this is a good / useful thing, or just adding complexity for complexity's sake,

Ben
 
Last edited:
Thank you, Ben, you code has been very useful and appreciate you candour here too. Yes NITS and CD/M^3 are the same thing.

You are right about PQ, it is an absolute encoding of display luminance, so when calibrating a 1,000 NIT monitor for grading it will be clipped at the 10-bit RGB level 769, 769, 769 with a luminance of 998.9. That is all values above 769 will appear on-screen as 769. Grading monitors are normally clipped hard at this, but televisions will often be rolled off. Some good background on HDR in the ColourSpace guide here.

Your other questions, you should find answers in Nick Shaw's Antler Colour Space Reference if not might be worth asking him directly.

Hope this helps.

Victor
 
Back
Top