MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information".[1] It describes a combination of lossyvideo compression and lossy audio compression (audio data compression) methods which permit storage and transmission of movies using currently available storage media and transmission bandwidth.
A list of MPEG reference books can be found in [2]
MPEG-2 is widely used as the format of digital television signals that are broadcast by terrestrial (over-the-air), cable, and direct broadcast satelliteTV systems. It also specifies the format of movies and other programs that are distributed on DVD and similar disks. As such, TV stations, TV receivers, DVD players, and other equipment are often designed to this standard. MPEG-2 was the second of several standards developed by the Moving Pictures Expert Group (MPEG) and is an international standard (ISO/IEC 13818). Parts 1 and 2 of MPEG-2 were developed in a joint collaborative team with ITU-T, and they have a respective catalog number in the ITU-T Recommendation Series.
While MPEG-2 is the core of most digital television and DVD formats, it does not completely specify them. Regional institutions can adapt it to their needs by restricting and augmenting aspects of the standard. See Profiles and Levels.
MPEG-2 includes a Systems section, part 1, that defines two distinct, but related, container formats. One is the Transport Stream, designed to carry digital video and audio over possibly lossy media, such as broadcasting, examples of which include ATSC and DVB. MPEG-2 Systems also defines Program Stream, a container format designed for reasonably reliable media such as optical disks, DVDs and SVCDs. MPEG-2/System is formally known as ISO/IEC 13818-1 and as ITU-T Rec. H.222.0.[3]
The Video section, part 2 of MPEG-2, is similar to the previous MPEG-1 standard, but also provides support for interlaced video, the format used by analog broadcast TV systems. MPEG-2 video is not optimized for low bit-rates, especially less than 1 Mbit/s at standard definition resolutions. However, it outperforms MPEG-1 at 3 Mbit/s and above. All standards-compliant MPEG-2 Video decoders are fully capable of playing back MPEG-1 Video streams. MPEG-2/Video is formally known as ISO/IEC 13818-2 and as ITU-T Rec. H.262.[4]
With some enhancements, MPEG-2 Video and Systems are also used in some HDTV transmission systems.
The MPEG-2 Audio section, defined in part 3 of the standard, enhances MPEG-1's audio by allowing the coding of audio programs with more than two channels. This method is backwards-compatible, allowing MPEG-1 audio decoders to decode the two main stereo components of the presentation.
Part 7 of the MPEG-2 standard specifies a rather different, non-backwards-compatible audio format. Part 7 is referred to as MPEG-2 AAC. While AAC is more efficient than the previous MPEG audio standards, it is much more complex to implement and somewhat more powerful hardware is needed for encoding and decoding. Advanced Audio is also defined in Part 3 of the MPEG-4 standard.
History
MPEG2 evolved out of the shortcomings of MPEG1
MPEG 1's known weaknesses
a lower resolution, slightly sub-optimal for modern televisions
a less efficient audio compression system
lack of flexibility (fewer variations of acceptable packet types)
many access control issues (many MPEG1 encryption systems were broken)
An HDTV camera generates a raw video stream of up to 233,280,000 bytes per second. This stream must be compressed if digital TV is to fit in the bandwidth of available TV channels and if movies are to fit on DVDs. Fortunately, video compression is practical because the data in pictures is often redundant in space and time. For example, the sky can be blue across the top of a picture and that blue sky can persist for frame after frame. Also, because of the way the eye works, it is possible to delete some data from video pictures with almost no noticeable degradation in image quality.
TV cameras used in broadcasting usually generate 50 pictures a second (in Europe) or 59.94 pictures a second (in North America). Digital television requires that these pictures be digitized so that they can be processed by computer hardware. Each picture element (a pixel) is then represented by one luma number and two chrominance numbers. These describe the brightness and the color of the pixel (see YCbCr). Thus, each digitized picture is initially represented by three rectangular arrays of numbers.
A common (and old) trick to reduce the amount of data is to separate the picture into two fields: the "top field," which is the odd numbered rows, and the "bottom field," which is the even numbered rows. The two fields are displayed alternately. This is called interlaced video. Two successive fields are called a frame. The typical frame rate is then 25 or 29.97 frames per second. If the video is not interlaced, then it is called progressive video and each picture is a frame. MPEG-2 supports both options.
Another trick to reduce the data rate is to thin out the two chrominance matrices. In effect, the remaining chrominance values represent the nearby values that are deleted. Thinning works because the eye is more responsive to brightness than to color. The 4:2:2 chrominance format indicates that half the chrominance values have been deleted. The 4:2:0 chrominance format indicates that three quarters of the chrominance values have been deleted. If no chrominance values have been deleted, the chrominance format is 4:4:4. MPEG-2 allows all three options.
MPEG-2 specifies that the raw frames be compressed into three kinds of frames: intra-coded frames (I-Frame), predictive-coded frames (P-frames), and bidirectionally-predictive-coded frames (B-frames).
An I-Frame is a compressed version of a single uncompressed (raw) frame. It takes advantage of spatial redundancy and of the inability of the eye to detect certain changes in the image. Unlike P-frames and B-frames, I-frames do not depend on data in the preceding or the following frames. Briefly, the raw frame is divided into 8 pixel by 8 pixel blocks. The data in each block is transformed by a discrete cosine transform. The result is an 8 by 8 matrix of coefficients. The transform converts spatial variations into frequency variations, but it does not change the information in the block; the original block can be recreated exactly by applying the inverse cosine transform. The advantage of doing this is that the image can now be simplified by quantizing the coefficients. Many of the coefficients, usually the higher frequency components, will then be zero. The penalty of this step is the loss of some subtle distinctions in brightness and color. If one applies the inverse transform to the matrix after it is quantized, one gets an image that looks very similar to the original image but that is not quite as nuanced. Next, the quantized coefficient matrix is itself compressed. Typically, one corner of the quantized matrix is filled with zeros. By starting in the opposite corner of the matrix, then zigzagging through the matrix to combine the coefficients into a string, then substituting run-length codes for consecutive zeros in that string, and then applying Huffman coding to that result, one reduces the matrix to a smaller array of numbers. It is this array that is broadcast or that is put on DVDs. In the receiver or the player, the whole process is reversed, enabling the receiver to reconstruct, to a close approximation, the original frame.
Typically, every 15th frame or so is made into an I-frame. P-frames and B-frames might follow an I-frame like this, IBBPBBPBBPBB(I), to form a Group Of Pictures (GOP); however, the standard is flexible about this.
Macroblocks
P-frames provide more compression than I-frames because they take advantage of the data in the previous I-frame or P-frame. I-frames and P-frames are called reference frames. To generate a P-frame, the previous reference frame is reconstructed, just as it would be in a TV receiver or DVD player. The frame being compressed is divided into 16 pixel by 16 pixel macroblocks. Then, for each of those macroblocks, the reconstructed reference frame is searched to find that 16 by 16 macroblock that best matches the macroblock being compressed. The offset is encoded as a "motion vector." Frequently, the offset is zero. But, if something in the picture is moving, the offset might be something like 23 pixels to the right and 4 pixels up. The match between the two macroblocks will often not be perfect. To correct for this, the encoder computes the strings of coefficient values as described above for both macroblocks and, then, subtracts one from the other. This "residual" is appended to the motion vector and the result sent to the receiver or stored on the DVD for each macroblock being compressed. Sometimes no suitable match is found. Then, the macroblock is treated like an I-frame macroblock.
The processing of B-frames is similar to that of P-frames except that B-frames use the picture in the following reference frame as well as the picture in the preceding reference frame. As a result, B-frames usually provide more compression than P-frames. B-frames are never reference frames.
While the above generally describes MPEG-2 video compression, there are many details that are not discussed including details involving fields, chrominance formats, responses to scene changes, special codes that label the parts of the bitstream, and other pieces of information.
Audio encoding
MPEG-2 also introduces new audio encoding methods.
These are
MPEG-2 video supports wide range of applications from mobile to high quality HD editing. For many applications, it's unrealistic and too expensive to support the entire standard. To allow such applications to support only subsets of it, the standard defines profile and level.
The profile defines the subset of features such as compression algorithm, chroma format, etc. The level defines the subset of quantitative capabilities such as maximum bit rate, maximum frame size, etc.
A MPEG application then specifies the capabilities in terms of profile and level. For example, a DVD player may say it supports up to main profile and main level (often written as MP@ML). It means the player can play back any MPEG stream encoded as MP@ML or less.
The tables below summarizes the limitations of each profile and level. There are many other constraints not listed here.
MPEG-2 Profiles
Abbr.
Name
Picture Coding Types
Chroma Format
Aspect Ratios
Scalable modes
SP
Simple profile
I, P
4:2:0
square pixels, 4:3, or 16:9
none
MP
Main profile
I, P, B
4:2:0
square pixels, 4:3, or 16:9
none
SNR
SNR Scalable profile
I, P, B
4:2:0
square pixels, 4:3, or 16:9
SNR (signal-to-noise ratio) scalable
Spatial
Spatially Scalable profile
I, P, B
4:2:0
square pixels, 4:3, or 16:9
SNR- or spatial-scalable
HP
High profile
I, P, B
4:2:2 or 4:2:0
square pixels, 4:3, or 16:9
SNR- or spatial-scalable
Exempting scalability (a rarely used feature where one MPEG-2 stream augments another), the following are some of the constraints on levels:
MPEG-2 Levels
Abbr.
Name
Frame rates (Hz)
Max horizontal resolution
Max vertical resolution
Max luminance samples per second (approximately height x width x framerate)
Max bit rate in Main profile (Mbit/s)
LL
Low Level
23.976, 24, 25, 29.97, 30
352
288
3,041,280
4
ML
Main Level
23.976, 24, 25, 29.97, 30
720
576
10,368,000, except in High profile, where constraint is 14,475,600 for 4:2:0 and 11,059,200 for 4:2:2
15
H-14
High 1440
23.976, 24, 25, 29.97, 30, 50, 59.94, 60
1440
1152
47,001,600, except that in High profile with 4:2:0, constraint is 62,668,800
60
HL
High Level
23.976, 24, 25, 29.97, 30, 50, 59.94, 60
1920
1152
62,668,800, except that in High profile with 4:2:0, constraint is 83,558,400
80
Applications
DVD
The DVD standard uses MPEG-2 video, but imposes some restrictions:
(1.85:1 and 2.35:1, among others, are often listed as valid DVD aspect ratios, but are actually just a 16:9 image with the top and bottom of the frame masked in black)
Allowed Frame rates
29.97 frame/s (NTSC)
25 frame/s (PAL)
Note: By using a pattern of REPEAT_FIRST_FIELD flags on the headers of encoded pictures, pictures can be displayed for either two or three fields and almost any picture display rate (minimum ? of the frame rate) can be achieved. This is most often used to display 23.976 (approximately film rate) video on NTSC.
720, 640, 544, 480 or 352 × 480 pixel, 24/1.001, 24, 30/1.001 or 30 frame/s
352 × 240 pixel, 24/1.001, 24, 30/1.001 or 30 frame/s
720, 704, 544, 480 or 352 × 576 pixel, 25 frame/s
352 × 288 pixel, 25 frame/s
For HDTV:
720 x 576 x 50 frame/s progressive (576p50)
1280 x 720 x 25 or 50 frame/s progressive (720p50)
1440 or 1920 x 1080 x 25 frame/s progressive (1080p25 ? film mode)
1440 or 1920 x 1080 x 25 frame/s interlace (1080i25)
1920 x 1080 x 50 frame/s progressive (1080p50) possible future H.264/AVC format
ATSC and ISDB-T
The ATSC A/53 standard, used in the United States, uses MPEG-2 video at the Main Profile @ High Level, with additional restrictions:
The maximum bitrate of the MPEG-2 video stream is exactly 19.4 Mbit/s for broadcast television, and exactly 38.8 Mbit/s for the "high-data-rate" mode (e.g., cable television). (The practical limit is somewhat lower, since the MPEG-2 video stream must fit inside a transport stream, with overhead, sent out at 19.3927... Mbit/s for broadcast.)
The amount of MPEG-2 stream buffer required at the decoder (the vbv_buffer_size_value) must be less than or equal to 999,424 bytes.
In most cases, the transmitter can't start sending a coded image until within a half-second of when it's to be decoded (vbv_delay less than or equal to 45000 90-kHz clock increments).
The stream must include colorimetry information (gamma curve, the precise RGB colors used, and the relationship between RGB and the coded YCbCr).
The video must be 4:2:0 (chrominance resolution must be 1/2 of luma horizontal resolution and 1/2 of luma vertical resolution).
Allowed video resolutions, aspect ratios, and frame/field rates:
1920 × 1080 pixel (16:9, with square pixels), at 30p, 29.97p, 24p, 23.98p, 30i, or 29.97i
1280 × 720 pixel (16:9, with square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, or 23.98p
704 × 480 pixel (either 4:3 or 16:9 ? either way, with non-square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.98p, 30i, or 29.97i
640 × 480 pixel (4:3, with square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.98p, 30i, or 29.97i
Note that although the ATSC A/53 standard limits transmission to these 18 formats (and their 1000/1001-rate slowed-down versions), the U.S. Federal Communications Commission declined to mandate that television stations obey this part of the ATSC's standard. In theory, television stations in the U.S. are free to choose any resolution, aspect ratio, and frame/field rate, within the limits of Main Profile @ High Level. Many stations do go outside the bounds of the ATSC specification by using other resolutions ? for example, 720 × 480.
Also note that the ATSC specification and MPEG-2 allow the use of progressive frames, even within an interlaced video sequence. For example, NBC stations transmit a 1080i30 video sequence ? meaning the formal output of the MPEG-2 decoding process is sixty 540-line fields per second. But for prime-time television shows, those 60 fields can be coded with 24 progressive frames. Some NBC stations do this, meaning they actually transmit an 1080p24 video stream (a sequence of 24 progressive frames per second) with metadata instructing the decoder to interlace them (and repeat them in 3:2 pulldown) before display.
Thus, it would be incorrect to say that the ATSC standard doesn't contain 1080p video, or that broadcast HDTV doesn't use 1080p video. The ATSC specification allows 1080p30 and 1080p24 sequences ? just not 1080p60 sequences. They aren't used in practice, because broadcasters want to be able to switch between 60 Hz (news, soap operas) and 24 Hz (prime-time) content without ending the MPEG-2 sequence. However, the ATSC specification also allows broadcasters to transmit progressive frames within an interlaced sequence, and some broadcasters actually do this in practice. Their transmissions could fairly be described as 1080p24, since they contain 24 progressively-coded frames per second. (This is the same mechanism used by HD-DVD to code 1080p24 content ? progressive frames within an interlaced sequence.)
Note: The 1080-line formats are encoded with 1920 × 1088 pixel luma matrices and 960 × 540 chroma matrices, but the last 8 lines are discarded by the MPEG-2 decoding and display process.
MPEG-2 audio was a contender for the ATSC standard during the DTV "Grand
Alliance" shootout, but lost out to Dolby AC-3.
Note: All the text about Mpeg2 in ATSC is also valid for ISDB-T, except that in the main TS is aggregated a second program for mobile devices compressed in Mpeg-4 H.264 AVC for video and AAC-LC for audio, mainly known as 1Seg.
ISO/IEC 13818
Part 1
Systems ? describes synchronization and multiplexing of video and audio. Also known as ITU-T Rec. H.222.0.[3] See MPEG transport stream.
Part 2
Video ? compression codec for interlaced and non-interlaced video signals. Also known as ITU-T Rec. H.262.
Part 3
Audio ? compression codec for perceptual coding of audio signals. A multichannel-enabled extension of MPEG-1 audio.
Part 4
Describes procedures for testing compliance.
Part 5
Describes systems for Software simulation.
Part 6
Describes extensions for DSM-CC (Digital Storage Media Command and Control).
(Part 8: 10-bit video extension. Primary application was studio video. Part 8 has been withdrawn due to lack of interest by industry.)
Patent holders
Approximately 640 patents worldwide make up the "essential" patents surrounding MPEG-2.[5][6] These are held by over 20 corporations and one university. Where software patentability is upheld, the use of MPEG-2 requires the payment of licensing fees to the patent holders via the MPEG Licensing Association. The patent pool is managed and administered by MPEG Licensing Authority, a private organization. Other patents are licensed by Audio MPEG, Inc.[7] The development of the standard itself took less time than the patent negotiations.[8][9]
US Re 35,093 -- Systems and methods for coding even fields of interlaced video sequences -- Filed: December 9, 1994 Granted: November 21, 1995 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE35,093 Reissue of 05193004 Filed: Dec., 1990 Granted: Mar., 1993
US 5,235,618 -- Video signal coding apparatus, coding method used in the video signal coding apparatus and video signal coding transmission system having the video signal coding apparatus -- Filed: November 6, 1990 Granted: August 10, 1993 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=5,235,618
US Re 37,057 -- Apparatus and method for converting an HDTV signal to a non-HDTV signal -- Filed: May 18, 1998 Granted: February 20, 2001 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE37,057 Reissue of 05519446 Filed: Nov., 1994 Granted: May., 1996
US Re 36,015 -- Apparatus and method for processing groups of fields in a video data compression system -- Filed: October 2, 1995 Granted: December 29, 1998 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE36,015 Reissue of 05293229 Filed: Mar., 1992 Granted: Mar., 1994
US Re 36,507 -- Apparatus and method for processing groups of fields in a video data compression system to encode a single frame as an I-field and a P-field -- Filed: October 21, 1997 Granted: January 18, 2000 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE36,507 Reissue of 05293229 Filed: Mar., 1992 Granted: Mar., 1994
US 5,606,539 -- Method and apparatus for encoding and decoding an audio and/or video signal, and a record carrier for use with such apparatus -- Filed: August 31, 1994 Granted: February 25, 1997 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=5,606,539
US 5,608,697 -- Record carrier containing an audio and/or video signal which has been encoded and includes a decoder delay time parameter indicating a time delay for one or more portions of the signal -- Filed: March 18, 1996 Granted: March 4, 1997 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=5,608,697
US 5,844,867 -- Methods and apparatus for encoding and decoding an audio and/or video signal, and a record carrier used therewith or produced therefrom -- Filed: September 9, 1996 Granted: December 1, 1998 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=5,844,867
US 5,481,553 -- Methods and apparatus for preventing rounding errors when transform coefficients representing a motion picture signal are inversely transformed -- Filed: February 28, 1994 Granted: January 2, 1996 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=5,481,553
US 6,040,863 -- Method of coding and decoding motion vector and apparatus therefor, and method of coding and decoding picture signal and apparatus therefor -- Filed: December 18, 1998 Granted: March 21, 2000 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=6,040,863
US Re 34,965 -- Inter-frame predictive encoding system with encoded and transmitted prediction error -- Filed: January 14, 1993 Granted: June 13, 1995 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE34,965 Reissue of 04985768 Filed: Jan., 1990 Granted: Jan., 1991
US Re 35,158 -- Apparatus for adaptive inter-frame predictive encoding of video signal -- Filed: December 28, 1992 Granted: February 20, 1996 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE35,158 Reissue of 04982285 Filed: Apr., 1990 Granted: Jan., 1991
US Re 36,822 -- Moving image signal coding apparatus and coded signal decoding apparatus -- Filed: October 2, 1998 Granted: August 15, 2000 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=RE36,822 Reissue of 05748784 Filed: Jan., 1996 Granted: May., 1998
US 6,009,399 -- Method and apparatus for encoding digital signals employing bit allocation using combinations of different threshold models to achieve desired bit rates -- Filed: April 16, 1997 Granted: December 28, 1999 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=6,009,399
US 5,924,060 -- Digital coding process for transmission or storage of acoustical signals by transforming of scanning values into spectral coefficients -- Filed: March 20, 1997 Granted: July 13, 1999 http://patft1.uspto.gov/netacgi/nph-Parser?patentnumber=5,924,060
According to the MPEG-LA Licensing Agreement MPEG-LA, any use of MPEG-2 technology is subject to royalties.
Encoders are subject to a royalty of $2.50 per unit.
Decoders are subject to a royalty of $2.50 per unit.[10]
Royalty-based sales of encoders and decoders are subject to different rules and $2.50 per unit.[10]
Also, any packaged medium (DVDs/Data Streams) is subject to licence fees according to length of recording/broadcast.
In the case of free software such as VLC media player (which uses the ffmpeg library) and in which the software is not sold, the end-user bears the royalty.