Mmis 03
Mmis 03
Multimedia
Information
Systems (MMIS)
Habtamu A.
@Habtamu Ararsie
InSy4122 habtamuararsie@mtu.edu.et
.
Chapter 3
Multimedia Data
compression
InSy4122
The Need for Compression
⚫Lossless Compression
– Lossless compression can recover exact original data after
compression.
– It is used mainly for compressing database records,
spreadsheets, texts, executable programs, etc., where exact
replication of the original data is essential & changing even
a single bit cannot be tolerated.
– Examples: Run Length Encoding, Lempel Ziv (LZ), Huffman
Coding.
⚫Lossy Compression
– Result in a certain loss of accuracy in exchange for a substantial
increase in compression.
– Forvisual & audio data, some loss of quality can be tolerated
without losing the essential nature of the data where losses
outside visual or aural perception can be tolerated.
⚫ By taking advantage of the limitations of the human sensory system, a
great deal of space can be saved while producing an output which is
nearly indistinguishable from the original.
⚫ In audio compression, for instance, non-audible (or less audible)
components of the signal are removed.
10
Cond…
⚫Lossy Compression
–A sound file in WAV format, converted to a MP3 file
will lose much data
– MP3 employs a lossy compression; resulting in a file
much smaller so that several dozen MP3 files can fit on a
single storage device, vs. a handful of WAV files.
– However, the sound quality of the MP3 file will be
slightly lower than the original WAV.
12 MMIS (Comp. by Habtamu A.)
Types of Compression
M M
m m
M M’
Uncompress Uncompress
M M’
ASCII Code
14
Extended ASCII Code
15
👉 Long Story Short
⚫ Differences
– Lossless compression schemes are reversible
so that the original data can be reconstructed,
– Lossy schemes accept some loss of data in
order to achieve higher degree of compression.
⚫ Fixed Length HC
⚫ Variable length HC
0 1 Code of:
D4 D1 = 000
0 1 D2 = 001
1 D3 D3 = 01
0
D4 = 1
27 D1 D2 MMIS (Comp. by Habtamu A.)
Huffman coding
⚫ Consider
the following table to construct the
Huffman coding.
VWVWWXYZYZXYZYZYXZYW
⚫ Given text:
– ABRACADABRA
– MISSISSIPPI
– Construct the Variable Length Huffman coding?
Symbol A B C D E
Count 15 7 6 6 5
0 0 1 1 1
0 1 0 1 1
0 1
36 MMIS (Comp. by Habtamu A.)
Cond…
A 15 00 30
B 7 01 14
C 6 10 12
D 6 110 18
E 5 111 15
89
Frequency: 16 5 12 17 10 25
A. Using Shannon-Fano coding scheme
B. Using the Huffman algorithm/coding
38 MMIS (Comp. by Habtamu A.)
Lempel-Ziv-Welch (LZW) compression
⚫ How could you further reduce the file size using your
own codeword??
43 MMIS (Comp. by Habtamu A.)
Example: Decompression
– YYZYZZZYZYYZYZZZYZZYZZ
– SATATASACITASA.
46
47