HLG Support - 2023.1 English

H.264/H.265 Video Codec Unit v1.2 Solutions LogiCORE IP Product Guide (PG252)

Document ID
PG252
Release Date
2023-05-16
Version
2023.1 English

Hybrid Log-Gamma (HLG) is a HDR standard aimed at providing backwards compatibility with non-HDR monitors, while also achieving a wider color gamut for HDR monitors. As HLG EOTF is similar to standard gamma functions, HLG streams look proper when played on SDR monitors. Meanwhile, because the gamma and PQ curves are completely different, the PQ EOTF streams are displayed properly and usually look washed out when played on a SDR monitor. Unlike HDR10, HLG does not require any extra metadata that goes along with the video data. HLG streams consist of the HLG transfer characteristics/EOTF and BT2020 color primaries and BT2020 color matrix.

From VCU point of view, there are two types of HLG that can be enabled.

  • There is a backwards compatible mode, that uses the BT2020 value in the SPS VUI parameters, instead of the HLG transfer characteristics. Then the VCU encoder inserts a Alternative Transfer Characteristics (ATC) SEI with the HLG value.
  • There is a HLG only mode. This directly uses the HLG value in the SPS VUI parameters.
Table 1. Format and Parameters
Format VUI SEI
  Color Primaries Transfer Characteristics Matrix Coefficients  
UHD-TV HDR HLG10 9 (BT.2020) 14 (Rec.2020) 9 (BT.2020) preferred_transfer_characteristics=18
UHD-TV HDR HLG10 9 (BT.2020) 18 (HLG) 9 (BT.2020) None

Sample VUI parameters in encoded bitstream for Backward Compatible mode are as follows:

Figure 1. VUI Parameters in Encoded Bitstream for Backward Compatible

Along with the preceding VUI colour_description_parameter, the encoder embeds SEI message (ATC), which indicates that preferred_transfer_characteristics is set to 18.

HLG Only mode VUI is as follows:

Figure 2. HLG Only mode VUI

Sample Gstreamer Pipelines

Gstreamer v4l2src capture element sets corresponding caps information (color-matrix, transfer-function, etc.) if corresponding SDI_Rx is capable for HLG capture, and then gst-omx encoder and parser plug-ins are updated to handle these caps to support HLG.

HLG Only (HLG EOTF) Mode, Sample Serial Pipeline
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=3840, height=2160, framerate=60/1, format=NV16_10LE32 ! queue max-size-bytes=0 !
omxh265enc control-rate=constant target-bitrate=25000 prefetch-buffer=TRUE num-slices=8 ! omxh265dec ! queue max-size-bytes=0 ! fpsdisplaysink
name=fpssink text-overlay=false 'video-sink=kmssink connector-properties="props,sdi_mode=5,sdi_data_stream=8,is_frac=0,sdi_420_in=0,c_encoding=1"
show-preroll-frame=false sync=true'

Backwards Compatible (SDR EOTF + HLG SEI) Serial Pipeline

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=3840, 
height=2160, framerate=60/1, format=NV16_10LE32 ! queue max-size-bytes=0
 ! omxh265enc hlg-sdr-compatible=TRUE control-rate=constant 
target-bitrate=25000 prefetch-buffer=TRUE num-slices=8 ! omxh265dec ! 
queue max-size-bytes=0 ! fpsdisplaysink name=fpssink text-overlay=false 
'video-sink=kmssink 
connector-properties="props,sdi_mode=5,sdi_data_stream=8,is_frac=0,sdi_420_in=0,c_encoding=1"
 show-preroll-frame=false sync=true'

Control-SW Application

Set the following encoder configuration parameters for HLG support.

Section [SETTINGS]:

  • TransferCharac = TRANSFER_BT_2100_HLG
  • ColourMatrix = COLOUR_MAT_BT_2100_YCBCR
  • ColourDescription=COLOUR_DESC_BT_2020
  • EnableSEI = SEI_ATC