getting the most out of h.264
DESCRIPTION
Getting the best performance from a video codec is a real challenge. Learn strategies for optimizing compression, video quality and computational performance.TRANSCRIPT
Getting the most out of H.26417th November 2010
Iain Richardson
H.264 : what’s essential and what’s optional?
slices
macroblocks
frames or fields
I slice
P slice
B slice
I MB
I P Skip
I P SkipB
Intra prediction choices
Inter prediction choices
Quantization Parameter
Transform + quantization choices
Quantized coefficientsMotion vectorsMacroblock headers…..
Coded bitstream
Exp-Golomb / CAVLC
encoder
CABACencoder
Entropy coding choices
What are the trade-offs?
Quality (or Distortion)
Rate
Computation
Example: Group of Pictures structure
Encoder choices are based on:
Decoder capabilities
Video content
Computingresources
Profile + Level
Current +previousstatistics
Time toencode
What’s important?
Bitrate Quality
Delay Real-timeor offline
Flexibility
H.264 mode decisions
MB header and vectors
Coded residual
Coded macroblock
I slice
P slice
B slice
Making the best decisions
Cost of coding
Quality (or distortion)
Bitrate
Computation
Bitrate
PSNR
Rate-Distortion Curve for a video clip
BETTER
WORSE
Rate
PSNR
R-D points for one MB
Each MB mode has a D “cost” and an R “cost”
Calculate a combined cost J:
J = D + λRR
D
Choose the mode with the smallest value of J
Rate
PSNR
λ1 λ2
For every macroblock:1. Try out every coding mode, measure D and R2. Choose mode with minimum J = D + λR
Rate Distortion Optimised (RDO) Mode Selection
Rate cost Distortion cost
Headers Residual
Skip MB
Intra MB
P MB
B MB
Distortion
J
Bitrate
PSNR
Few modes, no RDO
Multiple modes, no RDO
Multiple modes, with RDO
Computational overload?
Practical strategy 1: Reduce the number of modes
Practical strategy 2: Approximate cost measures
•Sub-sample number of search points
•Use a less sophisticated comparison metric
•Etc.
What’s next?
HD content everywhere& not enough bandwidth?
Computation increasing on every platform
More computation
More coding options
High Efficiency Video Coding
Flexible Coding
Summary