MPEG 2 Compression_Methods
-
Upload
jancyphilip -
Category
Documents
-
view
218 -
download
0
Transcript of MPEG 2 Compression_Methods
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 1/21
Compression Methods
MPEG-2 and JPEG
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 2/21
Compression, why and how ?
We want to remove as much data as possible withoutaffecting the picture quality (bandwidth = money)
Our eyes are less sensitive to high frequency componentsin a video frame
The decoding must be done in realtime (but encoding cantake some time)
MPEG-2 (Moving Picture Expert Group) defines a set toolsfor compression.
Compression rates can vary over time
The video stream indicates the compression tools that areactually used together with parameters needed fordecoding.
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 3/21
Bitrates of uncompressed video
8 bits/sample
720 samples/line
576 lines/frame
25 frames/s
gives a bitrate of 83 Mbit/s for each of the three components Y, Cr and Cb
Symbolrate of a typical transponder is 27 MSymbols/s which correspondsto a bitrate of 36Mbit/s for video
Each transponder contains in average 6 different video streams
The compression factor has to be (2 * 83) / ( 36 / 6) = 28 !!!
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 4/21
Compression of Fixed Pictures
8
8
Divi de the pic ture i nto Mac roblocks to faci l i tate DS P.
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 5/21
Two Digital FormatsMacroblock in 4:2:2 Macroblock in 4:2:0
= luminance sample
= crominance sample
Cr Cb Y YCr Cb
16
16
4 4
4
16
1616
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 6/21
DCT (Discrete Cosine Transform)Each macroblock (8x8 pixels) can be transformed fromthe time domain to the frequency domain.
A matrix indicates the amplitude of eachfrequency component.
2 components
3 components 4 components
´more components gives more details...
...but our eyes are less sensitive to highfrequency components´
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 7/21
Contribution of the DCT Coefficients
Vertical Frequency
Horizontal Frequency
DC Coefficient
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 8/21
Picture Quality
Only one DCT coefficient 3 Coefficients is enough for anice picture.
Seems like we don¶t have to transmit the high frequqency components.....
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 9/21
Quantization and Treshholding
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 10/21
Read the Coefficients the Zig Zag way...
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 11/21
Apply RLC (Run Length Coding)....
No Coding :G G G G G G G G G G G G G G G G B B B B B B B B B B R R R R R
Run Length Coding : 16*G 10*B 5*R
G = Greean
R = Red
B = Blue
Equal element s i n a row do not hav e to be c oded i nd ivi dually, just transmi t the element-c ode and the number of succ essiv e occ uranc es !
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 12/21
..and VLC (Variable Length Coding)Example : alphabet coding
(most frequent letters arecoded with fewer bits)
A 0 40
C 10
G 111E 1100
H 11011
B 110100
F 110101
V i deo sig nal s al so c ontai ns more or less frequent element s ( DCT c oeff ici ent s)
?
0 1
10
11
110
1101
11010
110100
111
1100
11011
101100
110101
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 13/21
Some Remarks..
Picture data is now compressed by a factor 8 (at least)...
The process is the same as for JPEG
Compression of Y, Cr and Cb is done separately
The decompression must be done in realtime
The process is referred to as intra-frame-coding(removes redundancy within a frame)
There are still a lot of redundancy to remove if we consider
several frames (inter-frame-coding)
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 14/21
Compression of Moving Pictures
MPEG-1 : maximum bitrate = 1.5Mb/s (CD_ROM storage)
MPEG-2 : allows higher bitrates, supports interlaced pictures
MPEG-2 is back compatible with MPEG 1 MPEG-2 can be divided into several profiles and levels
± The level describes the resolution
± The profile describse the set of tools used for the compression
± Digital (DVB) TV uses MP@ML (Main Profile@ Main Level)
MPEG1/2 contains compressing tools for audio too...
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 15/21
I, P and B Pictures I (Intra) pictures
± Coded without reference to other pictures
± Contains all necessary ino for their reconstruction
± Comparable with a JPEG picture
± Relatively low compression rate (about 1:8)
P (Predicted) pictures
± Coded from preceeding I or P pictures using motion compensation ± Higher compression rate (about 1:25)
B (bidirectional) pictures
± Coded by bidirectional interpolation between preceeding and following I and P pictures
± High compression rate (about 1:70)
I, P and B pictures are arranged in a Group of Pictures (GOP)
± MP@ML has the parameters (M,N) = (3,12)
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 16/21
MPEG Video Layers
I B B P B B P B B P B B I
Group of Pictures Layer (GOP)
Slice Layer
Macroblock Layer
Block Layer
Y1 Y2
Y4Y3Cr Cb++
.....
Sequence Layer
4
4
16
16
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 17/21
The Elementary Stream
Sequence header Sequence header Video sequence Video sequence
GOP GOP GOPSequence header
GOP header Picture Picture Picture
Picture Header Slice Slice Slice
Slice Header Macroblock Macroblock Macroblock
Macroblock header Block1(Y) Block2(Y) Block3(Y) Block4(Y) Block5(C) Block6(C)
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 18/21
Reordering of pictures
B BI P B B P B B P B B I
2 341 5 67 8 910
11
1213
I B B P B B B BP IB B
1 2 3 4 5 6 7 8 9 10
11
12 13
P
Display Order
Video Stream Order
Both I and P pictures are needed in advance to code/decode the B picture
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 19/21
Motion Estimation
Frame1 Frame2
Search Window(Block Matching)
Only the motion (displacement) vectors of the macroblocks are transmitted
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 20/21
Coding P pictures I and P pictures can differ a lot so a difference picture isencoded (pixel by pixel difference)
Also called predicted error
For the same reason as for I pictures, DCT, VLC and RLC codingis applied to the predicted pictures Both motion vectors andpredicted errors defines the P picture (motion compensation)
8/3/2019 MPEG 2 Compression_Methods
http://slidepdf.com/reader/full/mpeg-2-compressionmethods 21/21
Coding B picture
Linear Interpolation (of prediction error and motion vectors) between previous and following I and(or) P pictures
I and P pictures needed in advance to create B pictures
I P B BI B B P