Huffman coding is the classic lossless compression technique that assigns short binary codes to frequent symbols and longer codes to rare ones. Invented by David Huffman as a homework assignment in 1952, it's been the workhorse entropy coder in everything from JPEG and MP3 to early MPEG video and ZIP files. The mathematics is elegant: build a binary tree where common symbols sit close to the root (short codes) and rare symbols sit deep in the tree (long codes), and you provably achieve compression close to the entropy floor for any source where symbol frequencies are known in advance.
The classic example: if the symbol "A" appears 70 % of the time and three other symbols share the remaining 30 %, a fixed 2-bit encoding wastes space. Huffman might encode "A" as just "0", and the others as "10", "110", "111". Now common cases use 1 bit instead of 2, and rare cases pay the price by using 3 bits. The average comes out below 2 bits per symbol — a meaningful saving on long messages.
For a product team, pure Huffman is mostly historical in modern video. JPEG and MPEG-1/2 used it directly; H.264 uses Huffman-style codes inside the simpler cavlc entropy coder, but the better CABAC mode uses arithmetic coding instead. Why the shift: Huffman is limited by its assignment of whole numbers of bits per symbol, whereas arithmetic coding can use fractional bits, getting closer to the entropy floor. The gain is small per symbol but adds up to a few percent of total bitrate. Huffman survives mostly as a foundational concept and inside legacy formats.

