Vous êtes sur la page 1sur 25

Video Coding

Aparna.P
Assistant Professor
Electronics & Communication Dept
NITK, Surathkal

Video Data : Example-Foreman.QCIF


time

Frame 1

Frame 2

Frame 3

Frame 35

Frame 36

Frame 37

Principle of Video Coding

Video Encoder consists of three main blocks:

Temporal Model
Spatial Model
Entropy Coder

Types of coding

Intra coding

Coding a frame within itself.


Poor compression
Robust to packet loss
MJPEG

Inter Coding

Within different frames


Predictive coding
H.26x & MPEG
Error propagation
4

HOW DO WE ACHIEVE VIDEO COMPRESSION ?


BY REMOVING REDUNDANCY
Between frames

Temporal Redundancy

Within
a frame

FRAME 11

FRAME 12

Spatial
Redundancy

Motion estimation and compensation

The amount of data to be coded can be reduced significantly if the :


Previous frame is Subtracted from the Current frame.

The Temporal Model-Motion Estimation And


Compensation
Motion
Estimation

current Frame

Motion
Compensation
subtract

Predicted Frame

Previous Frame

Residual Frame

code

Motion Vectors

Block-Matching Problem

Widely used method for motion compensation is Block


based.

Finding the best match in the previous frame for each


block in the current frame

Computationally most expensive part of the encoding


process

Block Base Motion Estimation

A small block called macro block is selected.

Translation motion within each block is assumed


to be uniform.

Best match for this block in CF is found in RF.

Macro block is moved maximum within an area


called the search window.

16x16 Macroblock

10

MAIN ASPECTS

Search Region

Matching Criteria

Motion Vectors

Search algorithms

11

1. SEARCH REGION

Block size = 16x16


Max. Disp. dmax = 8
Search area = 32 x32
Number of search
points = (2 dmax +1)2
= 289

12

2. MATCHING CRITERIA

Mean Square Error:

1 N 1 N 1
2
MSE = 2 (C ij R ij )
N i 0 j 0

Mean Absolute Error

1 N 1 N 1
MAE = N 2 C ij R ij
i 0 j 0

Sum Absolute Difference


N 1 N 1

SAE =

C ij R ij

i 0 j 0

13

3. MOTION VECTOR

Motion Vectors are used to describe how the different blocks


have moved in reference to a key frame.
14

4. SEARCH ALGORITHMS

a. FULL SEARCH

b. THREE STEP SEARCH


c. 2-d LOG SEARCH

15

-contd
Search Algorithms : Full Search

All candidates within search window are examined

(2 dmax +1)2

Advantage: Good accuracy, Finds best match

Disadvantage: Large amount of computation: (2 dmax

positions should be examined

+1)2 matches,

16x16 MAE for each match Impractical for realtime applications

In order to avoid this complexity, we should reduce


search positions Fast Block Matching Algorithms
16

-contd
Fast Search Algorithms : Three-Step Search

9 Points: Central point & its 8 surroundings


Find the best match
Use previous best as center; Half distance, select 8 new
Repeat algorithm 3 times or till step size is less than 1
Becomes inefficient for small motion estimation.

17

-contd
Fast Search Algorithms : 2-D log Search

Examine central point & its four surroundings

If best match is in center or on boundaries, half


distance from center

Examine five new points centering previous best

When distance is 1, use all 9 matches, find best. Stop

18

Encoder Block Diagram of a


Typical Block-Based Hybrid Coder

Courtesy: Yao Wang, 2003 : Video Coding Basics

19

Decoder Block Diagram

Courtesy: Yao Wang, 2003 : Video Coding Basics

20

Different Coding Modes

Intra: coded directly;


Predictive: predicted from a previous frame;
Bidirectional: predicted from a previous frame and a
following frame.
21

Current Video Standards

:.

Standard Applications

Raw Data
Rate

Compressed
Data Rate

MPEG1

For storing video and Audio


on CD.

30 Mbps

1.5 Mbps

MPEG2

Video compression for digital


TV, DVD.

128 Mbps 3-10 Mbps

MPEG4

General purpose video


compression, Multimedia
distribution over Inter/Intra
net.

H.261

Video conferencing over ISDN

37 Mbps
9.1 Mbps

>=384 Kbps
>=64 Kbps

H.263

Video conferencing over


Internet, phone lines/
wireless.

9.1 Mbps

>=18 Kbps

H.264

Video telephony, streaming,


storage, Digital Cinema.

28-1024
Kbps

Better PSNR
than MPEG-4
for same bit
22
rate.

Acknowledgement

Bernd Girod, Information Systems Laboratory,


Department of Electrical Engineering,
Stanford University
Mara Colomar
Iain E G Richardson ,www.vcodex.com

23

References

Ian E.G. Richardson, H.264 and MPEG-4 video


Compression, Video coding for Next generation
Multimedia, Wiley, 2003.

24

THANK YOU

25

Vous aimerez peut-être aussi