Disktech
The Name Behind the
Names in Digital Media

MPEG2 Video Encoding

MPEG2 Video Encoder

DVD is able to store full length feature movies of CCIR601 resolution video information with a digital multi-channel soundtrack. In addition, up to 32 subtitle channels can be included. This is made possible by the use of highly efficient MPEG-2 video encoding.

Bit Rates

Encoding video with a fixed bit rate means that either the picture is visibly degraded during rapidly changing scenes (bit rate too low) or is inefficient of storage during scenes with little action (bit rate too high). The variable bit rate encoder maintains the bit rate at an optimum value to satisfy all picture complexities, which results in consistent picture quality and high encoding efficiency.

Profiles and levels

MPEG specifies the syntax and semantics of a compressed video bit-stream. Not all features of MPEG-2 standard are used for all applications. A toolkit approach is taken by defining :

  • different subsets called profiles which are scaleable or non-scaleable
  • different levels which are ranges of values for parameters such as bit rates, picture sizes and resolutions.

MPEG2 VIDEO

Video Encoder Block Diagram

Encoding

For video compression, only the difference between successive pictures needs to be encoded. The means by which the video images are compressed is by only encoding the information in a picture which changes from other pictures. This provides a very efficient means by which to store video data. MPEG2 defines three picture types:

  • I (Intraframe) Picture is encoded without reference to another picture. This allows for random access.
  • P (Predictive) Picture is encoded using motion compensation on the previous picture and may itself be used in subsequent predictions.
  • B (Bi-directional) Picture is encoded using motion compensation on the previous and next pictures, which must be an I or P picture. B pictures are not used in predictions.

P and B pictures cannot be accessed randomly as they cannot be constructed without reference to one or more pictures.

An I picture plus the subsequent number of B and P pictures before the next I picture defines the Group of Pictures (GOP). The size of a group of pictures can be set to 8, 12 or 16 to optimize encoding to suit different movies and display formats.

Group of Pictures

Motion Compensated Prediction

Motion compensated prediction converts the picture to be encoded into subsections called macro-blocks. For each macro-block a search is made for the closest match in the search area of the previous picture. When a match is found the offset between the two macro-blocks is determined. This offset is known as the motion vector which is transmitted in the encoded bit-stream for use in reconstructing the picture.

Frames and fields

The MPEG2 standard supports interlaced video. A frame of interlaced video consists of two fields which are samples of the full vertical image separated by the time of the field period. The encoder decides whether the a picture is encoded as a field or frame. For slow moving pictures, it is efficient to combine the fields into a single frame and encode the frame. For fast moving pictures it is more efficient to encode each field separately. MPEG2 allows for switching between field and frame encoding on a macro-block by macro-block basis.

Philips Variable Bit Rate Encoding System

Pictures are treated in the following sequence :

  • I-B-P-B-P-B-P-B-P...I

and the GOP size is determined by the user (8, 12 or 16)

Compression is achieved by :

  • only encoding the parts of the picture which contain motion
  • removing frequencies which would not be discernable by the human eye
  • using run length encoding so that regularly occurring patterns are replaced by shorter representative bit-streams

Process Description

The process of encoding MPEG2 video information for DVD involves two passes of the digital video tape at normal play speed. The first is an analysis pass, the second an encoding pass.

Pass 1: The complexity of the video image is analysed using an optimum Quantisation factor (Q) value calculated by the encoder software. The fixed Q factor used gives a corresponding fixed picture quality which provides a reliable indication of complexity. The encoder sends the number of bits allocated to each picture to hard disk via the PC during this pass. After the first pass, a graphical report of the analysis file is generated. From this report, fine tuning of the encoding parameters can be made to tailor the encoding process to suit individual movies. For example, forced I pictures can be inserted in particularly complex video sections to ensure high video quality. Or if the file obtained is not optimum size, the analysis pass can be repeated using a different Q value. In this way, the best possible video results are achieved.

Pass 2: Encoding takes place in the second pass. The bit rate for each GOP is determined taking into account the following factors: 

  • duration of the recording
  • file size
  • minimum and maximum bit rates
  • complexity of each picture as determined in the
  • analysis pass

The encoded video bit-stream output can include high density bursts of data which are handled by an on-board RAM buffer. The buffered output is then written to video storage as compressed data.  Prior to the analysis pass, the following parameters must be set before any analysis/encoding can be performed:

  • SMPTE start and end times
  • minimum, maximum and average bit rates
  • MPEG file size
  • GOP size (8, 12 or 16)
  • P distance (1 or 2)
  • Horizontal resolution (352, 528, 720)
  • Aspect ratio (4:3 or 16:9)
  • Intra DC precision (8, 9 or 10 bits)
  • Film detection (automatic inverse, 3:2 pull down)

The encoded bit-stream output is written from the encoder to storage under the control of a high-speed computer. The bit-stream can include high density bursts of data which are handled by an on board RAM buffer in the data grabber & storage device.

Principal Hardware Units

Principal Hardware Units

A primer on MPEG-2 compression & DVD Basics

with thanks to Philips Industries

dvd-r.gif (7673 bytes) dvlogo.gif (2506 bytes) mpglogo.gif (2126 bytes)
What Is DVD?? MPEG-1 / MPEG-2 VIDEO ENCODING MPEG AUDIO ENCODING
Call us on 02 6227 5751 or Email now for a no-obligation free quotation for any of our services.

 Site Design by Kevin Read dot Com

 © 2004. Disktech Digital Pty Ltd