Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the real-world applications of huffman coding?

I am told that Huffman coding is used as loseless data compression algorithm, but I am also told that real data compress software do not employ Huffman coding, because if the keys are not distributed decentralized enough, the compressed file could be even larger than the orignal file.

This leaves me wondering are there any real-world application of Huffman coding?

like image 484
Jichao Avatar asked Feb 04 '10 11:02

Jichao


People also ask

Where Huffman algorithm is used?

Huffman is widely used in all the mainstream compression formats that you might encounter - from GZIP, PKZIP (winzip etc) and BZIP2, to image formats such as JPEG and PNG.

What are the advantages of Huffman coding?

The Huffman encoding scheme takes advantage of the disparity between frequencies and uses less storage for the frequently occurring characters at the expense of having to use more storage for each of the more rare characters.

How is Huffman coding useful in space research?

Given some set of documents for instance, encoding those documents as Huffman codes is the most space efficient way of encoding them, thus saving space. This however only applies to that set of documents as the codes you end up are dependent on the probability of the tokens/symbols in the original set of documents.


Video Answer


2 Answers

Huffman is widely used in all the mainstream compression formats that you might encounter - from GZIP, PKZIP (winzip etc) and BZIP2, to image formats such as JPEG and PNG.

All compression schemes have pathological data-sets that cannot be meaningfully compressed; the archive formats I listed above simply 'store' such files uncompressed when they are encountered.

Newer arithmetic and range coding schemes are often avoided because of patent issues, meaning Huffman remains the work-horse of the compression industry.

like image 125
Will Avatar answered Oct 06 '22 16:10

Will


See Wikipedia article on the subject:

Huffman coding today is often used as a "back-end" to some other compression method. DEFLATE (PKZIP's algorithm) and multimedia codecs such as JPEG and MP3 have a front-end model and quantization followed by Huffman coding.

like image 37
Anton Gogolev Avatar answered Oct 06 '22 16:10

Anton Gogolev