Title: CHAPTER 7 MPEG1 and MPEG2
1CHAPTER 7MPEG-1 and MPEG-2
2OUTLINE
- Introduction
- The MPEG-1 Video Standard
- MPEG-1 Implementation Issues
- The MPEG-2 Video Standard
- The MPEG-4 Coding Standard
- Future Directions MPEG-7
3Introduction
4Video/Image Standard Applications
5Digital Video Formats
6Progressive Interlace
7MPEG
- MPEG Moving Picture Experts Group
- MPEG includes
- MPEG-1,MPEG-2,MPEG-4,MPEG-7, MPEG-21
- MPEG-1 Standard
- 11172-1 Systems
- 11172-2 Video
- 11172-3 Audio
- 11172-4 Conformance
- 11172-5 Software
8MPEG-1 Standard
- Media storage
- Bitrate Up to about 1.5Mbps
- Completed in 1992
- VCD,MP3
- MPEG-1 does not recognize interlaced sources
9Compression Functions within MPEG
- Sample rate reduction in the spatial and temporal
domains of both the luminance and chromance
components, - Block-based DCT for the intraframes and
interframes, - Block-based motion compensation for predictive
and interpolative interframes, and - Huffman coding for the lossless compression of
motion vectors and the quantized DCT
coefficients.
10Definition of a Macroblock in MPEG-1
11Picture Types
- Intra-pictures (I-pictures) are compressed using
intraframe coding that is, they do not reference
any other pictures in the coded bitstream. - Predicted pictures (P-pictures) are coded using
motion-compensated prediction from past
I-pictures or P-pictures. - Bidirectional predicted pictures (B-pictures)
provide the highest degree of compression. They
are coded using motion-compensated prediction
from either past and/or future I-pictures or
P-pictures.
12Picture Types (Cont.)
- DC-coded pictures (D-pictures) are similar to
I-pictures however, only the DC coefficients
from the DCT outputs are present.
13Bit Distribution among I-, P-, and B- Pictures
160
140
120
Picture size (kbits)
100
80
60
40
20
0
0.00 50.00 100.00
150.00 Picture number (in encoding order)
14MPEG Video Encoder
- Preprocessing
- Color conversion
- Format translation
- Prefiltering
- subsampling
15Coding of I-Picture
16Coding of I-Pictures
- Intra-frame coding
- 8x8 2D DCT
- Differential coding of DC coefficients
- Uniform quantization
- Run length coding of zeros with zig-zagscan
- Entropy coding
17Coding of P-Pictures
18Coding of P-Pictures
- Motion compensated prediction from I-or
P-pictures - One motion vector per microblock
- Coding of prediction error with 8x8 DCT,
- uniform quantization, zig-zag scan (like
P-pictures)
19Coding of B-Picture
20Coding of B-Pictures
- For B-pictures, the motion estimation process is
performed twice, once for a past picture and once
for a future picture, so as to yield two motion
vectors. - The encoder can form a prediction error
macroblock from either of the two candidate
macroblocks or from their average. - In MPEG terminology, this is referred to as
interframe interpolative coding. - The prediction error is then coded using the
block-based DCT. The quantized DCT coefficients
of the prediction errors, together with the
motion vectors are then multiplexed and coded
using the variable-length coder. - Unlike JPEG, MPEG uses only a Huffman coder for
variable-length coding.
21Coding of B-Pictures (Cont.)
- Because of the bidirectional prediction, some
reordering of the input pictures is needed at the
encoder so that they are delivered in the correct
order to the decoder. - In the previous example, the correct encoding
sequence is p1, p4, p2, p3, p7, p5, p6, and p8. - The decoder will need to reorder these pictures
so that they can be displayed in the correct
order.
22Bidirectional Motion Compensation
Past picture
Best matching macroblock
Current picture
MV-1 (x,y)
MV motion vector
Future picture
(x, y)
(x, y) MV-2
-
-
Forward prediction error
Best matching macroblock
Interpolative prediction error
Backward prediction error
1/2
Prediction error
To DCT
MUX
23Structure of the Coded Video Bit Stream
24MPEG Video Decoder
25MPEG-2 Standard
- The range of coding support provided by MPEG is
divided into profile and levels. - A profile is a defined subset of the entire
bitstream syntax specified by MPEG-2. The
profiles are Simple, Main, 422, SNR, Spatial,
High, and Multiview. - Within a profile, a level is defined as a set of
constraints imposed on the parameters of the bit
stream, such as picture resolution or maximum bit
rate. - For each profile, the four levels are Low (for
SIF resolution pictures, Main (for CCIR 601
resolution pictures, High-1440, and High (for
HDTV resolution pictures)
26MPEG-2 Standard (Cont.)
- MPEG-2 is backward compatible with MPEG-1 that
is, an MPEG-2 decoder should be able to decode an
MPEG-1 coded stream. - MPEG-2 suppotrs both interlaced and noninterlaced
pictures. - In addition to the 420 format used in MPEG-1,
MPEG-2 also supports the 422 and 444 color
subsampling formats. - When the coded bit stream has no scalable
extensions, then all blocks within a macroblock
are 8 ? 8. With scalable extensions, macroblocks
may contain scaled blocks with lower resolutions,
such as 1 ? 1, 2 ? 2, or 4 ? 4.
27MPEG-2 Standard (Cont.)
- The structure of the luminance macroblocks is
different for frame DCT coding and field DCT
coding.
28Prediction Modes and Motion Compensation
- In MPEG-2, the picture sequence can be either a
collection of frame pictures or a collection of
field pictures. - Two classes of prediction are supported, namely,
frame prediction and field prediction.
Top Field
TOP Field
TOP Field
First Field
Bottom field of frame
Bottom Fields
Bottom Fields
Second Field
Reference frame
Field Prediction
29Field and Frame Prediction
- In MPEG-2, unlike, all motion vectors are
specified at half-pixel resolution. - Let (u, v) denote the motion vector of the
luminance components in a macroblock Due to the
subsampling of the chroma components, their
motion vectors are given by(u/2, v/2) for the
420 format and by (u/2, v) for the 422
format. - For the 444 sampling format, the chroma
components use the motion vectors of the
luminance without any scaling.
30Field and Frame Prediction (Cont.)
- To improve the prediction efficiency, MPEG-2
provides two additional motion compensation
modes. - 16 ? 8 motion-compensation mode.
- Dual-prime motion compensation