



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




1
2
Sources Types Effectiveness
Huffman tree (encoding) Decoding
3
(number of bits needed to represent data)
Reduce transmission cost / latency / bandwidth 4
.zip, .rar Images .jpg, .gif Audio .mp3, .wmv Video .mpg, .mov
5
Exploit using Dictionary Variable length encoding
Can discard less important data 6
Exploits redundancy in data Applied to general data Some lossless audio formats (e.g., FLAC)
Exploits redundancy & human perception Applied to audio, image, video, multimedia
7
Effectiveness of Compression
2 bits / byte 8 bits / byte โโ ยผ original sizeno compression Percentage 75% compression โ ยผ original size
8
Effectiveness of Compression
Organized data^ Example: 1001110100 โ easy^ โ^? Example: 1111111111 โ 1 ร 10
9
Effectiveness of Compression
Reduce size 1 bit Example โ can only store ยฝ of data If compression is always possible (alternative view)^ 000, 001, 010, 011, 100, 101, 110, 111^ โ^ 00, 01, 10, 11 Compress file (reduce size by 1 bit) Recompress output Repeat (until we can store data with 0 bits)
10
Lossless Compression Techniques
Replace patterns with index into dictionary
11
Huffman Code
Exploit statistical frequency of symbols Efficient when symbol probabilities vary widely
Use more bits to represent infrequent symbols A A B A A A B A 12
Huffman Code Example
Huffman โ 1/8ร3 + 1/4ร2 + 1/2ร1 + 1/8ร3 = 1.75 bits / symbol
Symbol
EncodingHuffman 3 bits^110 2 bits^10 1 bit^0 3 bits^111
(^0001) 2 bits 10 11
Frequency 1/8 1/4 Bird1/2 1/ EncodingOriginal 2 bits 2 bits 2 bits
Dog Cat Fish
19
Huffman Tree Construction 4
3 5
2 trees withlowest frequency (^20)
Huffman Tree Construction 5
3 5 8
EI == (^0100) CA == (^10111) H = 110 Huffmancode for each leaf
21
Huffman Coding Example
EI == (^0100) CA == (^10111) H = 110
22
Huffman Code Algorithm Overview
23
Huffman Decoding 1
3 5 8
1111001
24
Huffman Decoding 2
3 5 8
1111001
25
Huffman Decoding 3
3 5 8
1111001 A
26
Huffman Decoding 4
3 5 8
1111001 A
27
Huffman Decoding 5
3 5 8
1111001 AC
28
Huffman Decoding 6
3 5 8
1111001 AC
29
Huffman Decoding 7
3 5 8
1111001 ACE
30
Huffman Code Properties
Example Huffman(โdogโ) โ 01 Can stop as soon as complete code found^ Huffman(โcatโ)^ โ^011 // not legal prefix code No need for end-of-code marker
If more than two trees with same minimal weight