getting the most out of h.264

41
Getting the most out of H.264 17 th November 2010 Iain Richardson

Upload: iain-richardson

Post on 30-Apr-2015

3.544 views

Category:

Technology


2 download

DESCRIPTION

Getting the best performance from a video codec is a real challenge. Learn strategies for optimizing compression, video quality and computational performance.

TRANSCRIPT

Page 1: Getting the most out of H.264

Getting the most out of H.26417th November 2010

Iain Richardson

Page 2: Getting the most out of H.264

H.264 : what’s essential and what’s optional?

Page 3: Getting the most out of H.264
Page 4: Getting the most out of H.264

slices

macroblocks

frames or fields

Page 5: Getting the most out of H.264
Page 6: Getting the most out of H.264

I slice

P slice

B slice

I MB

I P Skip

I P SkipB

Page 7: Getting the most out of H.264

Intra prediction choices

Page 8: Getting the most out of H.264

Inter prediction choices

Page 9: Getting the most out of H.264
Page 10: Getting the most out of H.264

Quantization Parameter

Transform + quantization choices

Page 11: Getting the most out of H.264

Quantized coefficientsMotion vectorsMacroblock headers…..

Coded bitstream

Exp-Golomb / CAVLC

encoder

CABACencoder

Entropy coding choices

Page 12: Getting the most out of H.264

What are the trade-offs?

Page 13: Getting the most out of H.264

Quality (or Distortion)

Rate

Computation

Page 14: Getting the most out of H.264

Example: Group of Pictures structure

Page 15: Getting the most out of H.264

Encoder choices are based on:

Decoder capabilities

Video content

Computingresources

Profile + Level

Current +previousstatistics

Time toencode

Page 16: Getting the most out of H.264

What’s important?

Bitrate Quality

Delay Real-timeor offline

Flexibility

Page 17: Getting the most out of H.264

H.264 mode decisions

Page 18: Getting the most out of H.264
Page 19: Getting the most out of H.264

MB header and vectors

Coded residual

Coded macroblock

Page 20: Getting the most out of H.264

I slice

Page 21: Getting the most out of H.264

P slice

Page 22: Getting the most out of H.264

B slice

Page 23: Getting the most out of H.264

Making the best decisions

Page 24: Getting the most out of H.264

Cost of coding

Quality (or distortion)

Bitrate

Computation

Page 25: Getting the most out of H.264

Bitrate

PSNR

Rate-Distortion Curve for a video clip

BETTER

WORSE

Page 26: Getting the most out of H.264
Page 27: Getting the most out of H.264

Rate

PSNR

R-D points for one MB

Page 28: Getting the most out of H.264

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

Page 29: Getting the most out of H.264

Rate

PSNR

λ1 λ2

Page 30: Getting the most out of H.264

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

Page 31: Getting the most out of H.264

Rate cost Distortion cost

Headers Residual

Skip MB

Intra MB

P MB

B MB

Distortion

J

Page 32: Getting the most out of H.264

Bitrate

PSNR

Few modes, no RDO

Multiple modes, no RDO

Multiple modes, with RDO

Page 33: Getting the most out of H.264

Computational overload?

Page 34: Getting the most out of H.264

Practical strategy 1: Reduce the number of modes

Page 35: Getting the most out of H.264

Practical strategy 2: Approximate cost measures

•Sub-sample number of search points

•Use a less sophisticated comparison metric

•Etc.

Page 36: Getting the most out of H.264

What’s next?

Page 37: Getting the most out of H.264

HD content everywhere& not enough bandwidth?

Page 38: Getting the most out of H.264

Computation increasing on every platform

Page 39: Getting the most out of H.264

More computation

More coding options

High Efficiency Video Coding

Flexible Coding

Page 40: Getting the most out of H.264

Summary

Page 41: Getting the most out of H.264

Questions?

onecodec.com

www.dcktn.org.uk

vcodex.com

Email me: [email protected]

elecard.com