Video Compression Standards : A Comparative Analysis of H.264, Dirac and AVS P2 By Sudeep Gangavati ID 1000717165 EE5359 Spring 2012, UT Arlington Objective and motivation • The goal – to compare H.264/AVC, AVS P2 and Dirac • Video quality assessment – MSE, PSNR, SSIM • Ever increasing demand for video compression • Several different video coding standards have been developed to address the needs efficient video coding for multitude of applications like video streaming, TV broadcasting, 3D TV, Freeviewpoint TV etc. [24]. H.264/AVC Features • The most widely used video coding standard Fig. 1 Video coding standards evolution [12] Features • Motion compensated coding structure • Picture slices MBs subMBs blocks pixels. This is shown in Figure 3. • Only 4:2:0 chroma format was supported earlier and 4:2:2 , 4:4:4 were added later. This is shown in Figure 2. • I , P and B slices • Derived slices SI and SP Fig 2. 4:4:4, 4:2:2, 4:2:0 sampling patterns Fig 3. H.264 syntax Profiles and levels • • • • Main Profile Baseline Profile Extended Profile High Profile H.264 Profiles Fig.4 H.264 profiles [1] H.264 Encoder Fig. 5 Encoder structure for H.264 [2] H.264 Decoder Fig.6 Decoder structure of H.264 [2] Intra and Inter Predictions Intra Prediction : • • • • Uses spatial prediction to reduce spatial redundancy. 4 X 4 luma – 9 modes 16 X 16 luma – 4 modes 8 X 8 luma- 9 modes Intra prediction modes for 4X4 luma Fig.7(a) Intra prediction modes [6] The samples above and to the left, labelled A-M in Figure 7 have previously been encoded and reconstructed and are therefore available in the encoder and decoder to form a prediction reference. Intra Prediction Modes for 16x16 luma • Again the previously encoded samples directly above and to the left of the macroblock have been reconstructed and are used for the prediction Fig 7 (b) Intra prediction modes for 16x16 luma [6] Inter prediction Uses motion estimation and motion compensation (MC). 1 macroblock partition of 16*16 luma samples and associated chroma samples Macroblock partitions 2 macroblock partitions of 16*8 luma samples and associated chroma samples 2 macroblock partitions of 8*16 luma samples and associated chroma samples 0 0 0 Sub-macroblock partitions 2 sub-macroblock partitions of 8*4 luma samples and associated chroma samples 2 sub-macroblock partitions of 4*8 luma samples and associated chroma samples 0 0 0 0 1 2 3 1 1 1 sub-macroblock partition of 8*8 luma samples and associated chroma samples 4 sub-macroblocks of 8*8 luma samples and associated chroma samples 4 sub-macroblock partitions of 4*4 luma samples and associated chroma samples 0 1 2 3 1 1 Fig.8 H.264 Inter prediction [5] De-blocking filter[5] • Is used to reduce the blocking artifacts. • Since the filter is present in the loop , it prevents the propagation of the blocking artifacts. Fig. 9 Boundaries in a macroblock to be filtered (luma boundaries shown with solid lines and chroma boundaries shown with dotted lines) [1] AVS China[7] • AVS-Audio Video Standard • Standardization includes system, audio, video and digital copyright management. • Goal – to achieve coding efficiency with reduced complexity. AVS Parts [3] Fig. 10 AVS China parts [3] AVS P2 Encoder [7] Fig. 11 AVS part 2 encoder [7] AVS P2 decoder Fig 11 (a) AVS P2 decoder block diagram [7] Intra Prediction in AVS[7] • Spatial prediction is used in intra coding in AVS part 2. • The Intra prediction is based on 8x8 block • The intra prediction method is derived from the neighboring pixels in left and top blocks Intra Prediction contd. Fig.12 (a) Five different modes for intra luminance prediction[16] Inter prediction [16] • Inter prediction in AVS is by motion compensation and motion estimation [16]. • As shown in the Figure 12 (b), the macroblock can have 16 x 16, 8 x 16, 16 x 8 or 8 x 8 [16]. Fig 12 (b) Macroblock sizes [16] Dirac • Dirac is a video codec originally developed by BBC • This technique is used from web streaming of videos to HD TV applications to storage of content. • Dirac can compress any resolution picture • The encoder and decoder diagrams are shown in Figure 13 (a) and (b) respectively. Dirac encoder and decoder : Figure 13 (a) Dirac encoder[8] Figure 13 (b) Dirac decoder[8] Dirac pro Features Dirac pro supports the following technical aspects [9]: • • • • • • • Intra-frame coding only 10 bit 4:2:2 No subsampling Lossless or visually lossless compression Low latency on encode/decode Support for multiple HD image formats and frame rates Low complexity for decoding Experimental Results Implementation of DIRAC Software 1.02: Video sequence: news_qcif.yuv. Width: 176, Height: 144. Total number of frames: 300 Number of frames used for encoding: 100. Frame rate: 25 FPS. File Size: 3713kB. Quality Factor Compressed File Size Bit rate (kBps) Y-PSNR(dB) Y-MSE Y-SSIM Comrpession Ratio 0 38 9.573 25.773 187.13 0.79 98:1 5 61 15.571 32.134 39.588 0.95 60:1 10 369 96.301 46.699 1.41 0.98 10:1 15 1278 130.12 51.799 0.743 0.99 2.9:1 Table 1: Parametric values for Dirac video codec Experimental Results contd. Quality Factor = 5 Quality Factor = 0 Quality Factor = 10 Fig.14 Output of Dirac video codec at different Quality Factors Video sequence: foreman_qcif.yuv Width: 176; Height: 144. Total number of frames: 300 Number of frames used for encoding: 100. Frame rate: 25 FPS; File Size: 3713kB Quality Factor (QF) Compressed File Size (kB) Bitrate (kBps) Y-PSNR (dB) Y-MSE Y-SSIM Compressio n Ratio 0 27 8.991 21.5 301.56 0.6875 138:1 5 58 12.675 28.91 110.12 0.8613 64:1 10 581 140.673 43.675 0.827 0.979 6:1 15 1340 170.342 49.556 0.667 0.99 2.7:1 Table 2. Parametric values of Dirac video codec for foreman_qcif video • QF=0 QF=05 QF=10 QF=15 Fig.15 Output of Dirac video codec at different Quality Factors for foreman_qcif video Implementation of AVS software Video sequence used: news_qcif.yuv Width: 176;Height: 144 Total number of frames: 300; Number of frames used: 100 Frame rate: 25 FPS; File Size: 3713kB QP=0 QP=10 QP=50 Fig.16 Output of AVS video codec at different Quality Factors for news_qcif video Fig.17 Output of AVS video codec at different Quality Factors for foreman _qcif video Implementation of AVS software Quantization Parameter (QP) Compressed File Size Bit rate (kBps) Y-PSNR(dB) Y-MSE Y-SSIM Comrpession Ratio 0 980 554.19 54.773 0.2587 0.9997 3:1 10 442 219.12 49.72 0.5525 0.9945 9:1 30 64.0 156.49 38.49 9.23 0.9760 58:1 50 12.0 29.26 27.96 104.13 0.8506 309.7 Table 3. Parametric values of AVS video codec for news_qcif video QP Compressed file size Bitrate Y-PSNR Y-MSE Y-SSIM Compressio n Ratio 0 1123 478.88 52.658 0.2823 0.998 3:1 10 450 278.9 48.775 0.781 0.9903 8.25:1 30 70 79.66 35.231 13.56 0.867 53:1 50 14 24.5 29.780 146.32 0.776 265:1 Table 4. Parametric values of AVS video codec for foreman_qcif video Implementation of H.264 software (JM 18.0) Quantization Parameter (QP) Compressed File Size Bit rate (kBps) Y-PSNR(dB) Y-MSE Y-SSIM Comrpession Ratio 0 279 685.19 60.773 0.21619 0.999 13:1 10 208 410.21 48.545 0.9653 0.9947 17.8:1 30 123 155.62 35.721 17.4211 0.8626 30:1 50 35 29.49 28.736 224.23 0.7644 27.5:1 Table 5. Parametric values of H.264 video codec for news_qcif video Quantization Parameter (QP) Compressed File Size Bit rate (kBps) Y-PSNR(dB) Y-MSE Y-SSIM Comrpession Ratio 0 379 485.19 62.773 0.21619 0.999 9:1 10 210 340.21 54.67 0.7769 0.9947 18:1 30 98 155.62 34.721 14.4211 0.8626 39:1 50 25 39.49 27.736 236.23 0.6944 27.5:1 Table 6. Parametric values of H.264 video codec for foreman_qcif video Plots of PSNR (dB) vs. Bitrate (kBps) PSNR vs Bitrate 65 60 55 50 P S N R (dB) 45 40 35 H.264 30 AVS 25 Dirac 20 15 10 5 0 0 50 100 150 200 250 300 350 400 450 500 550 600 650 Bitrate (kBps) Fig18. Plot of PSNR vs. Bitrate for different codecs for news_qcif video 700 750 Plots of PSNR (dB) vs. Bitrate (kBps) contd.. 60 55 50 45 P S N R (dB) 40 35 30 H.264 25 AVS Dirac 20 15 10 5 0 0 50 100 150 200 250 300 350 400 450 500 550 Bitrate (kBps) Fig 19. Plot of PSNR vs. Bitrate for different codecs for foreman_qcif video Plots of MSE vs. Bitrate MSE vs Bitrate 250 200 150 MSE H.264 AVS Dirac 100 50 0 0 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 Bitrate (kBps) Fig 20. Plot of MSE vs. Bitrate for different codecs for news_qcif video Plots of MSE vs. Bitrate contd.. MSE vs Bitrate 325 300 275 250 225 200 MSE Dirac 175 AVS 150 H.264 125 100 75 50 25 0 0 100 200 300 400 Bitrate (kBps) Fig 21. Plot of MSE vs. Bitrate for different codecs for foreman_qcif video 500 600 Plot of SSIM vs. Bitrate SSIM vs. Bitrate 1.2 1 SSIM 0.8 H.264 0.6 AVS Dirac 0.4 0.2 0 0 100 200 300 400 500 600 Bitrate (kBps) Fig 22. Plot of SSIM vs. Bitrate for different codecs for news_qcif video 700 800 Plot of SSIM vs. Bitrate SSIM vs. Bitrate 1.2 1 SSIM 0.8 H.264 0.6 AVS Dirac 0.4 0.2 0 0 100 200 300 400 Bitrate Fig 23. Plot of SSIM vs. Bitrate for different codecs for foreman_qcif video 500 600 Computational complexity Computational complexity 1200 Time in seconds 1000 800 H.264 600 AVS Dirac 400 200 0 Codecs Fig 24. Plot of time taken by each codec at QP=30 and QF=10 Conclusions • The plots and tabulations show that with the increase in bitrate, there is an increase in PSNR and SSIM and reduction in the MSE. • Therefor from the plots and the tables, it can be concluded that H.264 provides optimum performance with respect to PSNR, MSE and SSIM over AVS part 2 and Dirac. • Regarding the computational complexity, H.264 is more complex than the other two standards viz., AVS part 2 and Dirac. This is due to the fact that H.264 supports several prediction modes and has varied macroblock sizes when compared to AVS and Dirac. 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.186-216, April 2006. [2] T. Wiegand, G. Sullivan, G. Bjontegaard and A. Luthra, “Overview of the H.264/AVC video coding standard,” IEEE Trans. on Circuits and Systems for Video Technology, vol. 13, pp.560-576, July 2003. [3] T. Sikora, “Digital video coding standards and their role in video communications”, Signal Processing for Multimedia, J.S. Byrnes (Ed.), IOS press, pp. 225-251, 1999. [4] K. R. Rao, and D. N. Kim, “Current video coding standards: H.264/AVC, Dirac, AVS China and VC-1,” IEEE 42nd Southeastern symposium on system theory (SSST), March 7-9 2010, pp. 1-8, March 2010. [5]Z. Wang and A.C. Bovik, “A universal image quality index”, IEEE Signal Processing Letters,Vol.9, pp. 81-84, March 2002. [6] Iain Richardson, “ The H.264 advanced video coding standard”, Second Edition,Wiley, 2010 [7] L. Yu et al, “An Overview of AVS-Video: tools, performance and complexity”, Visual Communications and Image Processing, Proc. of SPIE, vol. 5960, pp. 679-690, July 2005. [8] “ The Dirac web page” :http://www.bbc.co.uk/rd/projects/dirac/intro.shtml [9] “Dirac Codec Wiki Page ” at http://en.wikipedia.org/wiki/Dirac(codec) [10]“Dirac Pro web page” at http://www.bbc.co.uk/rd/projects/dirac/diracpro.shtml [11] “Video on the web “ a http://etill.net/projects/dirac_theora_evaluation/ [12] J.Lou “Advanced video codec optimization techniques”, Doctoral Dissertation, Electrical Engineering Department, University of Washington, August 2009 References [13] H.264 AVC JM Software : http://iphome.hhi.de/suehring/tml/ [14] H.264 decoder: http://www.adalta.it/Pages/407/266881_266881.jpg [15] W. Gao et al, “AVS - The Chinese next-generation video coding Standard” NAB, Las Vegas, 2004. [16] X. Wang et al., “Performance comparison of AVS and H.264/AVC video coding standards” J. Comput. Sci. & Technol., vol.21, No.3, pp.310-314, May 2006. [17] AVS China part 2 video software, password protected : ftp://124.207.250.92/ [18] S. Swaminathan and K.R. Rao, “Multiplexing and demultiplexing of AVS CHINA video with AAC audio,” TELSIKS 2011, Nis, Serbia, 5-8 Oct. 2011. [19] Dirac Pro Software : http://diracvideo.org/download/ [20] M. Tun, K.K. Loo and J. Cosmas, “Semi-hierarchical motion estimation for the Dirac video codec,” 2008 IEEE International Symposium on Broadband Multimedia Systems and Broadcasting, pp.1–6, March 31-April 2, 2008. [21] T. Davies, “The Dirac Algorithm”: http://dirac.sourceforge.net/documentation/algorithm/, 2008. [22] Dirac video codec – A programmer's guide: http://dirac.sourceforge.net/documentation/code/programmers_guide/toc.htm [23] A. Ravi and K.R. Rao, “Performance analysis and comparison of the Dirac video codec with H.264 / MPEG-4 Part 10 AVC,”IJWMIP, vol.4, pp.635-654, No.4, 2011. [24] Proceedings of the IEEE Special issue on Frontiers of Audiovisual Communications, vol. 100, No.4, April 2012