You are on page 1of 19

Compression &

Decompression

Basics of Information Theory

It is to discover mathematical laws that governs a


system designed to manipulate or communicate
information.

Tomorrow, the sun will rise from the east.


The sun will rise in the next one hour.

The sun will rise from west from next month.

Code Types
Fixed-length codes - all codewords have same length
A 000, B 001, C 010, D 011, E 100, F 101

Variable-length codes - may give different lengths to


codewords
A 0, B 00, C 110, D 111, E 1000, F 1011

Prefix code - No codeword is prefix of any other codeword


A = 0; B = 10; C = 110; D = 111

Compression
Why ?
To reduce the volume of data to be transmitted (text,
images, video)
To reduce the bandwidth required for transmission
and
To reduce storage requirements (speech, audio, video)
How ?
Redundancy in digital audio, image, and video data
Properties of human perception

Compression Principles

Source encoders & Destination decoders


Lossless and Lossy Compression
Entropy encoding Run-length encoding and
Statistical encoding
Source encoding Differential encoding and
Transform encoding

Text Compression

Static Huffman Coding


Dynamic Huffman Coding
Arithmetic Coding
Lempel Ziv Coding
Lempel Ziv Welsh Coding

Static Huffman Coding

Contd
Symbol

It is a block code each


source symbol is mapped
into a fixed sequence of
source symbols.
It is uniquely decodable
any string of code
symbols can be decoded
only in one way.

a1
a2
a3
a4
a5
a6

Codewor
d
0
11
100
1011
10101
10100

LZ & LZW Coding

LZ Coding Dictionary based coding


- Table containing all the possible character strings that
occur in the text to be transferred is held by both the
transmitter and receiver.
LZW Coding
- Encoder and decoder will build the dictionary
dynamically as the text is being transferred.

Arithmetic Coding

A complete message may be fragmented into multiple


smaller strings.
A codeword corresponding to each string is found separately.
There is no one-to-one correspondence between the source
symbol and the code word.
Entire sequence assigns a single code word.

Image Compression

Two dimensional array of pixel values


Spatial redundancy and temporal redundancy
Human eye is less sensitive to the higher spatial frequency
components

JPEG
Image/block preparation
DCT computation
Quantization
Entropy coding
Frame building

Equations for 2D DCT

n=m=8 ; c(u)=c(v) = 1/2 for u=v=0;


= 1 for all other values of u and v ;

Video Compression
Video is a sequence of pictures (or frames)
High correlation between successive frames.
A combination of actual frame contents and predicted frame
contents are used.
Motion estimation
- The accuracy of the prediction operation is determined by how
well any movement between successive frame is estimated.
Motion compensation
- If the estimation is not exact, additional information is also sent to
indicate any small difference between the predicted and actual
position of the moving segments involved.

Frame Types

Interframe and intraframe coding.


I-frames are coded without reference to other frames. Serve as
reference pictures for predictive-coded frames.
P-frames are coded using motion compensated prediction from a
past I-frame or P-frame.
B-frames are bidirectionally predictive-coded. Highest degree of
compression, but require both past and future reference pictures
for motion compensation.
D-frames are DC-coded. Of the DCT coefficients only the DC
coefficients are present. Used in interactive applications like
VoD for rewind and fast-forward operations
I B B P B B P B B I (display order)
Bitstream order -- I P B B P B B P B B I

Audio Compression
Exploit the properties and limitations of the human ear

Perceptual features
- Pitch, Period and Loudness

Psycho-acoustic model
- sensitivity of the ear
- frequency masking
- temporal masking

Frequency masking

Temporal masking

MPEG Encoder & Decoder

MPEG Std.

MPEG-1: Video CD and MP3.


MPEG-2: Digital Television set top boxes and DVD
MPEG-4: Fixed and mobile web
MPEG-7: description and search of audio and visual
content
MPEG-21: Multimedia Framework

You might also like