MPEG
- Encoding and (lossy) compression for video streams
- Up to 50-1 compression
- (generally) off-line encoding, real-time decoding
- Variable-bit rate encoding
- Encoding for YUV video
MPEG: Frame Types
- Intrapicture (I) frames contain an entire image
- Predicted (P) frames can be decoded given the preceding I frame.
- Bidirectional predicted (B) frames need both the preceding and
the following I or P frame for decoding.
Similar to DPCM: take advantage of substantial similarity between
successive frames to reduce the amount of data sent.
Ratio of I (largest) to P and B (smallest) frames can be varied to
achieve better compression.
MPEG: I-Frame Encoding
- Divide into 16x16 macroblocks (JPEG: 8x8 blocks).
- Downsample U and V (chrominance) into 8x8 block
- Result is 256=16x16 Y (luminance) values and 64 each U and V
values.
- Discrete Cosine Transform (same as JPEG)
- Quantization (same as JPEG)
Chrominance can be transmitted less accurately without visibly
disturbing the image.
MPEG: P-Frame Encoding
- Only send macroblocks that differ from I-Frame.
- Each P-Frame macroblock has a "motion offset" to
the corresponding I-Frame macroblock.
- Each pixel in a P-Frame macroblock is encoded as a delta from
the corresponding I-Frame pixel.
- Discrete Cosine Transform (same as JPEG)
- Quantization (same as JPEG)
MPEG: B-Frame Encoding
- Only send macroblocks that differ from preceding or successive
(I or P) frame.
- Each B-Frame macroblock has a "motion offset" to
the preceding (I or P) frame.
- Each B-Frame macroblock has a "motion offset" to
the successive (I or P) frame.
- Each pixel in a B-Frame macroblock is encoded as a delta from
the average of the corresponding pixel in the preceding and successive
frames.
- Discrete Cosine Transform (same as JPEG)
- Quantization (same as JPEG)
MPEG: Encoding
- compression rate of up to 180:1
- different heuristics for motion estimation yield
different compression ratios for different scenes
- MPEG encoding in software on current computers cannot be done in
real-time (decoding can).
- At least one manufacturer produces MPEG Encoding hardware that can do
encoding in "real time"
- delay of a few frames
since the B frames cannot be decoded until the successive P or I
frames have been received.
MPEG: Bandwidth
- uncompressed video produces data at a constant and very
predictable rate
- MPEG compression introduces variability and
unpredictability.
- MPEG-1 is faster (lower bitrate, lower quality)
- MPEG-2 provides higher quality
Multimedia issues
- video stream must be synchronized with audio stream
- for interactive telephony, maximum audio delay approx 100ms
- for playback, maximum jitter determines amount of buffering required