Perceptual Quantiser (PQ) to Hybri Log-Gamma (HLG) Transcoing Part of the HR-TV series. Last upate June 07. Introuction This ocument escribes the transcoe process between PQ an HLG where the isplay brightness of the PQ an HLG s are the same. The steps outline in this ocument are ientical to the proceure escribe in ITU-R BT.00-0 [], ITU-R BT.390 [], an a recent conference paper [3], however, more etail has been provie to ai with the transcoe process. Transcoing between PQ an HLG s is specifie in ection 7. of ITU-R report BT.390. When the peak brightness of the HLG an PQ isplays are the same, the isplaye images from the original an transcoe s will look ientical. Typically, however, for PQ content the brightness of low-lights an mi-tones remains the same, regarless of the peak brightness of the isplay. Brighter PQ isplays offer increase hearoom for specular highlights, but the overall image brightness remains unchange. HLG, however, is base on relative brightness. Thus, as the isplay s peak brightness increases so oes the brightness of the entire image. The hearoom for specular highlights is a constant number of stops, but the brighter image makes it suitable for viewing in brighter environments. When, for example, a 4000 c/m PQ is transcoe to HLG using the metho specifie in ITU-R BT.390, it will appear ientical on a 4000 c/m HLG isplay, but it may appear arker when shown on a 000 c/m HLG isplay in brighter environments. As the PQ an HLG systems have ifferent characteristics, a format conversion rather than a simple transcoe is require when the mastering PQ an HLG isplays are a very ifferent brightness. Format conversion is escribe in ection 7. of ITU-R report BT.390.
Transcoe PQ to HLG for a Common isplay Brightness ystem Overview The transcoe process outline in ITU-R BT.390 is as follows: PQ ignal PQ OTF HLG OTF - HLG ignal Figure : PQ TO HLG High Level Overview where the HLG OTF - consists of an inverse Opto-Optical Transfer Function (OOTF - ) followe by the HLG OTF: PQ ignal PQ OTF OOTF - cene Light HLG OTF HLG ignal Peak Mastering Level, Colour pace Figure : PQ To HLG Overview The OOTF - process can be broken own as follows: Peak Mastering Level Colour pace RGB to /γ Gamma - (-γ)/γ Ratio {R,G,B} (-γ)/γ cene Light Figure 3: OOTF - proceure The PQ OTF an HLG OTF are efine by BT.00-0.
tep by tep Guie Below is a fully explaine proceure for the transcoe process. This process is appropriate for implementation in a 3 look up table (LUT). Note, the range of the values at each stage is between 0.0 an.0.. Apply the PQ OTF to the, as per Table 4 in BT. 00-0. Note the multiplication by 0000 is not require. This is now isplay light in the range of 0.0 to.0, where.0 represents 0000 c/m. max c m m c,0 c 3 m. Normalise the isplay using the peak mastering level. The mastering level can be obtaine from analysing the, or alternatively, may be available as metaata, e.g. by knowing which mastering monitor was use. For a PQ grae on a 000 c/m isplay, there shoul be no ata above 000 c/m as this woul have been clippe by the isplay. Therefore, the shoul be normalise so that.0 now correspons to 000 c/m. imilarly, for PQ content grae at 4000 c/m, there shoul be no ata above 4000 c/m as this woul have been clippe by the isplay. Therefore, the shoul be normalise so that.0 now correspons to 4000 c/m. F *0000 min,. 0 Lw where is the {R,G,B}, an L w is the peak brightness of mastering isplay in c/m. This is isplay referre linear. 3. The OOTF - is now applie to convert the isplay linear to a scene linear. First the isplay luminance of the isplay is calculate. Note that the coefficients in the conversion must correspon to the correct colour primaries of the. BT.00 primaries have been use for the conversion below. 0.67 R 0.6780G 0. 0593B
Next the scene luminance is calculate by applying the inverse system gamma. s where γ is calculate using the stanar formula from BT.00 γ. 0.4 Log0 LW 000 Therefore, the linear scene R s, G s an B s can be erive as: R G B s s s R G B 4. Finally, the HLG OTF is applie to generate the HLG. If using the formula from Table 5 in BT.00-0, please note that the expecte input range is [0:], therefore, the scene linear s nee to be multiplie by before the OTF is applie. Note 5b provies equations for the HLG OTF in the range [0:], if these equations are use, no such scaling is require. PQ content grae on a 000 c/m isplay transcoe to HLG, an then shown on the same screen in the correct HLG ITU-R BT.00-0 moe (e.g. ony BVM-300, HLG G Variable(HR) ) will be ientical. The process escribe above is mathematical an exact (except for small rouning ifferences). Any other result inicates a mistake in the workflow. The following iagram shows that the processing blocks essentially are cancelle out, resulting in ientical isplaye light values. TH IPLA LIGHT I INTICAL PQ isplay HLG isplay PQ ignal PQ OTF OOTF - cene Light HLG OTF HLG ignal HLG OTF - cene Light OOTF Mastering Peak Level, Colour pace, Figure 4: Transparent PQ to HLG Transcoe Mastering Peak Level, Colour pace,
Transcoe HLG to PQ for a Common isplay Brightness ystem Overview The transcoe process outline in ITU-R BT.390 is as follows: HLG ignal HLG OTF PQ OTF - PQ ignal Figure 5: HLG TO PQ High Level Overview where the HLG OTF consists of an inverse HLG OTF, followe by the Opto-Optical Transfer Function (OOTF): HLG ignal cene Light HLG OTF - OOTF PQ OTF - PQ ignal Target PQ isplay Peak Brightness, Colour pace Figure 6: HLG To PQ Overview The OOTF process can be broken own as follows: Target PQ isplay Peak Brightness Colour pace RGB to γ Gamma γ- Ratio {R,G,B} γ- cene Light Figure 7: OOTF proceure The PQ OTF - an HLG OTF - are efine by BT.00-0.
tep by tep Guie Below is a fully explaine proceure for the transcoe process. This process is appropriate for implementation in a 3 look up table (LUT). Note, the range of the values at each stage is between 0.0 an.0.. Apply the HLG OTF - to the, as per Table 5 in BT. 00-0. This is now scene light in the range of 0.0 to.0. b a c / exp 0 4 OTF where is the scene light for the components R s, G s, an B s. The values are then scale by to bring them into the omain [0:]. Alternatively, the OTF - efine in the omain [0:] (Note 5c) for both input an output can be applie. This oes not require the scaling by.0. b a c / exp 0 3 OTF. Apply the OOTF to turn the scene light into isplay light, where γ is calculate using the stanar formula from BT.00-0, an L w is the target PQ isplay brightness. s W B B G G R R B G R F L γ γ γ γ 0 0.0593 0.6780 0.67 OOTF 000 0.4 Log. γ 3. Normalise the isplaye referre using the peak mastering level an the PQ peak level of 0000 c/m. 0., 0000 * min w L F Where are the isplaye referre R, G, B s
4. Apply the PQ OTF - as efine in Table 4 of ITU-R BT.00-0. OTF F c c c m m 3 m where F is the isplay referre s R, G, an B normalise with the peak mastering level an 0000 c/m. HLG content shown on a 000 c/m isplay an subsequently transcoe to PQ, targete for the same 000 c/m isplay, (e.g. ony BVM-300) will look ientical. The process escribe above is mathematical an exact (except for small rouning ifferences). Any other result inicates a mistake in the workflow. teps an, above, convert the HLG to isplay light values. The isplay light values represent the final viewe images, irrespective of the choice between HLG an PQ for the format, an hence these are the values that nee to be preserve. The inverse PQ OTF applie in step 3 will be exactly inverte by the PQ OTF in any PQ isplay. This means that the final isplaye light values will be ientical for the original HLG an the transcoe PQ, as shown in the following iagram. TH IPLA LIGHT I INTICAL HLG isplay PQ isplay HLG ignal cene Light HLG OTF - OOTF PQ OTF - PQ ignal PQ OTF Target PQ isplay Peak Brightness Figure 8: Transparent HLG to PQ Transcoe
Implementation of the Transcoe Process The proceures escribe above can be implemente exactly as escribe in software. uch an implementation can be foun in HRTools [3], a tool evelope by the ITU-T an IO/IC community to support vieo stanarisation an compression work. Alternatively, the proceure can be implemente in a 3 look up table (LUT). 3 LUTs are wiely supporte in software, such as graing an other post-prouction tools, as well external I/HMI base evices, however, some care must be taken when using these tools to ensure that the correct conversion are applie as LUTs operate in an RGB colour space while the input an output vieo is typically CbCr. Tools Fully Aware of Wie Colour Gamut With moern graing, eiting an post prouction tools, the colour space an primaries can be efine base on the prouction criteria. These can be, for instance, BT.709, CI.P3 or BT.00. As the LUT is applie to RGB components, the software must convert the input vieo to RGB before the LUT can be applie. If the input is CbCr, the correct CbCr shoul be use base on the colour space selecte within the project. imilarly, the correct shoul be use when converting the output of the LUT back to CbCr from RGB. CbCr00 CbCr to RGB using appropriate PQ to HLG Transform RGB to CbCr using appropriate CbCr00 Graing oftware Figure 9: Applying LUT within post-prouction software Tools Unaware of Wie Colour Gamut ome tools, such as external harware base look up tables, are often not capable of istinguishing between inputs with ifferent colour spaces, an simply assume that all inputs an outputs will be BT.709 colour. This will lea to the incorrect CbCr to RGB being use, which may result in colour istortion, hue shifts, or clipping. This incorrect operation is illustrate in Figure 0.
CbCr00 CbCr to RGB using BT.709 PQ to HLG Transform RGB to CbCr using BT.709 cbcr00 xternal LUT box processing Figure 0: Incorrect LUT conversion with external evice which assumes BT.709 CbCr transform If the correct cannot be flagge correctly within the LUT processing evice, aitional matrices can be applie within the LUT itself to compensate for the incorrect. The workflow for such a process is shown below for a BT.00 input an output. CbCr00 CbCr to RGB using 709 RGB to CbCr using 709 CbCr to RGB using 00 PQ to HLG Transform RGB to CbCr using 00 CbCr to RGB using 709 RGB to CbCr using 709 CbCr00 xternal LUT box processing Figure : Conversion with external LUT evice with CbCr compensation The aitional conversions (in re, inicate with via LUT ) aim to reverse the assume BT.709 conversion to RGB applie by the LUT evice an then apply the appropriate conversion for the source material. In the example above, the intene colour space is BT.00, but the processes can easily be substitute for the appropriate colour space, for example CI.P3. References [] ITU-R Recommenation BT. 00-0, Image parameter values for high ynamic range television for use in prouction an international programme exchange, 06. [] ITU-R Report BT. 390-, High ynamic range television for prouction an international programme exchange, 07. [3] Tim Borer, Anrew Cotton, Manish Pinoria, imon Thompson, Katy Nolan, "Interconversion of High ynamic Range Vieo Formats", NAB Conference, Las Vegas, UA, April 06. [4] HRTools, https://gitlab.com/stanars/hrtools/, ITU-T, IO/IC, 06.
Version History Version itors Comments 0. MP, TB, AC Initial Version 0. MP, AC, RP Correcte normalisation step in HLG to PQ conversion