• 沒有找到結果。

測試各 Stage 所花的時間

使用 software pipeline 中若 Stage 切割的越平均,會使效能提昇越高。在這個實驗 目標測量我們現在兩個 Stage 切割方法的執行時間是否平均。為了能仔細測量每個 macroblock 在兩個 stage 所花的時間,我們使用 5.1 小節中提到的 timer 3 來測量,其 頻率為 24MHz,測量的單位為 cycle。測量方法使用 Crew 影片,使用三種不同的 Bit rate(1.6Mbps、2Mbps 和 2.4Mbps),將每個 macroblock 在 stage 1 和 stage 2 所花的 cycle 數算平均和標準差。

Crew stage 1 stage 2

Bit rate 平均數 標準差 平均數 標準差

1.6Mbps 505 218 516 201

2Mbps 550 249 532 208

2.4Mbps 594 280 541 208

Table 19. Stage 所花的時間

由 Table 19.中,可觀查到 Bit rate 越大會使 stage 1 和 stage 2 平均 cycle 數提昇,

特別是 stage 1 的成長幅度高於 stage 2,因為 Bit rate 越大會使得 Residual block 中非 零數變多,直接影響 stage 1 中 Entropy decode 所花的時間上升。在 Bit rate 1.6Mbps 中 stage 1 和 stage 2 平均數只相差 11 cycles,Bit rate 2Mbps 也只相差 18 cycles,而 Bit rate 2.4Mbps 卻相差到 53 cycles,以上的數據搭配 Table 18 效率提昇表,可發現 Stage 切割較平均的影片(Bit rate 1.6Mbps 和 2Mbps)效率提昇較高 1.87~1.88 倍,而 Stage 切割較不平均的影片(Bit rate 2.4Mbps)提昇效率較少 1.85 倍。由上述討論可發現 Stage 切割越平均效能提昇越高。

由標準差可看的出來 Bit rate 較低的影片每個 macroblock 在 stage 1 所花的時間較 接近,反之,Bit rate 較高的影片每個 macroblock 在 stage 1 所花的時間較分散。另外 標準差也可看出 Bit rate 對 stage 2 的影響較小。

57

六、結論與未來展望

本篇論文目的在於證實一個概念,以往大家認為在多核心平台上做 software pipeline 方法的 overhead 很高,原因在於 stage 之間如何溝通、buffer 的搬運、hazards 的問題和切割 stage 的方法等都會造成很高的 overhead。特別是多媒體程式,每個 stage 之間會有大量資料的搬運,若設計不好會造成整體效能下降。另外在未來希望能實作 Dynamic pipeline stages 的方式來使的每個 stage 執行時間能更接近,因為由上面 Table 19 可發現標準差相當大,代表每個 macroblock 在 stage 執行的時間差異性相當大,所 以我們提出動態的方法,根據每個 macroblock 不同動態去調整每個 stage 所執行的事 情,希望能使得每個 stage 執行時間能更接近。

本篇論文在 PAC 開發板上使用 software pipeline 方法來改善 H.264/AVC 解碼的效 能,在研究的過程中首先針對 PAC 開發板上各處理器速度和各記憶體讀寫速度多方 的測試和了解才開始設計的 software pipeline,充分利用 PAC 開發板上所有硬體來解 決 software pipeline 設計的困難,面對 Stage 間溝通的問題我們利用 circular buffer 來 解決,只要資料在 buffer 中準備好,下個 Stage 就可以馬上執行。利用 DMA 來搬運 資料到 circular buffer,使得 stage 1、stage 2、DMA 之間硬體的高度 Overlap,解決和 解決 buffer 的搬運的 Overhead。設計 macroblock layer 的 software pipeline 來解決 Hazards 的問題。藉由板子上 timer 分析數據來切割 Stage 盡量均衡。以上為我們本篇 論文處理在多核心平台上做 software pipeline 所遇到的困難。

在第五章的數據驗證,在 PAC 平台上使用兩個 PAC DSP 做 software pipeline 效能 最高可提昇 1.88 倍,證明我們的 software pipeline 方法能在多核心系統上高度提昇系 統效能。特別在未來手持式嵌入式系統中所要解碼影片的解析度會提高到 HD、Full HD 畫質,需求運算量會大幅提昇,多核心嵌入式系統是必然的趨勢,而我們的 software pipeline 方法可以讓多核心平行處理,大量提昇解碼的效能,會來將會廣泛用於手持 式嵌入式系統中。

58

參考文獻

[1] Kibum Suh, Seongmo Park, and Hanjin Cho,“An Efficient Hardware Architecture of Intra Prediction and TQ/IQIT Module for H.264 Encoder,”ETRI Journal, Vol.

27,No.5,pp:511-524,Oct.2005.

[2] Yu-Wen Huang, Bing-Yu Hsieh, Tung-Chien Chen, and L.G. Chen, “Analysis, Fast Algorithm, and VLSI Architecture Design for H.264/AVC Intra Frame Coder,”

IEEE Trans. Circuit and Systems for Video Technology, Vol.15, No.3, pp: 378-401, Mar. 2005.

[3] Genhua Jin,Hyuk-Jae Lee, “A Parallel and Pipeline Execution of H.264/AVC Intra Prediction ,” Proceedings of The Sixth IEEE International Conference on Computer and Information Technology(CIT'06)

[4] S. Smaiui, H. Loukil, A. Ben Atitallah, N. Masmoudi , “An Efficent Pipeline Execution of H.264/AVC Intra 4x4 Frame Design,” IEEE International Multi-Conference on Systems, Signals and Devices, 2010 7th

[5] Chanho Lee, SeoHoon Yang , “Design of an H.264 Decoder with Variable Pipeline and Smart Bus Arbiter,” 2010 IEEE

[6] Yuan-Teng Chang, “A Novel Pipeline Architecture for H.264/AVC CABAC Decoder,”

2008 IEEE

[7] Honghua Hum, Derong Chen, “Optimization Techniques for A DSP Based H.264 Decoder,” 2010 IEEE

[8] F.Pescadir, G. Maturana, M.J. Garrido, E,Juarez, C. Sanz, “An H.264 Video Decoder Based on a DM6437 DSP,” 2009 IEEE

[9] Fernado Pesador, Ce’sar Sanz Matisa J. Garrido, Eduardo Jua’rez, David Samper, “A DSP Based H.264 Decoder for a Multi-Format IP Set-Top Box,” IEEE, Manuscript received January 15, 2008

[10] Tay-Jyi Lin, Chun-Nan Liu, Shau-Yin Tseng, Yuan-Hua Chu, and An-Yeu (Andy) Wu,

“Overview of ITRI PAC Project – from VLIW DSP Processor to Multicore Computing Platform,” 2008 IEEE.

[11] Taheni DAMAK, Imen WERDA, Amine SAMET, Nouri MASMOUDI, “DSP CAVLC implementation and Optimization for H.264/AVC baseline encoder,” 2008 IEEE.

[12] F.Pesador, M. J. Garrido, C. Sanz,E. Juarez, A.M. Groba, D. Samper, “A REAL-TIME H.264 BP DECODER BASED ON A DM642 DSP,” 2007 IEEE

[13] F.Pecador, G Maturana, M.J. Garrido, E. Juarez, C. Sanz, “An H.264 Video Decoder Based on a Latest Generation DSP,” 2009 IEEE, Manuscript received January 13, 2009

[14] Taheni Damak, Imen Werda, Mohamed Ali Ben Ayad, Nouri Masmoudi, “An Efficient

59

Zero Length Prefix Algorithm for H.264 CAVLC Decoder on TMS320C65,” 2010 IEEE, International Conference on Design & Technology of Integrated Systems in Nanoscale Era

[15] P. NirmalKumar, E. MuraliKrishnan, E. Gangadharan, “Enhanced Performance of H.264 using FPGA Coprocessors In video surveillance,” 2010 IEEE, International Conference on Signal Acquisition and Processing

[16] PAC 官方網站提供 Android 相關資訊 http://pac.itri.org.tw/Android.Default.aspx [17] PAC DSP 文件 “v3.3_s0001_processor_architecture_081205.pdf”

[18] PAC DSP 文件 “v3.3_s0003_programming_guide_081205.pdf”

[19] ISO/IEC 14496-10 International Standard (ITU-T Rec. H.264).

相關文件