Professional Documents
Culture Documents
Digital Image Processing: Huffman Coding Example
Digital Image Processing: Huffman Coding Example
1
Entropy = H ( x) Pi ( x) log 2 = 2.08
Bahadir K. Gunturk i Pi ( x) 2
Huffman Coding Example
Another possible tree with the same source is:
0
a1 Symbol | Probability | Codeword
0.4
0 a1 0.4 0
a2 0 a2 0.2 100
0.2
0.4 1.0 a3 0.2 101
1
a3 1 a4 0.15 110
0.2
0 0.6 a5 0.05 111
a4
0.15 1 Average
1 0.2 codeword
a5 length = 0.4*1 + 0.2*3 + 0.2*3 + 0.15*3 + 0.05*3 = 2.2
0.05
per
symbol
Bahadir K. Gunturk 3