• 沒有找到結果。

我們使用實作的硬體解碼電路,對 foreman、mobile 及 coastguard 三個國際標準 組採用的測試影片之 QCIF 及 CIF 解析度進行測試,其中 QCIF 及 CIF 的壓縮資訊分 別如 Table 13、14.所表示。

55

Table 13 qCIF 影像資訊

Table 14 CIF 影像壓縮資訊

目前硬體解碼電路合成的頻率是 37 MHz,而在這條件下測試得到的實際解碼時 間如 Table 15、16 所示。

Table 15 qCIF 解碼時間

56

至於為何 clock rate 目前無法繼續提升,根據合成工具顯示的 critical path,發現到控 制整個解碼電路的 Bitstream Parser FSM,在轉換狀態時的驅動訊號是採用 negedge clock trigger,也就是說,在得到轉換訊號的同個 clock cycle 就要將轉換訊號保存使的 各個狀態機在下一個 clokc cycle 就能夠根據保存起來的轉換訊號完成狀態,若是改成 一般的 posedge clock trigger,則整個轉換狀態的時機會晚一個 clock,造成解碼發生錯 誤,這部分由於牽涉到的模組與訊號眾多,因此沒能在本次實作完成,若此問題解決,

現階段實作下,就算 MB type 為大於 4x4 的分割模式,如 4x8、8x4、16x8、8x16、

Skip Block 等等,也依舊會以 4x4 或 8x8 的大小去做參考資料的讀取,而這會產生很 多能夠重複使用的 pixel 進行重複讀取的情況,所以在讀取參考資料前,應該先以不 同的 MB Type 來決定不同的讀取方式,一個 8x8 block 最多需要 13x13 pixel 的參考資 料,所以一個 MB Type 為 16x16 或者 Skip 的 MB 所需要的最大參考區塊是 21x21 個

57

pixel,如 Figure 56. 所示,塗色部分為預測的 block,白色部分為用來做內插的參考 pixel,由於一個 16x16MB 最多可能有 4 個不同的 refidx,所以準備 4 個 21x21 pixel 的 Reference Buffer 用來存放參考資料,以此為前提,以下針對各個 MB Type 進行討 論:

Figure 56 Reference Range

1. Inter 16x16 & Skip block:

Inter 16x16 與 Skip Block 的讀取次數會從原本的 13x4 = 52 次 4 words length burst 變成 21 次的 6 words length burst,減少了接近 60%的讀取次數。

2. Inter 16x8:

針對兩個 16x8 block 進行 13 次的 6 words length burst,減少了 50%的讀取次數。

3. Inter 8x16:

針對兩個 16x8 block 進行 21 次的 4 words length burst,總讀讀取次數從 52 次 4 words length burst 變為 42 次 words length burst,減少了近 20%的讀取次數。

4. Below8x8:

最後是 8x8 block 或當中還有 sub-block 的情況,一個 4x4 block 需要最多 10x12 pixel,所以若是 4 個 4x4 blocks 就可能需要 4x12 次 3 words length burst,代價非常高,

先判斷各個 8x8 block 之 refidx,若有相同者,再判斷各個 block 的參考座標之 X 座 標差值是否小 10 且 Y 座標差值小於 8,若皆成立則只需要 21 次的 6 words length burst

58

皆可完成,在最佳的情況下,原本一個 16x16 的 MB 被拆成 16 個 4x4 sub-block,且 滿足上述條件,則讀取次數會從原本的 4x4x12 次 3 words length burst 變為而 21 次 的 6 words length burst ,減少的讀取次數會接近原來的 90%,預期效能改良如 Table 17 所示,當然,不適用上述規則的 block 就依照原本的實作方式。

上述的演算法流程圖大致上如 Figure 57. 所示,若此演算法並沒有太複雜的設 計,且所需要進行的判斷都是 1~2 個 clock cycle 就可完成,不會對解碼器造成太大 的負擔,根據上述討論可以發現除了 Inter 16x8 外,各種類型的 MB Type 幾乎都可 能達到 60%甚至以上的改善,而從目前的結果與先前的實驗數據相比可以推斷,目 前解碼器幾乎 8 成的時間都是花在資料傳輸上,也就是說整體效能改善也有近五成,

在加上之前所敘述的 clock rate 的問題如果能夠加以解決,本硬體解碼器應該就能夠 到達至少 SD Resolution real time 解碼的效能。

Figure 57 Pre-Fetch 流程示意圖

59

Table 17 藉由 pre-fitch 預期可以達到的改良

60

六、結論與未來展望

本篇論文所提出的 H.264 Baseline 硬體解碼電路,基於 ISO/IEC 14496-10 H.264 的標準規格去實作設計,並沒有對於任何模組做特別的設計,本次實作解決了解碼影 像之解析度限制,也使解碼電路能夠成功支援 5 張的多框架預測,卻也因此而面臨到 了所有 H.264 解碼電路都會遇到的效能瓶頸,而這一部分也有許多論文進行探討研 究,本論文在第五章也提出一個相關的演算法,相信經過適當的效能改良,就可以實 現更大解析度的即時解碼,而在 H.264/AVC 標準出現 10 年左右的今天,下一代標準 的 H.265/HEVC 標準也終於出現,儘管如此,影像解碼的大致架構仍然沒有太大的改 變,只要人們對於多媒體影像的需求不被滿足,不論標準如何改變,硬體解碼電路的 效能也都將會是研究者們的重點課題。

61

文獻參考

[1] ISO/IEC MPEG and ITU-T VCEG, ITU-T Rec. H.264/ISO/IEC 14496-10 AVC, May 2003.

[2] C.-Y. Tsai, Design of an H.264 Baseline Decoder IP, NCTU master thesis,2012.

[3] M. Horowitz, A. Joch, F. Kossentini, and A. Hallapuro, "H.264/AVC baseline profile decoder complexity analysis," IEEE Transactions on Circuits and Systems for Video Technology, vol.13, no.7, pp.704-716, July 2003.

[4] C.-Y. Tsai, T.-C. Chen, T.-W. Chen, and L.-G. Chen, "Bandwidth optimized motion compensation hardware design for H.264/AVC HDTV decoder," Proc. of 48th Midwest Symposium on Circuits and Systems, vol., no., pp.1199,1202 Vol. 2, 7-10 Aug. 2005.

[5] R. Wang, M. Li, J. Li, Y. Zhang, "High throughput and low memory access sub-pixel interpolation architecture for H.264/AVC HDTV decoder," IEEE Transactions on Consumer Electronics, vol.51, no.3, pp.1006,1013, Aug. 2005.

[6] D.-Y. Shen, T.-H. Tsai,"A 4X4-block level pipeline and bandwidth optimized motion compensation hardware design for H.264/AVC decoder," IEEE International Conference on Multimedia and Expo, 2009. ICME 2009, vol., no., pp.1106,1109, June

28 2009-July 3 2009.

[7] Y. Lei, H. Li, K. Huang, Y.-C. Leng, Z. Zheng,"A H.264 video decoder with scheme of efficient bandwidth optimization for motion compensation," International Symposium on Communications and Information Technologies, 2007. ISCIT '07, vol., no.,

pp.531,534, 17-19 Oct. 2007.

[8] M. Wu, J. Guo, C. Zhang,"High efficient memory fetch architecture for motion compensation of video decoder," IEEE International Conference on Network Infrastructure and Digital Content, 2010 2nd, vol., no., pp.323,326, 24-26 Sept. 2010.

[9] Z. Huang, F, Lin, "A line based two dimensional cache design for interpolation in

62

H.264/AVC decoder," International Conference on Audio, Language and Image Processing, 2008. ICALIP 2008, vol., no., pp.390,394, 7-9 July 2008.

[10] T.-D. Chuang, L.-M. Chang, T.-W. Chiu, Y.-H. Chen, L.-G. Chen,

"Bandwidth-efficient cache-based motion compensation architecture with DRAM-friendly data access control,"IEEE International Conference on Acoustics, Speech and Signal Processing, 2009. ICASSP 2009, vol., no., pp.2009,2012, 19-24

April 2009.

[11] C. Lee, Y. Yu, "Design of a motion compensation unit for H.264 decoder using 2-dimensional circular register files,"International SoC Design Conference, 2008.

ISOCC '08, vol.02, no., pp.II-109,II-112, 24-25 Nov. 2008.

[12] B. Zatt, A . Azevedo, L. Agostini, A. Susin, S. Bampi,, "Memory Hierarchy Targeting Bi-Predictive Motion Compensation for H.264/AVC Decoder,"IEEE Computer Society Annual Symposium on VLSI, 2007. ISVLSI '07 , vol., no., pp.445,446, 9-11 March 2007.

[13] X. Chen, P. Liu, J. Zhu, D. Zhou, S. Goto, "Block-pipelining cache for motion compensation in high definition H.264/AVC video decoder,"IEEE International Symposium on Circuits and Systems, 2009. ISCAS 2009, vol., no., pp.1069-1072, 24-27

May 2009.

[14] J.-H. Kim, G.-H. Hyun, H.-J. Lee,"Cache Organizations for H.264/AVC Motion Compensation,"IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, 2007. RTCSA 2007 , vol., no., pp.534,541, 21-24

Aug. 2007.

[15] P. Chao, Y.-L. Lin, "A motion compensation system with a high efficiency reference frame pre-fetch scheme for QFHD H.264/AVC decoding,"IEEE International Symposium on Circuits and Systems, 2008. ISCAS 2008, vol., no., pp.256,259, 18-21 May 2008.

63

[16] S.-Z. Wang, T.-A. Lin,T.-M. Liu; C.-Y. Lee, "A new motion compensation design for H.264/AVC decoder,"IEEE International Symposium on Circuits and Systems, 2005.

ISCAS 2005 , vol., no., pp.4558,4561 Vol. 5, 23-26 May 2005.

[17] K. Xu, C.-S. Choy, "A Power-Efficient and Self-Adaptive Prediction Engine for H.264/AVC Decoding,"IEEE Transactions on Very Large Scale Integration (VLSI) Systems, vol.16, no.3, pp.302,313, March 2008.

[18] M.-J. Wu, SoC architecture for Reconfigurable Video Coding,NCTU master thesis, 2008.

[19] J. Zhou, D. Zhou, G. He, S. GOTO, "Cache Based Motion Compensation Architecture for Quad-HD H.264/AVC Video Decoder, " IEICE Transactions on

Electronics ,ISSN:0916-8524; VOL.2011; NO.4; PAGE.439-447 April 2011.

[20] Y. Li, Y. Qu, Y. He, "Memory Cache Based Motion Compensation Architecture for HDTV H.264/AVC Decoder," IEEE International Symposium on Circuits and Systems, 2007. ISCAS 2007, vol., no., pp.2906,2909, 27-30 May 2007.

[21] E. G. Richardson, Iain. H.264 and MPEG-4 Video Compression: Video Coding for Next-generation Multimedia. Chichester: John Wiley & Sons Ltd. , 2003.

[22] G.-J. Sullivan, T. Wiegand, "Video Compression - From Concepts to the H.264/AVC Standard," Proceedings of the IEEE , vol.93, no.1, pp.18,31, Jan. 2005.

[23] J. Zhu, L. Hou, W. Wu, R. Wang, C. Huang, J. Li, "High performance synchronous DRAMs controller in H.264 HDTV decoder," International Conference on Solid-State and Integrated Circuits Technology, 2004. Proceedings. 7th , vol.3, no., pp.1621,1624

vol.3, 18-21 Oct. 2004.

[24] H.-Y. Kang, K.-A. Jeong, J.-Y. Bae, Y.-S. Lee, S.-H. Lee, "MPEG4 AVC/H.264 decoder with scalable bus architecture and dual memory controller," International

64

Symposium on Circuits and Systems, 2004. ISCAS '04. Proceedings of the 2004, vol.2,

no., pp.II,145-8 Vol.2, 23-26 May 2004.

[25] J.-M. Hsiao,SoC architecture for MPEG Reconfigurable Video Coding Framework , NCTU, 2007.

[26] Yi-Tsen Chen, Design of an Unified Entropy IP for H.264 CAVLC/CABLC Decoding, NCTU, 2008.

[27] T.-S. Yang, Design and Implementation of an H.264/AVC Baseline Profile Decoder, NTHU master thesis, 2007.

[28] Zynq-7000 All ProgrammableSoC: Concepts, Tools, andTechniques (CTT)A Hands-On Guide to Effective EmbeddedSystem DesignUG873 (v14.4), Xilinx Inc, December 18, 2012.

[29] AMBA AXI Protocol v1.0 Specification ,Xilinx Inc, 2003.

[30] LogiCORE IP AXI Master Burst (axi_master_burst) (v1.00.a), Xilinx Inc, June 2011.

相關文件