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

Whilst Hybrid Log Gamma (HLG) is continuing to gain popularity for recordings and broadcast, there is often a lot of confusion and misinformation out there regarding HLG as an acquisition and grading format, so I thought to write up a few points that will hopefully provide some clarity for those looking to produce content using it.

This write-up is not intended to go through the low-level in’s and out’s of the HLG format – there is already a plethora of information available from the BBC, NHK and ITU as well as associated recommendations. We will instead focus on the specifics around recording and subsequently editing HLG content for delivery to SDR and HDR formats. In Part 1 we will focus on Recording content using the HLG format.

Recording with HLG

In a lot of documentation, HLG is often referred to in a Display referred context, as an output format for viewing on HDR enabled displays and this aspect alone causes much confusion for users and consumers. When considering HLG for recording, we must always consider it in a Scene referred context, as the camera is encoding Linear light to HLG directly from the sensor. In order to properly understand and record using Hybrid Log Gamma, we must first look at the ITU-R BT.2100 specification and the ITU-R BT.2408 recommendations.

Firstly, the ITU-R BT.2100 specification has a nominal range of 0 – 12 for HLG. In comparison, the Standard Dynamic Range (SDR) ITU-R BT.709 specification and most other Log formats have a nominal range of 0-1. In practical terms, the Rec.709 Opto-Electronic Transform (OETF) maps a Camera’s 18% Middle Gray reference to 40.9% IRE (rounded to 41%) when recording at video levels (or 40.5% when recording data levels). In the case of HLG, whilst keeping the nominal 0-12 range in mind, the HLG OETF maps a camera’s 18% Middle Gray reference to 21.2% IRE when recording at video levels. This has been rounded up to 22% on some sites, though rounding down to 21% IRE is perhaps more accurate.

Using HLG BT.2100 as a base reference, the BT.2408 recommendation provides further guidance for production practices and recommends an 18% Middle Gray be exposed at 38% IRE (in a scene referred context) with a nominal luminance of 26 cd/m2 (in a display referred context) for HLG. This is also interchangeably referred to as 75% HLG, where the 100% diffuse white (SDR peak white) maps to 203 cd/m2 and is approximately 75% of the HLG signal level. These Luminance values will be discussed further in Part 2 where I will cover off ingesting & editing.

In simple English, what this all means is that when referencing the BT.2408 recommendation, pointing a camera at an 18% Middle Gray card should result in an output of 38% IRE on a waveform monitor when correctly exposed. Similarly, when referencing the BT.2100 specification, a camera should display an output of 21% IRE on the waveform monitor against an 18% Middle Gray card when correctly exposed.

[Addendum: Sony has bastardized HLG in their camera implementations by introducing HLG1, HLG2 and HLG3 alongside the HLG BT.2100 standard. For Sony’s HLG parameters, the 18% Middle Gray reference should be exposed at 19% IRE for HLG1, at 20% IRE for HLG2 and at 21% IRE for HLG3 respectively. I will cover off Sony’s HLG implementation and issues in a separate write-up. ]

When Hybrid Log Gamma is encoded from a camera’s sensor, the encoder needs to factor in the 0 – 12 nominal range. Given that the HLG specification also requires a video legal range, the resulting signal must stay with in the 64 – 940 steps for 10-bit values (or 16-235 for 8-bit) after quantization. To visualize all this, I’ve plotted the HLG BT.2408 recommendation and the BT.2100 Specification (i.e. what the camera natively sees) against a Characteristic Curve in the diagram below.

HLG BT.2408 Recommendation & BT.2100 Specification (Camera Native) Characteristic Curves

At first glance, the Camera Native output exhibits more latitude in the highlights – approximately 1 ⅔ stops more compared to BT.2408 – however, the downside of this additional highlight range is that there is also more range given to the darker parts of the scene. Considering that many Log curves have an 18% middle gray around the 34-45% IRE range, the HLG BT.2100 specification’s 21% IRE for middle gray is quite low and by extension more susceptible to visible noise. This becomes apparent in low-light scenarios and on crop sensors such as 1″, m4/3 or APS-C with some full-frame sensors also exhibiting increased noise – largely due to the lower dynamic range capabilities of all those sensors. Practically though, a number of manufacturers don’t apply as much signal amplification to their HLG implementations as they would to native Log implementations. This reduced amplification may result in more dynamic range and less visible noise than with the manufacturer’s own Log implementations – Sony’s A7R3 & A7 III for example have a base ISO of 125 for HLG, whereas for S-Log2 the base ISO is amplified to 800. The Lumix GH5 has a base ISO of 400 for both HLG and V-Log L, however the native HLG implementation also provides for more highlight range compared to V-Log L and when exposing for HLG BT.2408 at native ISO, the image is also far cleaner than both HLG Native at 21% IRE and V-Log L (I plan on comparing HLG against other Log profiles in a subsequent article).

Image Noise – BT.2408 vs BT.2100

Below is a 10x magnification of comparative clips shot on a Lumix GH5 using HLG exposed at approximately 21% and 38% IRE respectively.

10x Magnification of Exposure Chart. Left: 21% IRE, ƒ6.3, ISO400 – Right: 38% IRE, ƒ3.5, ISO400

In the above image, we can see the noise is visible when exposed at the native 21% IRE, though some may find this luma noise acceptable or even aesthetically pleasing, much like the desirable grain of film stock footage. Whilst Panasonic seem to do a great job of controlling the nasty chroma noise across the image, cameras from other vendors (looking at you Sony) may not be as forgiving and exhibit blotchy chroma colors, especially in the shadows. Compared to BT.2100, the noise is significantly reduced when exposing to the BT.2408 recommendation of 38% IRE, though it comes at the cost of reduced range in the highlights. This is to be expected when Exposing To The Right (ETTR) and may be a downside if the ultimate intention is to deliver in HDR formats.

There may be other caveats when exposing footage at 38% IRE though. Firstly, the Camera’s Exposure Meter will be offset. When an 18% Gray Card is correctly exposed for HLG BT.2100, the Exposure Meter should show a value of zero to reflect 21% IRE. However, when adjusting for 38% IRE, the image will need to be over-exposed by 1 ⅔ stops and this delta will need to be kept in mind whist recording content with changing brightness levels.

Exposure adjusted for BT.2408 recommendations on GH5 using spot metering

In-camera exposure readouts are very important and some cameras will display accurate exposure values when moving up and down the brightness levels, whereas others will show rough estimates or a very limited exposure range. Sony cameras offer limited -2 to +2 EV range readouts that are also rounded. What’s worse, some cameras manufacturers show completely wrong exposure values for HLG profiles. Sony’s HLG implementation is a prime example of this issue – exposure readouts on the A7 III for example reflect Rec.709 Scene at 41% IRE, not HLG at 21% IRE. They are simply wrong and cannot be relied on. Quite perversely though, Sony’s incorrect exposure metering at 41% IRE is very close to the 38% IRE of HLG BT.2408 and the exposure meter could possibly be used only in this case. Fortunately, the other saving grace for Sony is their ability to configure Zebra patterns at 21% for HLG BT.2100, 19% for HLG1, 20% for HLG2 and at 38% for HLG BT.2408. Not all manufacturers support Zebra patterns with such low IRE values however, so further investigation will be required for each manufacturer and camera.

Zebra pattern set to 38% IRE for BT.2408 on Sony A7III

[Note: There are reports that some Lumix cameras are showing incorrect in-camera Exposure readings which are 1 stop over-exposed at around 30% IRE for HLG BT.2100 instead of 21% IRE. The matter is currently being investigated by Panasonic. The interim workaround is to rely on the Waveform monitor and under-expose 18% Middle Gray by 1 stop or apply exposure compensation accordingly.]

Due to the inconsistency of in-camera Exposure meters and the limitations of zebra patterns on many cameras, the most useful tool for correct exposures is perhaps the Waveform Monitor. Some cameras such as the recent Lumix GH and S series include waveform monitoring as part of the firmware. This makes correcting exposures extremely easy. For cameras that aren’t so lucky, an external recorder/monitor that offers waveform monitoring will do the trick, assuming it’s been correctly setup.

Adjusting Exposures

To adjust the exposure levels for BT.2408, there needs to be an increase in the amount of light reaching the sensor. This can be done artificially by increasing the ambient lighting or reducing the ND filter strength, if one is being used. This is also a win-win scenario if absolute highlight preservation is not required – i.e. if delivering to SDR formats. However, many “run and gun” scenarios will have limited ability to modify ambient lighting and possibly may not use Neutral Density filters altogether. In this situation, exposure adjustments can be achieved in-camera by increasing the aperture (lowering the ƒ-stops) by approximately 1 ⅔ stops or increasing the Gain/ISO accordingly.

An increase in the aperture will ultimately result in a shallower depth of field and further blurring of out-of-focus areas, which may be desirable or undesirable based on the circumstances. In some instances, an increase to the aperture may not be possible due to it already being at the maximum. This would then require that the Gain/ISO be increased as a last resort. An increase in the Gain/ISO will effectively amplify the signal coming from the sensor. This will also amplify any noise that has been captured with the addition of further signal degradation due to interference from other electronic components. A signal degradation would essentially mean a reduced Signal to Noise Ratio (SNR), in which case any benefits of opting for the BT.2408 recommendation over the BT.2100 specification could potentially be nullified. In real-world tests however, when increasing the base ISO by 1 ⅔ stops, there was only a slight reduction in the SNR and the overall image exhibited far less noise than when exposed at the default 21% IRE. With that said, as a general rule of thumb, it’s recommended to record with the camera’s base ISO/Gain/SNR where possible to maximize the available dynamic range.

HLG Recording Conclusions

So, what parameters should you use for recording with Hybrid Log Gamma?

Firstly, select spot metering on your camera and point the center at your 18% Gray Card to ensure your exposure readings are correct. If you have an external monitor/recorder, ensure it is configured correctly to display the appropriate waveforms values. If you don’t have an external recorder/monitor or your exposure readouts are wrong (as with Sony cameras) then use Zebra patterns set at the appropriate IRE values. The quality of your Gray Card is also important as some of the $2 cards tend to be cheap & nasty. If you’re unable to use a Gray Card, then the BT.2408 recommendation also provides a rough guide on skin tone exposure levels. Based on 38% IRE Middle Gray, the skin tone levels range from 25% IRE for the darker skin tones up to 65% for the lightest of skin tones, with the average skin tone sitting within the 45-60 IRE range. This would equate to roughly -1 ⅓ stops below middle gray (relative to 38% IRE) for the darker skin tones and up to +1 ⅔ stops above middle gray for the lightest skin tones, whilst the average skin tones would be roughly between +⅓ to +1 ½ stops above middle gray. Once exposure metering has been set, the next question is whether to to go with BT.2408 recommendations or the HLG BT.2100 specification?

Think of BT.2408 recommendations as “Exposing To the Right” of the BT.2100 specification. The benefits are there if you would like to reduce visible noise, even if only done by increasing the Gain/ISO by 1 ⅔ stops. If you are delivering to a Standard Dynamic Range (SDR) format such as Rec.709 where bright highlights will be clipped regardless, then go with the BT.2408 recommendation. BT.2408 also has the advantage of being much closer to the Rec.709 Scene gamma curve, such that the footage could even be plonked into a Rec.709 Scene timeline without a significantly noticeable difference* [this will be covered in my subsequent write-up on editing/grading HLG].

If you are delivering for HDR and would like to eke out those extra NITs in the highlights, then go with the BT.2100 specification as native to the camera, provided the noise is manageable. If the noise in the shadows and mid-tones is too ugly, then go for the BT.2408 recommendation instead.

Another option may be to over-expose or under-expose shots – whether choosing the BT.2408 recommendation or BT.2100 HLG specification – in order to preserve highlights, shadows or further reduce noise. For example, you could over-expose the HLG BT.2100 reference by 1 stop at 30% IRE to reduce visible noise but still leave additional headroom in the highlights (approximately EV more room compared to BT.2408). The over/under exposure can then be corrected later in post manually or by using tools such as the HLG Normalized Plugin / HLG Normalized Transform or the Exposure Correction OFX / Exposure Correction Transform.

The following Tables provide a handy reference when under-exposing or over-exposing relative to the BT.2408 recommendation or HLG.BT2100 specification respectively.

IRE1922.626.8323845.253.561.368.6
Stops-2.0-1.5-1.0-0.50+0.5+1.0+1.5+2.0
BT.2408 Recommendation
IRE10.612.61517.821.225.23035.742.4
Stops-2.0-1.5-1.0-0.50+0.5+1.0+1.5+2.0
BT.2100 Specification

When in doubt about what settings to use for recording Hybrid Log Gamma, stick to the camera’s Base ISO and go with the BT.2408 recommendation of 38% IRE. In the case of Sony cameras, the incorrect exposure meter quite perversely has an advantage of being closer to the 38% IRE range.

Once you’ve settled on the technical parameters, how do you then go about ingesting and correcting/grading the footage in Video Editing Software? Why does some footage show black splotches in certain areas? Why does some HLG footage look dull or dark or too bright when imported? Can you use Rec.709 settings for HLG? Can HLG be used with ACES? How do the HLG Normalized Transform or the HLG Normalized Plugin conform HLG media relative to BT.2408 or BT.2100? All of that will be covered in Part 2.