Recording & Editing with Hybrid Log Gamma (HLG) – Part 2

In the first part of this article series, we covered off the Recording aspects of Hybrid Log Gamma (HLG) with a heavy focus on correct exposure settings and correct metering. In this second portion, we will cover off normalizing imported HLG media.

If you haven’t already read Part 1 of Recording & Editing with Hybrid Log Gamma, it is highly recommended to do so before reading further below.

Scene Referred vs Display Referred

Before we proceed, it must be reiterated that there are two aspects of Hybrid Log Gamma – a Scene Referred aspect which is encoded directly from a Camera and a Display Referred aspect which is relevant for displaying on a TV/Monitor. The key differentiator is that in a Display Referred context, HLG normally includes an opto-optical transfer function (OOTF) which transforms Scene Referred content into Display Referred content, such as an HLG 1000 NIT output from a HLG recording. Scene referred content on the other hand is as encoded directly from a camera. When we import footage recorded from a camera, this is almost always Scene Referred.

Importing & Normalizing HLG

When it comes to importing HLG media across Video Editing and Visual Effects applications, the end-user experience can be a hit and miss. Some Applications support the HLG BT.2100 profile natively and some exhibit problematic behavior. Assimilate Scratch, Final Cut Pro, Adobe Premiere and DaVinci Resolve all support the import and export of HLG content. Importing HLG content into these respective applications is fairly straightforward if one follows the correct procedures. However, none of these applications support normalization of HLG content recorded using the HLG BT.2408 recommendations at 38% IRE, nor do they support the custom Sony HLG profiles.

Adobe Premiere and Final Cut Pro

The steps to conform standard HLG BT.2100 content into Adobe Premiere can be viewed on Adobe’s online documentation.

The steps to conform standard HLG BT.2100 content into Final Cut Pro can be viewed on Apple’s online documentation.

As noted earlier, none of these applications support conforming HLG content recorded using the HLG BT.2408 recommendations, nor do they support normalization of the custom Sony HLG profiles which would otherwise be conformed to an incorrect gamma curve. With the likes of Adobe Premiere and Final Cut Pro, the HLG Normalized LUT Pack can be used as a Camera LUT to normalize recorded footage, whether that is conforming to HLG BT.2408, or Sony’s custom HLG profiles.

RAW HLG2 footage vs HLG2 LUT from the HLG Normalized LUT Pack

To use the HLG Normalized LUTs as Camera LUTs inside Final Cut Pro for example, it’s necessary to perform a Color Space Override on the clip settings tab and select “Rec.2020” as the override option. From there, one can then use the designated Camera LUT based on the HLG Profile.

FCP HLG Normalized LUT Pack
HLG Normalized LUT Pack in Final Cut Pro

DaVinci Resolve

In this write-up, we will focus mainly on DaVinci Resolve as it offers a free version and is the most feature rich application of the aforementioned group. With that said, Resolve can be just as confusing to use, even for intermediate level users. We will focus on three workflows: Color Managed, ACES and Non-Color Managed.

Normalizing with Resolve Color Management (RCM)

When using a Color Managed workflow inside DaVinci Resolve, we are exposed to several different HLG parameters as an input source for media:

  • P3-D65 HLG 1000 NITs
  • Rec.2020 HLG ARIB STD-B67
  • Rec.2100 HLG
  • Rec.2100 HLG (Scene)

To avoid confusion, Rec.2020 HLG ARIB STD-B67 and Rec.2100 HLG (Scene) are EXACTLY the same – they are normalization methods for Scene referred content as recorded from a Camera. The Rec.2100 HLG profile on the other hand is a Display Referred preset which contains an OOTF transform and is meant for OUTPUT settings, NOT INPUT settings. The P3-D65 HLG 1000 NITs setting is also a Display Referred preset meant for output and limits the color space to P3-D65 primaries. Unfortunately, there are many shonky posts on internet forums and ill-informed YouTube videos that promote using weird settings for input, output or everything in between – they are ALL WRONG. An example of an incorrect setting can be seen in the image below which was conformed using the Rec.2100 HLG preset as an input. The image is extremely darkened due to the incorrect setting.

Incorrect Input HLG preset – HLG Rec.2100 HLG

If content has been recorded using the HLG BT.2100 specification and correctly exposed, it should be normalized using a Scene referred HLG profile, not a Display referred one. Unfortunately, Resolve attempts to detect a clip’s metadata and selects Rec.2100 HLG as the default input preset. This needs to be manually changed to either Rec.2100 HLG (Scene) or Rec.2020 HLG ARIB STD-B67. The image below shows the same clip correctly conformed using the Rec.2100 HLG (Scene) preset.

Correct Input HLG preset – HLG Rec.2100 (Scene)

DaVinci Resolve releases from 17 onwards also have some inherent issues with normalizing HLG content. There is a major bug where if the Input DRT is enabled, HLG content will not be conformed correctly and as a result will appear much, much darker. Unfortunately, the default behavior with Color Management presets in Resolve 17 onwards is to have Input and Output DRT set to DaVinci. This needs to be explicitly altered by using a Custom preset and selecting “None” for Input DRT.

Using the DaVinci Wide Gamut preset

With the introduction of Resolve 17, there is now a DaVinci Wide Gamut preset as well. In many ways, this is another alternative to an ACES workflow. Much like ACES, it expands the source clips to a wider working color space and gamma in order to cater for HDR workflows. When importing Log footage, especially HLG, this should be the preferred selection as it will expand the footage to use a larger color space and wider dynamic range. Even if the output format is Rec.709, the conforming of Log footage to a wider timeline space is a much better experience than compared to a standard SDR Rec.709 preset. The performance of DaVinci Wide Gamut and DaVinci Intermediate is very similar to ACEScc(t) and ACES AP1. With that said, the Input DRT bugs are also manifested when using the Wide Gamut preset so any Input DRT should always be disabled as standard practice.

What if we wanted to conform HLG media that is exposed at 38% IRE, or conform Sony HLG specific content? All these color management and input setting issues, even Input DRT issues, can easily be bypassed if one were to use the HLG Normalized Plugin instead. The plugin is explained further in the HLG Normalized section below.

Normalizing HLG in ACES

There is currently no ACES Input Device Transform (IDT) available for HLG inside DaVinci Resolve. This is because Hybrid Log Gamma has not been included in any of the current ACES implementations. There is an ACES HLG 1000 NIT profile inside Resolve, but this is actually an Output Device Transform (ODT), not an ACES IDT and SHOULD NOT be used for any ACES input settings.

Given the lack of a valid HLG IDT in ACES, I have developed the HLG Normalized Transform to fill this void. It includes ACES Input Device Transform presets for HLG BT.2100, HLG BT.2408, Sony HLG1, Sony HLG2 and Sony HLG3 profiles. The relevant HLG type can be selected through the DCTL/LUT dropdown for each individual clip for Resolve 17 and earlier.

Comparing accuracy of a Rec.709 Transform, HLG Normalized Transform, and HLG 1000 nit Transform

As of Resolve version 17.2, these IDTs can now also be selected using the ACES Input Transform settings at both the clip and project settings level. Additionally, there is also the HLG Normalized Plugin which is detailed in the HLG Normalized section further below.

HLG Normalized Transform IDT in ACES Project Settings

Normalizing with a Non-Color Managed workflow

When importing properly exposed standard HLG media (i.e. HLG. BT2100 exposed at 21% IRE) into a non-color managed workflow, a simple Color Space Transform can be used in order to conform footage to the project preset. It’s best to avoid any Tone mapping when using a Color Space Transform though as this can result in undesirable behavior.

Color Space Transform with Tone Mapping disabled

DaVinci Resolve does also include HLG LUTs as part of the standard installation, but these only perform a Gamma transform, not a color space transform and shouldn’t really be used at all. There is also the matter of Lookup Tables having much less accuracy when compared to a proper technical transform. The 32-bit floating point math of a proper transform always wins against a LUT which has to perform interpolation and therefore guesstimate output settings.

One could also leave the default Rec.709 input/output, but the image will appear extremely washed out. If the HLG recording was exposed at 38% IRE as per the BT.2408 recommendation, the incorrect Rec.709 setting would appear slightly less washed out. In fact this would be the easiest way to view HLG on a monitor/screen with no HLG HDR support – this was also the intent of the Engineers who conceived HLG as a form of “backwards compatibility”. However, the downside to this approach is that the source media colors conform to a Rec.2020 Gamut, not a Rec.709 gamut and any interpretation of Rec.2020 colors on a Rec.709 screen without proper color gamut mapping will result in inaccurate colors being displayed. Simply put, whilst it may be possible to simply use a standard Rec.709 setting for HLG media, PLEASE DON’T – it just looks wrong.

To conform HLG content that has been exposed at 38% IRE, or footage that has been recorded using Sony’s custom HLG profiles, refer to the HLG Normalized section further below where the HLG Normalized Plugin is discussed.

Normalizing with HLG Normalized

Whilst we’ve explored normalizing HLG content that has been correctly exposed, what about content that has been incorrectly exposed, or shot using the HLG BT.2408 recommendations at 38% IRE, or even Sony HLG profiles?

Based on all the previous points, if we import footage that has been exposed at 38% IRE and normalize it using the standard HLG BT.2100 profile, our footage will be extremely blown out, as is visible in the image below.

HLG BT.2408 clip incorrectly conformed using Rec.2100 HLG (Scene)

Sony HLG footage will also appear darker than it is due to normalization using an incorrect gamma curve. We could adjust the exposures using Resolve’s controls, but this would also do away with any accuracy and introduce varying degrees of inaccuracy based on the designated workflows, especially when trying to conform the custom Sony HLG implementations. To this effect, we can use the HLG Normalized Plugin to conform our media and even adjust exposures as required. It includes the HLG BT.2408 presets as well as the Sony HLG1, HLG2 and HLG3 implementations, with a range of output options from Rec.709 to ACES.

HLG Normalized Plugin

If we look at footage that has been exposed at 38% IRE for example, when normalized using the HLG Normalized Plugin, the Middle Gray exposure chart is perfectly on point.

HLG BT.2408 clip correctly conformed using HLG Normalized Plugin

There is also the problem of transforming negative encoded values in some cameras such as the Panasonic Lumix series. Often times these negative values will manifest as black splotches on a clip. The HLG Normalized Plugin and Transform clamp these negatives so that they don’t appear across the scene.

Usage of the HLG Normalized Plugin is fairly straight forward, whether in DaVinci Resolve, Assimilate Scratch or other Video Editing and VFX applications. To save the headache of any misunderstandings, I have created a few simple YouTube tutorials of the HLG Normalized Plugin in action across different workflows inside Resolve and Assimilate Scratch. Similar principles will also apply when working with Fusion, Natron, Nuke etc.

HLG Normalized Plugin inside DaVinci Resolve
HLG Normalized Plugin inside Assimilate Scratch

Leave a Reply