0% found this document useful (0 votes)
94 views21 pages

Motion Estimation in H.264 Encoder

This document discusses video compression techniques. It explains that video compression reduces the large amount of data required to store and transmit video files through spatial and temporal compression methods. Temporal compression reduces redundancy between frames by predicting a frame from previous frames and encoding the residual differences. Block-based motion estimation further compresses video by finding matching blocks between frames and encoding motion vectors instead of entire blocks. The adaptive rood pattern search algorithm improves on standard block matching by intelligently predicting search areas based on neighboring motion vectors.

Uploaded by

Talal Khaliq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views21 pages

Motion Estimation in H.264 Encoder

This document discusses video compression techniques. It explains that video compression reduces the large amount of data required to store and transmit video files through spatial and temporal compression methods. Temporal compression reduces redundancy between frames by predicting a frame from previous frames and encoding the residual differences. Block-based motion estimation further compresses video by finding matching blocks between frames and encoding motion vectors instead of entire blocks. The adaptive rood pattern search algorithm improves on standard block matching by intelligently predicting search areas based on neighboring motion vectors.

Uploaded by

Talal Khaliq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

NS Talal Khaliq

Project Supervisor:
Dr. Shoiab A Khan
Outline
Motivation
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.
Temporal
Correlation

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


energy.

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
1
MSE 2
N
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
macroblock.

This residual macroblock is encoded and transmitted together with a


motion vector describing the position of the best matching
macroblock.

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
Blocks
Motion Vectors

Motion vector Correction

Prediction Error

Transmission
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.
Frames

Macro block area defined

Frame Scan

S=max(|X|,|Y|)
Start
loop
again
SDSP

Calculate min cost

LDSP

Motion vectors
Advantages
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

You might also like