Supported libavif Transfer Characteristics for HDR

This article outlines the specific color transfer characteristics supported by the libavif library for encoding and decoding High Dynamic Range (HDR) images. It details how libavif utilizes Coding Independent Code Points (CICP) defined in the ISO/IEC 23091-2 and ITU-T H.273 standards to handle HDR formats like HDR10 and HLG, ensuring accurate brightness and color rendering across compatible displays.

CICP and HDR in libavif

The AVIF image format relies on the AV1 video codec bitstream, which uses Coding Independent Code Points (CICP) to specify color properties. These properties include color primaries, matrix coefficients, and transfer characteristics.

For HDR content, the transfer characteristics (often referred to as the transfer function or gamma curve) define how digital pixel values are mapped to physical light intensity.

Primary Supported HDR Transfer Characteristics

The libavif library supports the following key HDR transfer characteristics:

1. SMPTE ST 2084 (PQ / Perceptual Quantizer)

2. ARIB STD-B67 (HLG / Hybrid Log-Gamma)

3. Linear

Auxiliary Transfer Characteristics

While the following are technically supported by libavif, they are less common for dedicated HDR presentation:

Implementation in libavif

When encoding an AVIF image, you specify these characteristics in the avifImage structure using the transferCharacteristics field. For example, setting this field to 16 flags the image as PQ HDR. Compatible web browsers and image viewers read this metadata to trigger the display’s HDR pipeline, ensuring the image is rendered with the intended contrast and highlight retention.