ENEE631 Digital Image Processing (Spring'04) Basic Video Coding and MPEG Spring ’04 Instructor: Min Wu ECE Department, Univ. of Maryland, College Park.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
ENEE631 Digital Image Processing (Spring'04)
Basic Video Coding and MPEGBasic Video Coding and MPEG
ENEE631 Digital Image Processing (Spring'04) Lec18 – Video Coding (1) [9]
Complexity of Exhaustive Block-MatchingComplexity of Exhaustive Block-Matching
Assumptions– Block size NxN and image size S=M1xM2– Search step size is 1 pixel ~ “integer-pel accuracy”– Search range +/–R pixels both horizontally and vertically
Computation complexity– # Candidate matching blocks = (2R+1)2 – # Operations for computing MAD for one block ~ O(N2)– # Operations for MV estimation per block ~ O((2R+1)2 N2)– # Blocks = S / N2 – Total # operations for entire frame ~ O((2R+1)2 S)
i.e., overall computation load is independent of block size!
E.g., M=512, N=16, R=16, 30fps => On the order of 8.55 x 109 operations per second!– Was difficult for real time estimation, but possible with parallel hardware
ENEE631 Digital Image Processing (Spring'04) Lec18 – Video Coding (1) [14]
Lowest resolution
Lower resolution
Original resolution
Hierarchical Block MatchingHierarchical Block Matching Problem with fast search at full resolution
– Small mis-alignment may give high displacement error (EDFD) esp. for texture and edge blocks
Hierarchical (multi-resolution) block matching– Match with coarse resolution to narrow down search range– Match with high resolution to refine motion estimation
ENEE631 Digital Image Processing (Spring'04) Lec18 – Video Coding (1) [16]
DCT-M.E. Hybrid Video CodingDCT-M.E. Hybrid Video Coding “Hybrid” ~ combined transform coding & predictive coding Spatial redundancy removal
– Use DCT-based transform coding for reference frame Temporal redundancy removal
– Use motion-based predictive coding for next frames estimate motion and use reference frame to predict only encode MV & prediction residue (“motion compensation residue”)
– Color components are actually downsampled– 30 fps may refer to field rate in MPEG-2 ~ equiv. to 15 fps– ( 8 x 720 x 480 + 16 x 720 x 480 / 4 ) x 15 fps = 62 Mbps
ENEE631 Digital Image Processing (Spring'04) Lec18 – Video Coding (1) [31]
““Adaptive” Predictive Coding in MPEG-1Adaptive” Predictive Coding in MPEG-1 Half-pel M.V. search within +/-64 pel range
– Use spatial differential coding on M.V. to remove M.V. spatial redundancy
Coding each block in P-frame– Predictive block using previous I/P frame as reference– Intra-block ~ encode without prediction
use this if prediction costs more bits than non-prediction good for occluded area can also avoid error propagation
Coding each block in B-frame– Intra-block ~ encode without prediction– Predictive block
Use previous I/P frame as reference (forward prediction), Or use future I/P frame as reference (backward prediction), Or use both for prediction and take average
(Fig. from Ken Lam – HK Poly Univ. short course in summer’2001)
ENEE631 Digital Image Processing (Spring'04) Lec18 – Video Coding (1) [33]
Quantization for I-frame (I-block) & M.C. Residues Quantization for I-frame (I-block) & M.C. Residues
Quantizer for I-frame (I-block) – Different step size for different freq. band (similar to JPEG)– Default quantization table– Scale the table for different compression-quality
Quantizer for residues in predictive block– Noise-like residue – Similar variance in different freq. band– Assign same quantization step size for each freq. band
ENEE631 Digital Image Processing (Spring'04) Lec18 – Video Coding (1) [34]
Adjusting QuantizerAdjusting Quantizer
For smoothing out bit rate– Some applications prefer approx. constant bit rate video stream (CBR)
e.g., prescribe # bits per second very-short-term bit-rate variations can be smoothed by a buffer variations can’t be too large on longer term ~ o.w. buffer overflow
– Need to assign large step size for complex and high-motion frames
For reducing bit rate by exploiting HVS temporal properties– Noise/distortion in a video frame would not be very much visible when there
is a sharp temporal transition (scene change) can compress a few frames right after scene change with less bits
Alternative bit-rate adjustment tool ~ frame type– I I I I I I … lowest compression ratio (like motion-JPEG)– I P P … P I P P … moderate compression ratio– I B B P B B P B B I … highest compression ratio