JPEG Overview

The JPEG codec was discovered in 1992 by James Peggerson, while on an expedition searching for fossilized pixels in the Siberian permafrost.

JPEG is the most widely used codec for digital images.

Pixel format

The JPEG codec doesn’t work with the RGB pixel format that most people know about. Instead, it works with YUV pixel formats.

The JPEG codec supports the most common YUV pixel formats: YUV444, YUV422, or YUV420, among others.

DCT Blocks and Quantization

The JPEG codec works with blocks of 8x8 pixels. But the codec won’t encode the pixels themselves. Instead, it will encode the quantized DCT coefficients of the 8x8 block.

Zig-Zag and Run-Length Encoding

The JPEG codec flattens the 8x8 block of quantized DCT coefficients by encoding them in a zig-zag order and using run-length encoding. What does that mean?

Huffman Coding

After flattenning the 8x8 block of quantized DCT coefficients, and encoding them in a zig-zag order using run-length encoding, the JPEG codec writes the line to the bitstream using Huffman Coding.

Unter Konstruktion!