Libvpx Supported Color Spaces and Pixel Formats
This article provides a detailed breakdown of the pixel formats, chroma subsampling configurations, bit depths, and color spaces supported by the libvpx library. As the official software codec library for the VP8 and VP9 video formats, libvpx has varying levels of support depending on which codec version is utilized. Below is a direct guide to these technical specifications.
VP8 vs. VP9 Capabilities
The libvpx library houses encoders and decoders for both the VP8 and VP9 video codecs. However, their capabilities regarding pixel formats and color spaces differ significantly:
- VP8: Designed primarily for web video in the early 2010s, VP8 has very rigid constraints, supporting only standard-definition and high-definition SDR (Standard Dynamic Range) configurations.
- VP9: Designed to compete with HEVC/H.265, VP9 introduces profiles that support high bit depths, professional chroma subsampling formats, and Wide Color Gamut (WCG) / High Dynamic Range (HDR) color spaces.
Supported Pixel Formats and Bit Depths
Pixel formats in libvpx are defined by their chroma subsampling structures (YUV ratios) and color depth (8-bit, 10-bit, or 12-bit).
VP8 Supported Formats
VP8 is strictly limited to 8-bit color depth and a single chroma
subsampling format: * YUV 4:2:0 planar (8-bit):
Commonly mapped as VPX_IMG_FMT_I420 (or
yuv420p in tools like FFmpeg).
VP9 Supported Formats (by Profile)
VP9 uses “Profiles” (0 through 3) to define its support for various pixel formats and bit depths:
- Profile 0 (8-bit, 4:2:0):
- Supports YUV 4:2:0 planar at 8-bit depth
(
VPX_IMG_FMT_I420). This is the most common format for consumer web delivery.
- Supports YUV 4:2:0 planar at 8-bit depth
(
- Profile 1 (8-bit, 4:2:2 / 4:4:4):
- Supports YUV 4:2:2 planar (
VPX_IMG_FMT_I422) - Supports YUV 4:4:4 planar (
VPX_IMG_FMT_I444) - Supports YUV 4:0:0 (Grayscale / monochrome)
- Supports YUV 4:2:2 planar (
- Profile 2 (10-bit / 12-bit, 4:2:0):
- Supports YUV 4:2:0 planar at 10-bit depth
(
VPX_IMG_FMT_I42016) - Supports YUV 4:2:0 planar at 12-bit depth
- Supports YUV 4:2:0 planar at 10-bit depth
(
- Profile 3 (10-bit / 12-bit, 4:2:2 / 4:4:4):
- Supports YUV 4:2:2 planar at 10-bit or 12-bit depth
(
VPX_IMG_FMT_I42216) - Supports YUV 4:4:4 planar at 10-bit or 12-bit depth
(
VPX_IMG_FMT_I44416) - Supports Grayscale at 10-bit or 12-bit depth
- Supports YUV 4:2:2 planar at 10-bit or 12-bit depth
(
Supported Color Spaces and Metadata
To properly render colors, libvpx allows you to flag specific color space parameters (color primaries, transfer characteristics, and matrix coefficients) within the bitstream metadata. These parameters conform to the ITU-T H.273 / ISO/IEC 23001-8 standards.
The VP9 encoder in libvpx supports the following color space configurations:
1. Color Primaries
These define the color gamut (the range of colors the video can display): * BT.601 (SMPTE 170M / ITU-R BT.601): Used for standard-definition (SD) video. * BT.709 (ITU-R BT.709): The standard gamut for high-definition (HD) video and sRGB-based web content. * BT.2020 (ITU-R BT.2020): Used for Ultra-HD (4K/8K) video and wide color gamut HDR content. * SMPTE 240M: Older studio standard primary. * EBU Tech. 3213 / P3D65: Used for digital cinema-grade color mapping.
2. Transfer Characteristics
These define the opto-electronic transfer function (gamma curve): * BT.709 / BT.601: Standard gamma curves for SDR video. * Linear: Linear transfer characteristics. * sRGB: Standard transfer function for PC monitors and graphics. * SMPTE 2084 (PQ / Perceptual Quantizer): Used for HDR10 and Dolby Vision. * BT.2100 HLG (Hybrid Log-Gamma): Used for HDR broadcasting.
3. Matrix Coefficients
These define how RGB color signals are converted into YUV luma and chroma components: * BT.601 * BT.709 * BT.2020 (Non-constant luminance) * SMPTE 240M
Note: VP8 is generally restricted to BT.601 and BT.709 color space signaling.