You are on page 1of 21

NS Talal Khaliq

Project Supervisor:
Dr. Shoiab A Khan
A picture is worth a thousands words.

If this holds true, how a moving picture (video) which

contains so much information is transmitted so efficiently?
Problem background
Example an single video frame with 720x576 pixels with color depth of 24
bits per pixel with 29.97 frames per second uses approximately 200Mbs,
thus for a two hour program at this rate takes over 200 GB which is
practically impossible to store.
What is Video Compression?
It refers to reducing the quantity of data, and is
a combination of spatial image compression and
temporal motion compensation.

Spatial Correlation
Temporal Model
It reduces redundancy between transmitted frames by
forming a predicted frame and subtracting this from the
current frame.

The resulting residual (difference) frame contains less


The residual frame is then encoded.

Block-based Motion Estimation

This method is used to compensate for motion of

rectangular frames or blocks in current frame.

It involves finding a 4x4 sample region in a reference frame

that closely matches the current macroblock.

Macroblock with minimum energy is chosen as best match.

Cost Function
Mean Absolute Difference(MAD),
1 N 1 N 1
MAD 2 | Cij Rij |
N i 0 j 0
Mean Squared Error(MSE),
N 1 N 1
ij ij
(C R
i 0 j 0
) 2

where N is the side of macroblock, Cij and Rij are the pixels being compared.
Motion Compensation
The selected best matching region in the reference frame is
subtracted from the current macroblock to produce a residual

This residual macroblock is encoded and transmitted together with a

motion vector describing the position of the best matching

Motion vector is the offset between the current block and the position
of the candidate region.
Past Frame Current Frame

Frame Segmentation Blocks

Search Threshold

Block Matching
Motion Vectors

Motion vector Correction

Prediction Error

Example Video
Frame 10 Frame 11
Adaptive Rood Pattern Search Algorithm
General motion in the frame is usually coherent.

It uses the motion vector of macro block to its immediate left to

predict its own motion vector.

It directly puts the search in an area where there is a high probability

of finding a good matching block.
Predicted motion vector
is (3,-2) and step size S,

S=max(3,-2)=> 3.

Macro block area defined

Frame Scan


Calculate min cost


Motion vectors
We do not have to compute whole frame like in Exhaustive Search.

It does not waste time doing LDSP. It starts with SDSP unlike in
Diamond Search.

It does not always start from centre or extreme left and thus saves
computation time.
Video 2
Frame 110 Frame 113
Video 3
Frame 220 Frame 222