Data Compression


Criteria

Survey Formats

Basics

Compression Methods

Data Formats


Huffman Code

Example

Characteristics

Variants

Dynamic Huffman Code

Construction of the Tree

Encoding

Decoding

Alternative Construction

Comparison

Variance

Adaptive Huffman Code


Glossary

Index


Download


www.BinaryEssence.com

Comparison


            Version
Symbol     1       2
 a (5)     0       0
 b (2)     10      111
 r (2)     111     110
 k (1)     1101    101
 d (1)     1100    100

Coding Version 1
   a b  r   a k    a d    a b  r   a
   0 10 111 0 1101 0 1100 0 10 111 0
   -> 23 bit

Coding Version 2
   a b   r   a k   a d   a b   r   a
   0 111 110 0 101 0 100 0 111 110 0
   -> 23 bit

Despite the different individual code lengths the same total length is the result for the sum of the encoded data. Both methods can be used equally with regard to the compression rate.


 <   ^   > 

Alternative Construction Alternative Construction Variance