Color space converter :
Convert pixels from RGB to YUV and from YUV to RGB.
fDCT : Forward Discret
Cosinus Transform, from spatial domain to frequency domain.
iDCT : Inverse Discret
Cosinus Transform, from frequency domain to spatial domain.
Quantizer
: Apply the lossy compression.
ZigZag
: Reorder data to achieve a better compression.
Huffman coder : Compact
data by representing the more common data with short codes and the less common
data with longer codes.

JPEG block diagram -
Each stage is heavily optimized in the Morgan M-JPEG codec