SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Video compression design, analysis, consulting and research




White Paper:
An Overview of H.264 Advanced Video Coding




Iain Richardson

2007
Vcodex White Paper: An overview of H.264
http://www.vcodex.com - H.264 and video coding expertise and consulting.


                              1   What is H.264 ?

H.264 is an industry standard for video compression, the process of converting digital
video into a format that takes up less capacity when it is stored or transmitted. Video
compression (or video coding) is an essential technology for applications such as digital
television, DVD-Video, mobile TV, videoconferencing and internet video streaming.
Standardising video compression makes it possible for products from different
manufacturers (e.g. encoders, decoders and storage media) to inter-operate. An
encoder converts video into a compressed format and a decoder converts
compressed video back into an uncompressed format.

Recommendation H.264: Advanced Video Coding is a document published by the
international standards bodies ITU-T (International Telecommunication Union) and
ISO/IEC (International Organisation for Standardisation / International Electrotechnical
Commission). It defines a format (syntax) for compressed video and a method for
decoding this syntax to produce a displayable video sequence. The standard document
does not actually specify how to encode (compress) digital video – this is left to the
manufacturer of a video encoder – but in practice the encoder is likely to mirror the
steps of the decoding process. Figure 1 shows the encoding and decoding processes
and highlights the parts that are covered by the H.264 standard.

The H.264/AVC standard was first published in 2003. It builds on the concepts of
earlier standards such as MPEG-2 and MPEG-4 Visual and offers the potential for better
compression efficiency (i.e. better-quality compressed video) and greater flexibility in
compressing, transmitting and storing video.




                Figure 1 The H.264 video coding and decoding process




© Iain Richardson/Vcodex Ltd 2007                                              Page 2 of 7
Vcodex White Paper: An overview of H.264
http://www.vcodex.com - H.264 and video coding expertise and consulting.

2     How does an H.264 codec work ?

An H.264 video encoder carries out prediction, transform and encoding processes (see
Figure 1) to produce a compressed H.264 bitstream. An H.264 video decoder carries
out the complementary processes of decoding, inverse transform and reconstruction to
produce a decoded video sequence.


2.1    Encoder processes

Prediction

The encoder processes a frame of video in units of a Macroblock (16x16 displayed
pixels). It forms a prediction of the macroblock based on previously-coded data,
either from the current frame (intra prediction) or from other frames that have
already been coded and transmitted (inter prediction). The encoder subtracts the
prediction from the current macroblock to form a residual 1.

The prediction methods supported by H.264 are
more flexible than those in previous standards,
enabling accurate predictions and hence efficient
video compression. Intra prediction uses 16x16 and
4x4 block sizes to predict the macroblock from
surrounding, previously-coded pixels within the same
frame (Figure 2).

Inter prediction uses a range of block sizes (from
16x16 down to 4x4) to predict pixels in the current
frame from similar regions in previously-coded                   Figure 2 Intra prediction
frames (Figure 3 ).




                                  Figure 3 Inter prediction


Transform and quantization


1
  Finding a suitable inter prediction is often described as motion estimation. Subtracting an
inter prediction from the current macroblock is motion compensation.


© Iain Richardson/Vcodex Ltd 2007                                                   Page 3 of 7
Vcodex White Paper: An overview of H.264
http://www.vcodex.com - H.264 and video coding expertise and consulting.


A block of residual samples is transformed using a 4x4 or 8x8 integer transform, an
approximate form of the Discrete Cosine Transform (DCT). The transform outputs a
set of coefficients, each of which is a weighting value for a standard basis pattern.
When combined, the weighted basis patterns re-create the block of residual samples.
Figure 4 shows how the inverse DCT creates an image block by weighting each basis
pattern according to a coefficient value and combining the weighted basis patterns.

The output of the transform, a block of transform coefficients, is quantized, i.e. each
coefficient is divided by an integer value. Quantization reduces the precision of the
transform coefficients according to a quantization parameter (QP). Typically, the result
is a block in which most or all of the coefficients are zero, with a few non-zero
coefficients. Setting QP to a high value means that more coefficients are set to zero,
resulting in high compression at the expense of poor decoded image quality. Setting
QP to a low value means that more non-zero coefficients remain after quantization,
resulting in better decoded image quality but lower compression.




  Figure 4 Inverse transform: combining weighted basis patterns to create a 4x4 image block




Bitstream encoding

The video coding process produces a number of values that must be encoded to form
the compressed bitstream. These values include:
    • quantized transform coefficients
    • information to enable the decoder to re-create the prediction
    • information about the structure of the compressed data and the compression
       tools used during encoding



© Iain Richardson/Vcodex Ltd 2007                                                 Page 4 of 7
Vcodex White Paper: An overview of H.264
http://www.vcodex.com - H.264 and video coding expertise and consulting.

      •    information about the complete video sequence.

These values and parameters (syntax elements) are converted into binary codes
using variable length coding and/or arithmetic coding. Each of these encoding
methods produces an efficient, compact binary representation of the information. The
encoded bitstream can then be stored and/or transmitted.


2.2       Decoder processes

Bitstream decoding

A video decoder receives the compressed H.264 bitstream, decodes each of the syntax
elements and extracts the information described above (quantized transform
coefficients, prediction information, etc). This information is then used to reverse the
coding process and recreate a sequence of video images.

Rescaling and inverse transform

The quantized transform coefficients are re-scaled. Each coefficient is multiplied by
an integer value to restore its original scale2. An inverse transform combines the
standard basis patterns, weighted by the re-scaled coefficients, to re-create each block
of residual data. These blocks are combined together to form a residual macroblock.

Reconstruction

For each macroblock, the decoder forms an identical prediction to the one created by
the encoder. The decoder adds the prediction to the decoded residual to reconstruct
a decoded macroblock which can then be displayed as part of a video frame.


3     H.264 in practice

3.1       Performance
Perhaps the biggest advantage of H.264 over previous standards is its compression
performance. Compared with standards such as MPEG-2 and MPEG-4 Visual, H.264 can
deliver:
    • Better image quality at the same compressed bitrate, or
    • A lower compressed bitrate for the same image quality.

For example, a single-layer DVD can store a movie of around 2 hours’ length in MPEG-
2 format. Using H.264, it should be possible to store 4 hours or more of movie-quality
video on the same disk (i.e. lower bitrate for the same quality). Alternatively, the
H.264 compression format can deliver better quality at the same bitrate compared with
MPEG-2 and MPEG-4 Visual (Figure 5 ).




2
  This is often described as inverse quantization but it is important to note that quantization
is not a fully-reversible process. Information removed during quantization cannot be restored
during re-scaling.


© Iain Richardson/Vcodex Ltd 2007                                                    Page 5 of 7
Vcodex White Paper: An overview of H.264
http://www.vcodex.com - H.264 and video coding expertise and consulting.

The improved compression performance of H.264 comes at the price of greater
computational cost. H.264 is more sophisticated than earlier compression methods and
this means that it can take significantly more processing power to compress and
decompress H.264 video.




      Figure 5 A video frame compressed at the same bitrate using MPEG-2 (left), MPEG-4 Visual
                               (centre) and H.264 compression (right)




3.2     Applications
As well as its improved compression performance, H.264 offers greater flexibility in
terms of compression options and transmission support. An H.264 encoder can select
from a wide variety of compression tools, making it suitable for applications ranging
from low-bitrate, low-delay mobile transmission through high definition consumer TV
to professional television production. The standard provides integrated support for
transmission or storage, including a packetised compressed format and features that
help to minimise the effect of transmission errors.

H.264/AVC is being adopted for an increasing range of applications, including:
    • High Definition DVDs (HD-DVD and Blu-Ray formats)
    • High Definition TV broadcasting in Europe
    • Apple products including iTunes video downloads, iPod video and MacOS
    • NATO and US DoD video applications
    • Mobile TV broadcasting
    • Internet video
    • Videoconferencing




© Iain Richardson/Vcodex Ltd 2007                                                   Page 6 of 7
Vcodex White Paper: An overview of H.264
http://www.vcodex.com - H.264 and video coding expertise and consulting.

Further reading

See http://www.vcodex.com/links.html for links to further resources on H.264 and
video compression.


About the author

As a researcher, consultant and author working in the field of video compression
(video coding), my books on video codec design and the MPEG-4 and H.264 standards
are widely read by engineers, academics and managers. I advise companies on video
coding standards, design and intellectual property and lead the Centre for Video
Communications Research at The Robert Gordon University in Aberdeen, UK.


Iain Richardson
iain@vcodex.com
Telephone 020 7193 6500 (UK)




© Iain Richardson/Vcodex Ltd 2007                                          Page 7 of 7

Weitere ähnliche Inhalte

Andere mochten auch

High Efficiency Video Coding
High Efficiency Video CodingHigh Efficiency Video Coding
High Efficiency Video CodingNayan Seth
 
Imagine camp, Developing Image Processing app for windows phone platform
Imagine camp, Developing Image Processing app for windows phone platformImagine camp, Developing Image Processing app for windows phone platform
Imagine camp, Developing Image Processing app for windows phone platformRahat Yasir
 
Error Resiliency and Concealment in H.264 MPEG-4 Part 10
Error Resiliency and Concealment in H.264 MPEG-4 Part 10Error Resiliency and Concealment in H.264 MPEG-4 Part 10
Error Resiliency and Concealment in H.264 MPEG-4 Part 10coldfire7
 
Cac chuan nen ITU
Cac chuan nen ITUCac chuan nen ITU
Cac chuan nen ITUTrung Vi
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data CompressionPratik Pradhan
 
Images compression using huffman algorithm matlab
Images compression using huffman algorithm matlabImages compression using huffman algorithm matlab
Images compression using huffman algorithm matlabTan Hoang Luu
 
Streaming Media Server Setup Manual
Streaming Media Server Setup ManualStreaming Media Server Setup Manual
Streaming Media Server Setup ManualWilliam Lee
 
Basics of Mpeg 4 3D Graphics Compression
Basics of Mpeg 4 3D Graphics CompressionBasics of Mpeg 4 3D Graphics Compression
Basics of Mpeg 4 3D Graphics CompressionMarius Preda PhD
 
H264 video compression explained
H264 video compression explainedH264 video compression explained
H264 video compression explainedcnssources
 
HEVC / H265 Hands-On course
HEVC / H265 Hands-On courseHEVC / H265 Hands-On course
HEVC / H265 Hands-On courseYoss Cohen
 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standardanuragjagetiya
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniquesDeep Bhatt
 

Andere mochten auch (20)

High Efficiency Video Coding
High Efficiency Video CodingHigh Efficiency Video Coding
High Efficiency Video Coding
 
Imagine camp, Developing Image Processing app for windows phone platform
Imagine camp, Developing Image Processing app for windows phone platformImagine camp, Developing Image Processing app for windows phone platform
Imagine camp, Developing Image Processing app for windows phone platform
 
mpeg4
mpeg4mpeg4
mpeg4
 
Error Resiliency and Concealment in H.264 MPEG-4 Part 10
Error Resiliency and Concealment in H.264 MPEG-4 Part 10Error Resiliency and Concealment in H.264 MPEG-4 Part 10
Error Resiliency and Concealment in H.264 MPEG-4 Part 10
 
MMC MPEG4
MMC MPEG4MMC MPEG4
MMC MPEG4
 
Cac chuan nen ITU
Cac chuan nen ITUCac chuan nen ITU
Cac chuan nen ITU
 
MPEG 4 VIDEO
MPEG 4 VIDEOMPEG 4 VIDEO
MPEG 4 VIDEO
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
 
Images compression using huffman algorithm matlab
Images compression using huffman algorithm matlabImages compression using huffman algorithm matlab
Images compression using huffman algorithm matlab
 
Mga produktong gawa sa kahoy at tabla
Mga produktong gawa sa kahoy at tablaMga produktong gawa sa kahoy at tabla
Mga produktong gawa sa kahoy at tabla
 
Analog Video
Analog Video Analog Video
Analog Video
 
Streaming Media Server Setup Manual
Streaming Media Server Setup ManualStreaming Media Server Setup Manual
Streaming Media Server Setup Manual
 
Basics of Mpeg 4 3D Graphics Compression
Basics of Mpeg 4 3D Graphics CompressionBasics of Mpeg 4 3D Graphics Compression
Basics of Mpeg 4 3D Graphics Compression
 
H264 video compression explained
H264 video compression explainedH264 video compression explained
H264 video compression explained
 
RTP
RTPRTP
RTP
 
MPEG 4
MPEG 4MPEG 4
MPEG 4
 
HEVC / H265 Hands-On course
HEVC / H265 Hands-On courseHEVC / H265 Hands-On course
HEVC / H265 Hands-On course
 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standard
 
Chương iii
Chương iiiChương iii
Chương iii
 
Data compression techniques
Data compression techniquesData compression techniques
Data compression techniques
 

Mehr von Iain Richardson

Compressed Video Quality
Compressed Video QualityCompressed Video Quality
Compressed Video QualityIain Richardson
 
A short history of video coding
A short history of video codingA short history of video coding
A short history of video codingIain Richardson
 
Iain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson
 
The H.264 Integer Transform
The H.264 Integer TransformThe H.264 Integer Transform
The H.264 Integer TransformIain Richardson
 
Configurable Video Coding
Configurable Video CodingConfigurable Video Coding
Configurable Video CodingIain Richardson
 
Getting the most out of H.264
Getting the most out of H.264Getting the most out of H.264
Getting the most out of H.264Iain Richardson
 
Book Launch: The H.264 Advanced Video Compression Standard
Book Launch: The H.264 Advanced Video Compression StandardBook Launch: The H.264 Advanced Video Compression Standard
Book Launch: The H.264 Advanced Video Compression StandardIain Richardson
 

Mehr von Iain Richardson (7)

Compressed Video Quality
Compressed Video QualityCompressed Video Quality
Compressed Video Quality
 
A short history of video coding
A short history of video codingA short history of video coding
A short history of video coding
 
Iain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video Compression
 
The H.264 Integer Transform
The H.264 Integer TransformThe H.264 Integer Transform
The H.264 Integer Transform
 
Configurable Video Coding
Configurable Video CodingConfigurable Video Coding
Configurable Video Coding
 
Getting the most out of H.264
Getting the most out of H.264Getting the most out of H.264
Getting the most out of H.264
 
Book Launch: The H.264 Advanced Video Compression Standard
Book Launch: The H.264 Advanced Video Compression StandardBook Launch: The H.264 Advanced Video Compression Standard
Book Launch: The H.264 Advanced Video Compression Standard
 

Kürzlich hochgeladen

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Kürzlich hochgeladen (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

H.264 video compression: an overview

  • 1. Video compression design, analysis, consulting and research White Paper: An Overview of H.264 Advanced Video Coding Iain Richardson 2007
  • 2. Vcodex White Paper: An overview of H.264 http://www.vcodex.com - H.264 and video coding expertise and consulting. 1 What is H.264 ? H.264 is an industry standard for video compression, the process of converting digital video into a format that takes up less capacity when it is stored or transmitted. Video compression (or video coding) is an essential technology for applications such as digital television, DVD-Video, mobile TV, videoconferencing and internet video streaming. Standardising video compression makes it possible for products from different manufacturers (e.g. encoders, decoders and storage media) to inter-operate. An encoder converts video into a compressed format and a decoder converts compressed video back into an uncompressed format. Recommendation H.264: Advanced Video Coding is a document published by the international standards bodies ITU-T (International Telecommunication Union) and ISO/IEC (International Organisation for Standardisation / International Electrotechnical Commission). It defines a format (syntax) for compressed video and a method for decoding this syntax to produce a displayable video sequence. The standard document does not actually specify how to encode (compress) digital video – this is left to the manufacturer of a video encoder – but in practice the encoder is likely to mirror the steps of the decoding process. Figure 1 shows the encoding and decoding processes and highlights the parts that are covered by the H.264 standard. The H.264/AVC standard was first published in 2003. It builds on the concepts of earlier standards such as MPEG-2 and MPEG-4 Visual and offers the potential for better compression efficiency (i.e. better-quality compressed video) and greater flexibility in compressing, transmitting and storing video. Figure 1 The H.264 video coding and decoding process © Iain Richardson/Vcodex Ltd 2007 Page 2 of 7
  • 3. Vcodex White Paper: An overview of H.264 http://www.vcodex.com - H.264 and video coding expertise and consulting. 2 How does an H.264 codec work ? An H.264 video encoder carries out prediction, transform and encoding processes (see Figure 1) to produce a compressed H.264 bitstream. An H.264 video decoder carries out the complementary processes of decoding, inverse transform and reconstruction to produce a decoded video sequence. 2.1 Encoder processes Prediction The encoder processes a frame of video in units of a Macroblock (16x16 displayed pixels). It forms a prediction of the macroblock based on previously-coded data, either from the current frame (intra prediction) or from other frames that have already been coded and transmitted (inter prediction). The encoder subtracts the prediction from the current macroblock to form a residual 1. The prediction methods supported by H.264 are more flexible than those in previous standards, enabling accurate predictions and hence efficient video compression. Intra prediction uses 16x16 and 4x4 block sizes to predict the macroblock from surrounding, previously-coded pixels within the same frame (Figure 2). Inter prediction uses a range of block sizes (from 16x16 down to 4x4) to predict pixels in the current frame from similar regions in previously-coded Figure 2 Intra prediction frames (Figure 3 ). Figure 3 Inter prediction Transform and quantization 1 Finding a suitable inter prediction is often described as motion estimation. Subtracting an inter prediction from the current macroblock is motion compensation. © Iain Richardson/Vcodex Ltd 2007 Page 3 of 7
  • 4. Vcodex White Paper: An overview of H.264 http://www.vcodex.com - H.264 and video coding expertise and consulting. A block of residual samples is transformed using a 4x4 or 8x8 integer transform, an approximate form of the Discrete Cosine Transform (DCT). The transform outputs a set of coefficients, each of which is a weighting value for a standard basis pattern. When combined, the weighted basis patterns re-create the block of residual samples. Figure 4 shows how the inverse DCT creates an image block by weighting each basis pattern according to a coefficient value and combining the weighted basis patterns. The output of the transform, a block of transform coefficients, is quantized, i.e. each coefficient is divided by an integer value. Quantization reduces the precision of the transform coefficients according to a quantization parameter (QP). Typically, the result is a block in which most or all of the coefficients are zero, with a few non-zero coefficients. Setting QP to a high value means that more coefficients are set to zero, resulting in high compression at the expense of poor decoded image quality. Setting QP to a low value means that more non-zero coefficients remain after quantization, resulting in better decoded image quality but lower compression. Figure 4 Inverse transform: combining weighted basis patterns to create a 4x4 image block Bitstream encoding The video coding process produces a number of values that must be encoded to form the compressed bitstream. These values include: • quantized transform coefficients • information to enable the decoder to re-create the prediction • information about the structure of the compressed data and the compression tools used during encoding © Iain Richardson/Vcodex Ltd 2007 Page 4 of 7
  • 5. Vcodex White Paper: An overview of H.264 http://www.vcodex.com - H.264 and video coding expertise and consulting. • information about the complete video sequence. These values and parameters (syntax elements) are converted into binary codes using variable length coding and/or arithmetic coding. Each of these encoding methods produces an efficient, compact binary representation of the information. The encoded bitstream can then be stored and/or transmitted. 2.2 Decoder processes Bitstream decoding A video decoder receives the compressed H.264 bitstream, decodes each of the syntax elements and extracts the information described above (quantized transform coefficients, prediction information, etc). This information is then used to reverse the coding process and recreate a sequence of video images. Rescaling and inverse transform The quantized transform coefficients are re-scaled. Each coefficient is multiplied by an integer value to restore its original scale2. An inverse transform combines the standard basis patterns, weighted by the re-scaled coefficients, to re-create each block of residual data. These blocks are combined together to form a residual macroblock. Reconstruction For each macroblock, the decoder forms an identical prediction to the one created by the encoder. The decoder adds the prediction to the decoded residual to reconstruct a decoded macroblock which can then be displayed as part of a video frame. 3 H.264 in practice 3.1 Performance Perhaps the biggest advantage of H.264 over previous standards is its compression performance. Compared with standards such as MPEG-2 and MPEG-4 Visual, H.264 can deliver: • Better image quality at the same compressed bitrate, or • A lower compressed bitrate for the same image quality. For example, a single-layer DVD can store a movie of around 2 hours’ length in MPEG- 2 format. Using H.264, it should be possible to store 4 hours or more of movie-quality video on the same disk (i.e. lower bitrate for the same quality). Alternatively, the H.264 compression format can deliver better quality at the same bitrate compared with MPEG-2 and MPEG-4 Visual (Figure 5 ). 2 This is often described as inverse quantization but it is important to note that quantization is not a fully-reversible process. Information removed during quantization cannot be restored during re-scaling. © Iain Richardson/Vcodex Ltd 2007 Page 5 of 7
  • 6. Vcodex White Paper: An overview of H.264 http://www.vcodex.com - H.264 and video coding expertise and consulting. The improved compression performance of H.264 comes at the price of greater computational cost. H.264 is more sophisticated than earlier compression methods and this means that it can take significantly more processing power to compress and decompress H.264 video. Figure 5 A video frame compressed at the same bitrate using MPEG-2 (left), MPEG-4 Visual (centre) and H.264 compression (right) 3.2 Applications As well as its improved compression performance, H.264 offers greater flexibility in terms of compression options and transmission support. An H.264 encoder can select from a wide variety of compression tools, making it suitable for applications ranging from low-bitrate, low-delay mobile transmission through high definition consumer TV to professional television production. The standard provides integrated support for transmission or storage, including a packetised compressed format and features that help to minimise the effect of transmission errors. H.264/AVC is being adopted for an increasing range of applications, including: • High Definition DVDs (HD-DVD and Blu-Ray formats) • High Definition TV broadcasting in Europe • Apple products including iTunes video downloads, iPod video and MacOS • NATO and US DoD video applications • Mobile TV broadcasting • Internet video • Videoconferencing © Iain Richardson/Vcodex Ltd 2007 Page 6 of 7
  • 7. Vcodex White Paper: An overview of H.264 http://www.vcodex.com - H.264 and video coding expertise and consulting. Further reading See http://www.vcodex.com/links.html for links to further resources on H.264 and video compression. About the author As a researcher, consultant and author working in the field of video compression (video coding), my books on video codec design and the MPEG-4 and H.264 standards are widely read by engineers, academics and managers. I advise companies on video coding standards, design and intellectual property and lead the Centre for Video Communications Research at The Robert Gordon University in Aberdeen, UK. Iain Richardson iain@vcodex.com Telephone 020 7193 6500 (UK) © Iain Richardson/Vcodex Ltd 2007 Page 7 of 7