Ch. 1 · Video Basics

한국어日本語
9 min

SDR vs HDR: Gamma, PQ, and HLG Transfer Functions Explained

Code values don't map linearly to brightness. The transfer curve separates SDR from HDR. Gamma, PQ vs HLG, and the CICP tags that keep HDR from looking gray.

Many engineers gloss over this part. Get it right and you'll be well ahead in HDR work.

First: breaking down the names SDR and HDR

SDR = Standard Dynamic Range, HDR = High Dynamic Range. 'Dynamic range' here means the span between the darkest and brightest points a screen can represent simultaneously within a single scene. SDR keeps this span narrow (peak brightness around 100 nits), while HDR uses a much wider span, 1,000 to 10,000 nits. In other words, HDR isn't a vague 'better picture quality' but a concrete spec difference: a wider range of light and dark itself.

An analogy — the 'HDR mode' on a smartphone camera

Say you're taking a photo in a room where the view outside the window is blazing bright and the interior is dark. With normal mode (the SDR equivalent), if you expose for the scenery outside, the interior is crushed to black; if you expose for the interior, the outside blows out to white — you can't have both. HDR mode, by contrast, keeps the detail in both bright and dark areas at the same time. A real camera's HDR mode merges multiple exposures, so it's implemented differently from video HDR, but the goal — 'preserve both the bright and the dark in a single frame' — is exactly the same.

  • The typical visible difference — highlights of sunlight reflecting off water stay as sparkles instead of blowing out to white.
  • In night scenes, dark background detail (stars, objects in shadow) stays alive instead of getting crushed.
  • Even with bright and dark areas in the same frame, both keep their gradation, so the sense of depth and contrast ratio grow noticeably.
Easy to confuse — HDR ≠ more vivid color

HDR is originally a spec about brightness (dynamic range). In reality, though, HDR content almost always comes bundled with a wider color gamut (BT.2020, WCG) and bit depth of 10 or more, so it's easy to get the impression that 'HDR = more vivid color and better picture quality.' Keep in mind that it's a separate axis from the color gamut (BT.2020), covered later in this chapter, and you won't get confused.

The key question

"Is code value 128 half of maximum brightness?" — The answer is no. Between code values and physical brightness there's a nonlinear curve called the transfer function.

Why nonlinear

Two reasons, one historical and one physiological, overlap.

  1. 1The physics of CRTs — Old cathode-ray tubes produced brightness roughly proportional to the input voltage raised to the power of about 2.2. So the camera side applied the inverse function (≈ the 1/2.2 power) in advance before sending. This is the origin of gamma correction.
  2. 2The characteristics of the human eye — Human brightness perception is close to logarithmic. We see fine differences in dark regions well and are dull to differences in bright regions. So assigning many code values to the dark end is the efficient way to spend bits.
A lucky coincidence

① was purely a hardware matter and ② is physiology, yet the shapes of the curves were almost the same. Thanks to that, gamma correction became both a 'compatibility device' and a 'perceptually optimal encoding.' It's the luckiest coincidence in video history.

Code value (0 → max) Brightness (nit) linear Gamma 2.4 (SDR, BT.1886) PQ (HDR, up to 10,000 nit) 0 max
Transfer functions: code value (horizontal) → actual brightness (vertical). The more the curve bends downward, the more codes are assigned to the dark end

SDR — gamma 2.2 / 2.4

This is the video we've watched for decades. The reference white is about 100 nit (cd/m²), and the curves are the BT.709 OETF / BT.1886 EOTF. The important point is that in SDR, code value 235 (white) isn't 'an absolute brightness of 100 nit' but 'the white that display can produce.' In other words, it's relative.

HDR — PQ and HLG

PQ (SMPTE ST 2084)HLG (ARIB STD-B67 / BT.2100)
ApproachSpecifies absolute brightnessRelative brightness (interpreted by the display)
PeakCan represent up to 10,000 nitProportional to the display's capability
SDR compatibilityNone (needs a dedicated pipeline)Looks passable even on SDR displays
MetadataRequired (mastering display info)Not needed
Main useNetflix, Disney+, UHD Blu-ray, filmsLive broadcasts, terrestrial and satellite TV
Representative specsHDR10, HDR10+, Dolby VisionHLG10
PQ and HLG in one line

PQ commands 'this pixel shall glow at exactly 350 nit.' The creator's intent is preserved exactly, but if the display can't produce that brightness, tone mapping is needed. HLG says 'this pixel shall glow at some percentage of your maximum brightness.' It looks decent on whatever display you plug it into, so it suits live broadcasts.

What does this have to do with codecs — VUI / CICP

This is the crux. The codec itself doesn't 'compress' HDR. What a codec does is just compress numbers, and metadata tells you how to interpret those numbers. Three codes go inside the bitstream's VUI (Video Usability Information).

The CICP trio — color metadata shared by every codec
colour_primaries        : what the color gamut is       (1=BT.709, 9=BT.2020)
transfer_characteristics: what the transfer function is (1=BT.709, 16=PQ, 18=HLG)
matrix_coefficients     : RGB<->YCbCr coefficients      (1=BT.709, 9=BT.2020 NCL)
In the field — 90% of HDR accidents

The cause of "the HDR video looks gray" or "the colors look weirdly neon" is mostly a missing or wrong CICP tag. The pixel data is fine, but the player interpreted PQ as gamma 2.4. Checking that the trio is preserved when transcoding is absolute basics. You can check it in ffprobe -show_streams via the three fields color_primaries / color_transfer / color_space. The steps for diagnosing why colors look washed out are covered in Chapter 14.

SDRStandard Dynamic Range

Standard Dynamic Range. The traditional spec with a narrow light-to-dark span. Reference white about 100 nit.

HDRHigh Dynamic Range

High Dynamic Range. A spec with a wide light-to-dark span. Highlights stay alive up to 1,000+ nit.

OETF / EOTFOpto-electronic / electro-optical transfer function

OETF is light → code value (camera); EOTF is code value → light (display).

PQ (ST 2084)Perceptual Quantizer

An HDR transfer function based on absolute brightness. Up to 10,000 nit.

HLGHybrid Log-Gamma

HDR based on relative brightness. Backward compatible with SDR; used for broadcast.

CICPCoding-independent code points

A table that standardizes primaries/transfer/matrix as numbers. ITU-T H.273.

nit (cd/m²)nit (cd/m²)

Unit of brightness. SDR reference white ≈100, HDR highlights 1000+.

Tone mappingTone mapping

Rearranging brightness to fit a display with a different range.

Check yourself

What is the most essential difference between PQ and HLG?

Check yourself

When an HDR video plays back hazy with strange saturation, what should you suspect first?