Professional Documents
Culture Documents
Basic Video Compression Techniques
Basic Video Compression Techniques
1
Fundamentals of Multimedia, Chapter 10
2
Fundamentals of Multimedia, Chapter 10
3
Fundamentals of Multimedia, Chapter 10
4
Fundamentals of Multimedia, Chapter 10
5
Fundamentals of Multimedia, Chapter 10
6
Fundamentals of Multimedia, Chapter 10
Temporal Redundancy
7
With difference coding, only the first image (I-frame) is coded in its entirety. In the two
following images (P-frames), references are made to the first picture for the static elements, i.e.
the house. Only the moving parts, i.e. the running man, are coded using motion vectors, thus
reducing the amount of information that is sent and stored.
Fundamentals of Multimedia, Chapter 10
Temporal Redundancy
8
Fundamentals of Multimedia, Chapter 10
Temporal Redundancy
9
Fundamentals of Multimedia, Chapter 10
• The pixel Cn(x, y) shown in the frame n has moved to a new location
in frame n+1. Consequently, Cn+1(x, y) in frame n+1 is not the same as
Cn(x, y) but is offset by the motion vector (dx,dy).
11
• the small error difference e(x,y) = Cn+1(x, y) - Cn(x+dx, y+dy)
Fundamentals of Multimedia, Chapter 10
12
Fundamentals of Multimedia, Chapter 10
Motion Compensation
13
Fundamentals of Multimedia, Chapter 10
Motion Compensation
How it works
• It exploits the fact that, often, for many frames of a
movie, the only difference between one frame and
another is the result of either the camera moving or an
object in the frame moving.
• In reference to a video file, this means much of the
information that represents one frame will be the same
as the information used in the next frame.
• Using motion compensation, a video stream will contain
some full (reference) frames; then the only information
stored for the frames in between would be the
information needed to transform the previous frame into 14
the next frame.
Fundamentals of Multimedia, Chapter 10
Motion Compensation
15
Fundamentals of Multimedia, Chapter 10
Motion Compensation
Size of Macroblocks
• Larger macroblocks
fewer motion vectors to compress,
but also tend to increase the prediction error. This is because
larger areas could possibly cover more than one moving region
within a large macro block. 18
Fundamentals of Multimedia, Chapter 10
20
Fundamentals of Multimedia, Chapter 10
• I-frames:
• These are intra-frames coded where only spatial redundancy is used to
compress that frame.
21
Fundamentals of Multimedia, Chapter 10
• P-frames:
• P-frames are predictive coded (forward predictive coding method ),
exploiting temporal redundancy by comparing them with a
preceding reference frame
• Are not independent (it is impossible to reconstruct them without the
data of another frame (I or P))
• They contain the motion vectors and error signals
• P-frames need less space than the I-frames, because only the differences
are stored. However, they are expensive to compute, but are
necessary for compression
• An important problem the encoder faces is when to stop predicting
using P-frames, and instead insert an I frame
• An I frame needs to be inserted where P frames cannot give much
compression
22
• This happens during scene transitions or scene changes, where the error
images are high.
Fundamentals of Multimedia, Chapter 10
27
Fundamentals of Multimedia, Chapter 10
28
Fundamentals of Multimedia, Chapter 10
The MB containing part of a ball in the Target frame cannot find a good matching MB in
the previous frame because half of the ball was occluded by another object. A match
however can readily be obtained from the next frame. 33
Fundamentals of Multimedia, Chapter 10
34
Fundamentals of Multimedia, Chapter 10
MPEG B-Frames
35
Fundamentals of Multimedia, Chapter 10
MPEG B-Frames
36
Fundamentals of Multimedia, Chapter 10
MPEG B-Frames
39
Fig 10.9: MPEG Frame Sequence.
Fundamentals of Multimedia, Chapter 10
Pattern 1: IPPPPPPPPPP
Dependency: I <---- P <---- P <---- P ...
• I-frame compressed independently
• First P-frame compressed using I-frame
• Second P-frame compressed using first P-frame
• And so on...
40
Fundamentals of Multimedia, Chapter 10
Pattern 2: I BB P BB P BB P BB P BB P BB P
Dependency: I <---- B B ----> P <---- B B ----> P ...
• I-frame compressed independently
• First P-frame compressed using I-frame
• B-frames between I-frame and first P-frame compressed
using I-frame and first P-frame
• Second P-frame compressed using first P-frame
• B-frames between first P-frame and second P-frame
compressed using first P-frame and second P-frame
• And so on...
41
Fundamentals of Multimedia, Chapter 10
• The usage of the particular frame type defines the quality and the
compression ratio of the compressed video.
• I-frames increase the quality (and size), whereas the usage of B-
frames compresses better but also produces poorer quality.
• The distance between two I-frames can be seen as a measure for the
quality of an MPEG-video.
• No defined limit to the number of consecutive B frames that may be
used in a group of pictures,
• Optimal number is application dependent.
• Most broadcast quality applications however, have tended to use 2
consecutive B frames (I,B,B,P,B,B,P,) as the ideal trade-off between
compression efficiency and video quality.
43
Fundamentals of Multimedia, Chapter 10