Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359...

32
Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497

Transcript of Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359...

Page 1: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Study and Comparison of MPEG-2 and H.264 main profiles and

available transcoding methods

EE 5359Priyanka Ankolekar

1000 51 4497

Page 2: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Introduction

• Development of international video coding standards like MPEG-2 led to a boost in multimedia applications like digital video recording and teleconferencing.

• On growing demand for better compression performance led to advanced video coding standards like H.264.

• H.264 is superficially similar to MPEG-2

• However, there are significant differences in the details.

• This project aims to compare the MPEG-2 and H.264 main profiles and to discuss related transcoding methods.

Page 3: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

MPEG-2

• Second of several standards developed by the moving pictures experts group [16].

• Used as the format of digital TV signals and direct broadcast satellite TV systems.

• MPEG-2 is not optimized for low bit rates like 1Mbps. But it outperforms MPEG-1 at 3Mbps and above.

• It is used for higher data rates of 4Mbps (DVD) and 19Mbps (HDTV).

• MPEG-2 devices are back compatible with MPEG-1.

• MPEG-2/Video is formally known as ISO/IEC 13818-2 and as ITU-T Rec.H.262. [21].

Page 4: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

MPEG-2 Profiles

MPEG-2 Profiles[16]

Abbr. NamePicture Coding

TypesChromaFormat

Aspect Ratios Scalable modes

SPSimpleprofile

I, P 4:2:0square pixels, 4:3,

or 16:9none

MP Main profile I, P, B 4:2:0square pixels, 4:3,

or 16:9none

SNRSNRScalableprofile

I, P, B 4:2:0square pixels, 4:3,

or 16:9SNR (signal-to-noiseratio) scalable

SpatialSpatiallyScalableprofile

I, P, B 4:2:0square pixels, 4:3,

or 16:9SNR- or spatialscalable

HP High profile I, P, B4:2:2 or

4:2:0square pixels, 4:3,

or 16:9SNR- or spatialscalable

A profile is a collection of compression tools that together make up the coding system. A different profile means that a different set of compression tools is available. [22]

There are five profiles in MPEG-2, as summarized below.

Page 5: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

MPEG-2 Encoder [10]

Page 6: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

MPEG-2 Encoder (contd.)

• DCT: 2 dimensional 8x8 – for intra frames 8x8 pels – for inter frames 8x8 residual blocks

• Quantizer: Quantizes DCT coefficients using a default or modified matrix.

• Motion Estimation and Compensation:– In the motion estimation process, motion vectors for predicted and interpolated pictures are

coded differentially between macroblocks. – For the motion compensation process integer and half pel resolution motion vectors are

used to predict from previously decoded pictures.

8 16 19 22 26 27 29 3416 16 22 24 27 29 34 3719 22 26 27 29 34 34 3822 22 26 27 29 34 37 4022 26 27 29 32 35 40 4826 27 29 32 35 40 48 5826 27 29 34 38 46 56 6927 29 35 38 46 56 69 83

Page 7: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

MPEG-2 Decoder [7]

Page 8: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

H.264

• Developed by the Joint Video Team (JVT).

• Achieves MPEG-2 quality compression at almost half the bit rate [7].

• Significant coding efficiency, simple syntax specifications, and seamless integration of video coding into all current protocols and multiplex architectures.

• Supports various applications such as video broadcasting, video streaming, and video conferencing over fixed and wireless networks and over different transport protocols. [4]

Page 9: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

H.264 Profiles – Comparison [11]

Baseline Extended Main High

I and P Slices Yes Yes Yes Yes

B Slices No Yes Yes Yes

SI and SP Slices No Yes No No

Multiple Reference Frames Yes Yes Yes Yes

In-Loop Deblocking Filter Yes Yes Yes Yes

CAVLC Entropy Coding Yes Yes Yes Yes

CABAC Entropy Coding No No Yes Yes

Flexible Macroblock Ordering (FMO)

Yes Yes No No

Arbitrary Slice Ordering (ASO) Yes Yes No No

Redundant Slices (RS) Yes Yes No No

Each H.264 profile specifies a subset of entire bitstream of syntax and limits that shall be supported by all decoders conforming to that profile.

There are three profiles in the first version: Baseline, Main and Extended. There are four High profiles defined in the fidelity range extensions [19].

Page 10: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

H.264 Profiles – Coding parts [1]

Page 11: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

H.264 Encoder[9]

Page 12: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

H.264 Encoder

• 4x4 integer DCT: Smaller blocksize leads to a significant reduction in ringing artifacts.

• Quantization and scan: H.264 standard specifies the math formula for the quantization process.

• Deblocking filter: To reduce the blocking artifacts in the block boundaries and to stop the propagation of accumulated coded noise. The filtered image is used in motion compensated prediction of future frames and helps achieve more compression.

• Intra prediction: The encoder derives a predicted block based on its prediction with previously decoded samples (for I frames).

• Inter prediction: – Performed on the basis of temporal correlation and consists of motion estimation and motion

compensation. – Motion vector resolution is ¼ pel– Supports large number of block sizes – Multiple reference pictures (upto 32 previously coded frames).

Page 13: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

H.264 Decoder [7]

Page 14: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Comparison between H.264 and MPEG-2

Algorithm Characteristic MPEG-2 H.264

General Motion compensated predictive, residual transformed, entropy coded

Same basic structure as MPEG

Block size 8x816x16, 8x16, 16x8, 8x8, 4x8, 8x4,

4x4

Macroblock size 16x16 (frame mode)16x8 (field mode)

16x16

Intra Prediction None Multi-direction, Multi-pattern

QuantizationScalar quantization with

step size of constant increment

Scalar quantization with step size of increase at the rate of 12.5%

Entropy coding VLC CAVLC, CABAC

Weighted prediction No Yes

Page 15: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Comparison between H.264 and MPEG-2 (contd.)

Algorithm Characteristic MPEG-2 H.264

Reference picture One picture Multiple pictures

Motion Estimation Blocks 16x16 16x16, 8x8, 8x4, 4x4

Entropy Coding Multiple VLC Tables Arithmetic Coding and adaptive VLC Tables

Frame Distance for Prediction +/- 1 Unlimited forward/backward

Fractional Motion Estimation 1/2 Pixel (MPEG2) 1/4 Pixel

Deblocking Filter None Dynamic edge filters

Scalable coding support [2] Yes, layered picture spatial, SNR, temporal scalability

With some support on temporal and SNR scalability

Bit rates with same quality HD video with resolution (1920 x 1080)

12 -20 Mbps 7 – 8 Mbps

Transmission rate 2 – 15 Mbps 64 kbps – 150 Mbps

Page 16: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 – Simulations

• Test streams used: Foreman (CIF), News (CIF), Carphone (QCIF) [26].

• Codecs used: MPEG-2 [25] and H.264 [24]

• Profiles for which the simulations were run: Main and Simple/Baseline.

• Compression ratio = Original file size/Compressed file size

• Formula to compute PSNR for MPEG-2 (MAXI = 255)

Page 17: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 –Simulation (Foreman)

MPEG-2 Main Profile H.264 Main Profile H.264 Main Profile H.264 Main Profile

Page 18: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 –Simulation results (Foreman)

Parameter MPEG-2 H.264

Input video resolution 352 x 288 (CIF)

352 x 288 (CIF)

fps 30 30

# frames encoded 90 90

GOP I-P-B-B-P-B-B I-B-B-P-B-B-P

PSNR (Y) (dB) 30.42 37.03

PSNR (U) (dB) 39.1 41.08

PSNR (V) (dB) 39.6 43.81

Bit rate (kbits/second) 481.00 481.06

Original file size (.yuv) (MB) 13.3 13.3

Compressed file size (KB) 179 172

Compression ratio 74:1 78:1

Page 19: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 –Simulation (News)

MPEG-2 Main Profile H.264 Main Profile

Page 20: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 –Simulation results (News)

Parameter MPEG-2 H.264

Input video resolution 352 x 288 (CIF) 352 x 288 (CIF)

fps 30 30

# frames encoded 90 90

GOP I-P-B-B-P-B-B I-B-B-P-B-B-P

PSNR (Y) (dB) 37.02 39.1

PSNR (U) (dB) 37.02 41.0

PSNR (V) (dB) 39.02 42.0

Bit rate (kbits/second) 376.00 376.00

Original file size (.yuv) (MB) 13.3 13.3

Compressed file size (KB) 141 134

Compression ratio 94:1 99.7:1

Page 21: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 –Simulation (Carphone)

MPEG-2 Main Profile H.264 Main Profile

Page 22: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Performance comparison between H.264 and MPEG-2 –Simulation results (Carphone)

Parameter MPEG-2 H.264

Input video resolution 176 x 144 (QCIF) 176 x 144 (QCIF)

fps 30 30

# frames encoded 90 90

GOP I-P-B-B-P-B-B I-B-B-P-B-B-P

PSNR (Y) (dB) 30.46 37.6

PSNR (U) (dB) 36.36 40.9

PSNR (V) (dB) 36.5 41.5

Bit rate (kbits/second) 128 127.6

Original file size (.yuv) (MB) 3.3 3.3

Compressed file size (KB) 47.2 45.6

Compression ratio 69.6:1 72.6:1

Page 23: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Conclusions from simulations

For the same bit rate and video resolution, the PSNR (dB) values are greater for H.264 encoded videos than for the MPEG-2 encoded videos indicating better video quality. This can be verified from the screen shots.

The compression ratio for H.264 encoded video is also better than that for MPEG-2 encoded video inspite of better quality video in H.264.

Page 24: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Transcoding: Introduction

• Transcoding is the coding and recoding of digital content from one compressed format to another to enable transmission over different media and playback over various devices [29].

• High demand for efficient usage of available bandwidth.

• Interoperability between different networks and devices is gaining importance. Transcoding is a step in this direction.

• Many legacy systems like digital TVs use MPEG-2. Therefore the need for a transcoding architecture that employs the lower cost of H.264 video and does not require a significant investment in additional video coding architecture.

Page 25: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Transcoding: The criteria

To achieve optimum results, the following criteria should be satisfied:

• The quality of the transcoded bitstream should be comparable to the one obtained by direct decoding and re-encoding of the output stream.

• The information contained in the input stream should be used as much as possible to avoid multigenerational deterioration.

• The process should be cost efficient, low in complexity and achieve the highest quality possible.

Page 26: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Transcoding: Architectures [7,15]Open Loop Transcoding

• Operate in transform domain.

• Computationally efficient – since they operate directly on DCT coefficients.

• Suffer from drift problem.

Page 27: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Transcoding: Architectures [7,15]Cascaded Pixel Domain Transcoding

• Drift-free architecture

• Concatenation of simple encoder and decoder

• Reduced complexity since the encoder reuses the motion vectors along with other information extracted from the input bit stream.

Page 28: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Transcoding: Architectures [7,15]Simplified DCT Domain Transcoding

• Based on the assumption that DCT, IDCT and motion compensation are all linear operations.

• Less memory required as compared to CPDT.

• Computationally intensive, since motion compensation is performed in the DCT domain.

• Due to linearity assumptions, problem of drift may occur.

Page 29: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

Transcoding: Architectures [7,15]Cascaded DCT Domain Transcoding

• Used for spatial and temporal resolution downscaling.

• Greater flexibility as compared to SDDT.

• Greater cost and complexity – since additional DCT motion compensation and frame memory is used.

• Adopted for downscaling operations where the encoder side DCT-MC and memory will not cost much.

Page 30: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

References[1] Soon-kak Kwon, A. Tamhankar and K.R. Rao, “Overview of H.264 / MPEG-4 Part 10 (pp.186-

216)”, Special issue on “ Emerging H.264/AVC video coding standard”, J. Visual Communication and Image Representation, vol. 17, pp.183-552, April 2006.

[2] A. Puri, H. Chen and A. Luthra, “Video Coding using the H.264/MPEG-4 AVC compression standard”, Signal Processing: Image Communication, vol.19, pp 793-849, Oct 2004.

[3] Hari Kalva, “Issues in H.264/MPEG-2 Video Transcoding”, Computer Science and Engineering, Florida Atlantic University, Boca Raton, FL.

[4] S. Sharma, “Transcoding of H.264 bitstream to MPEG 2 bitstream”, Master’s Thesis May 2006, EE Department, University of Texas at Arlington.

[5] S. Sharma, K. R. Rao, “Transcoding of H.264 bitstream to MPEG-2 bitstream”, Proceedings of Asia-Pacific Conference on Communications 2007.

[6] “Emerging H.264/AVC Video Coding Standard”, J. Visual Communication and Image Representation, vol.17, pp. 183-552, April 2006.

[7] P.N.Tudor, “Tutorial on MPEG-2 Video Compression”, IEE J Langham Thomson Prize, Electronics and Communication Engineering Journal, December 1995.

[8] “The MPEG-2 International Standard”, ISO/IEC, Reference number ISO/IEC 13818-2, 1996.[9] T. Wiegand et. al., “Overview of the H.264/AVC Video Coding Standard”, IEEE Transactions on

Circuits and Systems for Video Technology, Vol. 13, Issue 7, pp. 560-576, July 2003.

[10] J McVeigh et. al., “A software based real time MPEG-2 video encoder”, IEEE Trans. CSVT,

Vol 10, pp 1178-1184, Oct.2000.[11] Morris, O.J., “MPEG-2: Where did it come from and what is it?”, IEE Colloquium, pp. 1/1-1/5,

24 Jan 1995.

Page 31: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

References (contd.)[12] Kunzelmann, P.; Kalva, H., “Reduced Complexity H.264 to MPEG-2 Transcoder”, ICCE 2007,

pp. 1-2, January 2007.[13] Kamaci, N., Altunbasak, Y., “Performance Comparison of the Emerging H.264 Video Coding

Standard with the existing standards”, ICME, Vol.1, pp. 345-8, July 2003.[14] Jun Xin, Chia-Wen Lin, Ming-Ting Sun , “Digital Video Transcoding”,Proceedings of the IEEE, Vol. 93, Issue 1,pp 84-97, January 2005.[15] A. Vetros, C. Christopoulos and H. Sun, “Video transcoding architectures and techniques: an

overview”, IEEE Signal Processing magazine, Vol. 20, Issue 2, pp 18-29,March 2003.[16] “MPEG-2”, Wikipedia, 14 February 2008. Available at <http://en.wikipedia.org/wiki/Mpeg_2>[17] “Introduction to MPEG 2 Video Compression” Available at <http://www.bretl.com/mpeghtml/codecdia1.HTM>[18] “H.264/MPEG-4 AVC”, Wikipedia, 18 February 2008. Available at < http://en.wikipedia.org/wiki/H.264>[19] “H.264 A new Technology for Video Compression” – Available at <

http://www.nuntius.com/technology3.html>[20] R Periera, “Efficient transcoding of MPEG-2 to H.264”, Master’s thesis Dec 2005, EE

Department, University of Texas at Arlington. [21] “H.262 : Information technology - Generic coding of moving pictures and associated audioinformation: Video”, International Telecommunication Union, 2000-02.Available at < http://www.itu.int/rec/T-REC-H.262>[22] “MPEG-2 White paper”, Pinnacle Technical Documentation, Version 0.5, Pinnacle Systems,

Feb. 29, 2000.

Page 32: Study and Comparison of MPEG-2 and H.264 main profiles and available transcoding methods EE 5359 Priyanka Ankolekar 1000 51 4497.

References (contd.)[23] M. Ghanbari, “Standard Codecs : Image Compression to Advanced Video Coding,” Hertz, UK:

IEE, 2003.[24] H.264 software (version 13.2) obtained from:<http://iphome.hhi.de/suehring/tml/>[25] MPEG-2 software (version 12) obtained from:<http://www.mpeg.org/MPEG/video/mssg-free-mpeg-software.html>[26] Test streams (Foreman, News, Carphone) obtained from:<http://www-ee.uta.edu/dip/Courses/EE5356/ee_5356.htm> [27] Implementation Studies Group, “Main Results of the AVC Complexity analysis”, MPEG

document N4964, ISO/IEC JTC11/SC29/WG11, July 2002.[28] A. Joch et al., “Performance comparison of video coding standards using Lagarangian coder

control”, Int. Conf. of Image Processing, Vol. 2, pp. II-501 to II-504, Sept. 2002.[29] I. Sylvester, “Transcoding: The future of the video market depends on it”, IDC Executive Brief,

Nov. 2006. Available at <

http://www.ed-china.com/ARTICLES/2006NOV/2/2006NOV10_HA_AVC_HN_12.PDF>[30] R. Hoffner, “MPEG-4 Advanced Video Coding emerges”, Available at < http://www.tvtechnology.com/features/Tech-Corner/F_Hoffner-03.09.05.shtml>[31] S. Wagston and A. Susin, “IP core for an H.264 Decoder SoC”, 2007,Available at< www.us.design-reuse.com/news/?id=15746&print=yes>[32] S. Krishnamachari and K. Yang, “MPEG-2 to H.264 Transcoding: Why and How?”, Dec. 1,

2006, Available at <

http://broadcastengineering.com/infrastructure/broadcasting_mpeg_transcoding_why/index1.html>