Can AV1 Encode Raw YUV with Identity Transforms?
This article examines whether the AV1 video codec can encode uncompressed raw YUV pixel values directly via identity transformations. In short, while AV1 supports lossless encoding where an identity transform bypasses frequency-domain transformation, it does not support writing uncompressed, raw pixel streams directly into the bitstream. Every sample passes through entropy coding, meaning AV1 achieves bit-exact raw reconstruction through lossless mathematical representation rather than raw uncompressed bit stuffing.
The Role of the Identity Transform in AV1
AV1 includes an Identity Transform (IDTX) mode alongside traditional transforms such as the Discrete Cosine Transform (DCT) and Asymmetric Discrete Sine Transform (ADST). When IDTX is applied both horizontally and vertically, the encoder skips the frequency decomposition entirely. The transform coefficients directly correspond to the spatial domain residual values on a one-to-one basis, ensuring that no spatial information is altered or smeared across frequency bins.
Lossless Mode and Quantization Bypass
To encode exact raw YUV pixel values, AV1 relies on its dedicated
lossless mode. In this mode, the quantizer index (qindex)
is set to zero, and the identity transform is enforced across all
blocks.
When quantization is disabled and the identity transform is active:
- The prediction residual is not scaled or rounded.
- The reconstruction process yields mathematically exact, bit-identical YUV values upon decode.
- Intra-prediction may still predict pixel values from neighboring blocks, but the identity transform ensures the residual preserves every exact delta.
AV1 Lossless vs. True Uncompressed PCM
A key technical distinction exists between lossless identity encoding and "raw uncompressed" encoding:
- Absence of a PCM Mode: Older standards like H.264/AVC and H.265/HEVC include an explicit Pulse Code Modulation (PCM) macroblock mode. In PCM mode, the encoder completely bypasses prediction, transformation, quantization, and entropy coding, writing the raw pixel bits directly into the bitstream uncompressed.
- Mandatory Entropy Coding: AV1 lacks an equivalent raw PCM bypass mode. Even when configured for lossless identity encoding, AV1 requires all coefficient data and residuals to be encoded through its multi-symbol arithmetic entropy coder (derived from the Daala entropy coder).
Supported Formats and Bit Depths
AV1 can losslessly represent pixel data across its supported profiles:
- Subsampling: YUV 4:2:0, 4:2:2, and 4:4:4, as well as RGB.
- Bit Depths: 8-bit, 10-bit, and 12-bit precision.
When working with YUV 4:4:4 or RGB, the full spatial resolution of every color channel is preserved. The decoder reconstructs the exact original integer values for each channel without chroma subsampling artifacts or lossy color conversion.
Summary
AV1 can encode and reproduce exact, uncompressed raw YUV values using identity transforms combined with zero quantization. However, it cannot output raw, uncompressed bytes directly to the bitstream; all values must pass through arithmetic entropy compression.