JPEG - Idea and Practice/Appendix 1: Summary of the header segments

DQT (quantization)

Marker = (255, 219)
Length = (0, 67)
0 (½ byte)
destination identifier (½ byte)(for instance 0 for the Y component and 1 for the colour components)
the table (64 bytes)

SOF (frame)

Marker = (255, 192)
Length = (0, 8 + 3 * number of components)
8
width = b1*256 + b2, pair (b1, b2)
height = b1*256 + b2, pair (b1, b2)
number of components (1-3)
for each component:
component identifier (for instance 0, 1, 2 for the YCbCr components)
Hi (½ byte)(1 for the colour components, 1 or 2 for the Y component)
Vi (½ byte)(1 for the colour components, 1 or 2 for the Y component)
quantization table destination selector (for instance 0 for the Y component and 1 for the colour components)

DHT (Huffman)

Marker = (255, 196)
Length = (0, 19 + number of Huffman values (nhv))
0 for DC, 1 for AC (½ byte)
destination identifier (½ byte)(for instance 0 for the Y component and 1 for the colour components)
the list BITS (16 byte)
the list HUFFVAL (nhv bytes)

SOS (scan)

Marker = (255, 218)
Length = (0, 6 + 2 * number of components)
number of components (1-3)
for each component:
component identifier (for instance 0, 1, 2 for the YCbCr components)
destination selector of DC Huffman table (½ byte)(for instance 0 for the Y component and 1 for the colour components)
destination selector of AC Huffman table (½ byte)(for instance 0 for the Y component and 1 for the colour components)
0
63
0