用户名: 密码: 验证码:
基于BSP-16处理器的H.264视频编码器的优化与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
H.264/AVC是ITU-T和ISO/IEC联合推出的最新视频压缩标准,采用了近几年视频压缩方面的先进技术,以较高的编码效率和网络友好性成为新一代国际视频压缩标准。大量的试验表明H.264编码器的高效率是以更高的运算复杂度为代价的。实际应用中,恰当的使用H.264编码算法可以用低计算复杂度的算法来达到与高复杂度算法相近的编码效果。而在实际的视频编码器的开发中,需要对运算复杂度和编码效果之间进行兼顾考虑。
     本课题是通过参考当前PC平台上最成功的开源H.264编码器X264,在Equator公司以BSP-16多媒体DSP处理器为核心的Babelfish II多媒体开发平台上进行H.264的视频编码器的设计。为了能够降低编码器的运算复杂度,针对编码器中不同作用和实现方法的部分,需要采用不同的优化方式。对基本模块可以使用多媒体指令来优化,对于压缩算法可以通过研究快速算法来替代。本文基于以上思想进行优化,具体包括下述工作。
     由于X264中帧内最佳预测模式的选择使用的是全搜索的算法,这使得算法复杂度相当高。针对这种情况,本文提出了针对16×16亮度块和4×4亮度块的快速帧内预测模式选择算法。其中针对16×16亮度块的快速选择算法是基于宏块图像纹理属性而进行快速决策的,而针对4×4亮度块的快速算法是根据相邻预测方向代价相近的原理来进行快速选择的。
     为了更进一步提升编码器的性能以实现编码器的实时编码,本文采用BSP-16处理器的媒体指令集来对编码器进行优化。根据对编码器各模块的分析,使用FIRtree媒体指令集针对诸如运动搜索、运动补偿、整数变换、量化以及半象素插值等模块进行了优化,更进一步提高了编码器的执行速度。
     实验结果表明,通过对H.264编码器中运算密集模块进行算法和指令集的优化后,编码器的执行速度获得了大幅的提高。最终在Babelfish II开发平台上实现了CIF格式视频的实时编码。
The newest standard approved by the ITU-T and ISO/IEC organizations is H.264/AVC, it represents a number of advances in video coding technology and becomes the newest international video coding standard because of both high coding efficiency and network friendliness. But the experiment results show that the improved coding efficiency comes with great complexity increase at the encoder. In fact, proper use of the H.264/AVC encode methods lead to roughly the same performances as the complex configuration. So both computational complexity and coding efficiency should be thought and made to the optimal trade-off in the implementation of actual coding system.
     In this paper, we present the design of H.264 encoder, based on the open source codec X264 ( one of the most successful H.264 encoders on the PC platform ) and BSP-16 development platform -- Babelfish II development board and iMMediaTools SDT. In order to reduce the complexity of the encoder, the fast algorithms are developed to replace the old one and the multimedia instruction set are used to optimize the basic modules. This dissertation is based on the above methods, and major works are as follows.
     Because in the X264, the full search algorithm is used to choose the best intra prediction mode. However it is very computationally expensive. To reduce the complexity of the intra prediction of the encoder, one fast intra-prediction mode selection algorithm for luma 16*16 block and one for luma 4*4 block are proposed. The fast algorithm for luma 16*16 block is using the macroblock properties to fast determine the best mode. And the algorithm for luma 4*4 block is using the modes with similar neighborhood direction have similar costs to fast determine.
     To further optimize the performance of the encoder, the multimedia intruction set of BSP-16 is used. Based on the analyse of the encoder, the relatively time-consuming modules such as motion estimate, motion compensation, integer transform, quantization and sub-pel interpolation are optimized through the FIRtree multimedia instruction set of BSP-16, which further improve the encoding rate.
     The experiment results show that after optimizing H.264 encoder at algorithm and instruction level, the computationally intensive modules in H.264 encoder was further optimized, and the encoder was significantly speeded up. And finally the optimized encoder can realize the real-time encoding (for CIF sequences) on the Babelfish II platform.
引文
[1] Joint Video Team(JVT) of ISO/IEC MPEG and ITU-T VCEG. Draft ITU-T Recommendation and Final Draft International Standard of Joint Video Specification(ITU-T Rec. H.264 | ISO/IEC 14496-10 AVC). [S]. JVT-G050. 2003-03.
    [2] ThomasWiegand, Gary J. Sullivan, Gisle Bjontegaard, and Ajay Luthra. Overview of the H.264/AVC Video Coding Standard. [J]. IEEE Transactions on Circuits and Systems for Video Technology/ vol. 13, no. 7. 2003-07.
    [3] Iain E. G. Richardson. H.264 and MPEG-4 Video Compression-Video Coding for Next-generation Multimedia. [M]. John Wiley & Sons Ltd, 2003.
    [4] 李世平. 2005 年全球 H.264 编解码器荟萃. [Z]. http://lspbeyond.go1.icpcn.com. 2006-09-20.
    [5] Yu Shengfa, Chen Zhenping, Zhuang Zhaowen. Instruction-Level Optimization of H.264 Encoder Using SIMD Instuctions. [J]. International Conference on Image Processing (ICIP). 2006.
    [6] 柏海涛. H.264/AVC 编解码算法分析与优化. [D]. 四川:四川大学计算机学院. 2005.
    [7] Shashi Kant, Mithun U, PSSBK Gupta. Real Time H.264 Video Encoder Implementation on A Programmable DSP Processor for Videophone Applications. [J]. International Conference on Image Processing (ICIP). 2006.
    [8] 黄勇坚,王亚丽,王洪君. H.264/AVC 视频编码器的 DSP 实现. [J]. 电子技术. 2006 年第 9 期. 2006-09.
    [9] 陈光华. 基于 MAP-CA BSP-15 处理器 AVS 视频编码器的设计与实现. [D]. 浙江大学. 2005.
    [10] 潘松. 现代 DSP 技术. [M]. 西安:西安电子科技大学出版社. 2003-08.
    [11] Equator Unveils Latest BSP-16 Video Processor Chip. [Z]. http://www.embeddedstar.com. 2003-06-19.
    [12] Pixelworks, Inc. PWBSP-16 Datasheet. [Z]. http://www.pixelworks.com. 2006-05-04.
    [13] Pixelworks, Inc. PWBSP-16 Data Book. [Z]. http://www.pixelworks.com. 2006-05-27.
    [14] Pohua P. Chang, Nancy J. Warter, Scott A. Mahlke, William Y. Chen, Wen-mei W. Hwu. "Three Architectural Models for Compiler-Controlled Speculative Execution". [J]. IEEE Transaction on Computers, Vol. 44, No. 4, 1995-04, pp. 481-494.
    [15] Pixelworks, Inc. PWBSP-16 Instruction Set. [Z]. http://www.pixelworks.com. 2006-03-27.
    [16] Pixelworks, Inc. Polycom Information and Training Session Introduction to the VLx. [Z]. http://www.pixelworks.com. 2004-07-20.
    [17] Polycom Information and Training Session Introduction to Using the DS Device Driver. [Z]. http://www.pixelworks.com. 2004-07-20.
    [18] Pixelworks, Inc. Babelfish II Board Hardware Reference Guide. [Z]. http://www.pixelworks.com. 2006-01-26.
    [19] Pixelworks, Inc. Babelfish II Development Set-Top Box User’s Guide. [Z].http://www.pixelworks.com. 2006-04-05.
    [20] Pixelworks, Inc. Babelfish II Development Set-Top Box V1.0 Release Notes. [Z]. http://www.pixelworks.com. 2006-04-05.
    [21] Pixelworks, Inc. iMMediaTools v7.0-7073-067 Release Notes. [Z]. http://www.pixelworks.com. 2006-08-08.
    [22] Pixelworks, Inc. SDK Tools. [Z]. http://www.pixelworks.com. 2004-08-01.
    [23] Vicki H. Allan, Reese B. Jones, Randall M. Lee, Stephen J. Allan. Software Pipelining. [J]. ACM Computing Surveys. Vol. 27, No. 3. 1995-09.
    [24] 李世平. 2005 年全球 H.264 编解码器荟萃. [Z]. http://lspbeyond.go1.icpcn.com. 2005-09-20
    [25] x264 - a free h264/avc encoder. [Z]. http://www.videolan.org. 2007-01-23.
    [26] 李世平. 2006 主流视频 codec 性能评测报告. [Z]. http://lspbeyond.go1.icpcn.com. 2006-12-29.
    [27] 李世平. H.264 三大开源编码器之评测报告. [Z]. http://lspbeyond.go1.icpcn.com. 2005-06-19.
    [28] Equator Technologies, Inc. iMMediaC Compiler User’s Guide. [Z]. http://www.pixelworks.com. 2002-04-15.
    [29] Iain E. G. Richardson. H.264/MPEG-4 Part 10 White Paper. [M]. http://www.vcodex.com. 2002-07-10.
    [30] Feng Pan, Xiao Lin, et al. Fast Mode Decision for Intra Prediction. [A]. ISO/IEC JTC1/SC29/WG11 and ITU-T SG16 Q.6, JVT 7th Meeting Pattaya II, Tharland. 2003-03.
    [31] B.jeon and J.Lee. Fast mode decision for H.264. [A]. ISO/IEC JTC1/SC29/WG11 and ITU-T SG16 Q.6, JVT 10th Meeting Waikoloa, Hawaii. 2003-12.
    [32] Bojun Meng, Oscar C.Au. Fast Intra-prediction Mode Selection for 4×4 Blocks in H.264. [A]. IEEE International Conference on Acoustics, Speech and Signal Processing - Proceedings. 2003.
    [33] Chang-sung Kim, Qing Li and C.-C. Jay Kuo. Fast intra-prediction model selection for H.264 CODEC. [J]. Proceedings of the Society of Photo-optical Instrumentation Engineers (SPIE). 2003-09
    [34] Chang-sung Kim, Qing Li and C.-C. Jay Kuo. Fast intra-prediction model selection for H.264 Codec. [J]. Proceedings of the Society of Photo-optical Instrumentation Engineers (SPIE). 2003-09.
    [35] Chang-sung Kim, Hsuan-Huei Shih and C.-C. Jay Kuo. Feature-based Intra-prediction mode decision for H.264. [A]. IEEE International Conference on Image Processing (ICIP). 2004-10.
    [36] Chun-Lung Hsu, Mean-Hom Ho, and Jian-Jyun Hong. An Efficient Algorithm for Intra-Prediction in H.264. [J]. IEEE Trans. Circuits Syst. Video Technology. 2006.
    [37] Chun Chen, Linjian Mo, Jiajun Bu, Shuiyong Lou, Zhi Yang. A Novel Fast Predictive Mode Decision Algorithm for H.264. [J]. IEEE Trans. Circuits Syst. Video Technology. 2005.
    [38] F. Pon. X. Lin. S Ko/iordja. K. P. Liin. Z. G. Li. D. Wzi. S. Wti. Fast Intra Mode Decision Algorithm for H.264/AVC Video Coding. [J]. International Conference on ImageProcessing (ICIP). 2004.
    [39] Chun-Ling YANG, Lai-Man PO, Wing-Hong LAM. A Fast H.264 Intra Prediction Algorithm Using Macroblock Properties. [J]. International Conference on Image Processing (ICIP). 2004.
    [40] Meng, B., Au, O.C. Fast intra-prediction mode selection for 4x4 blocks in H.264. [J]. Proc. of IEEE Int. Conf. on Acoustics, Speech, and Signal. 2003-04.
    [41] Meng, B., Au, O.C. Chi-Wah Wong, Hong-Kwai Lam. Efficient intra-prediction mode selection for 4x4 blocks in H.264. [J]. Proc. of Int. Conf. on Multimedia and Expo. 2003-07.
    [42] Feng PAN, Xiao LIN, Rahardja SUSANTO, Keng Pang LIM, Zheng Guo LI, Ge Nan FENG, Da Jun WU, and Si WU. Fast Mode Decision for Intra Prediction. [J]. JVT-G013, 7th Meeting, Pattaya II, Thailand. 2003-03.
    [43] 李世平. Intel CPU 发展历程和多媒体指令集. [Z]. http://lspbeyond.go1.icpcn.com. 2006-08-02.
    [44] 朱金秀,辛宇,曹宁. 基于 MMX 技术的 H.264 编码器的研究与实现. [J]. 计算机工程与设计. 第27 卷,第 19 期. 2006-10.
    [45] 张剑. 基于 MMX 技术的 SIMD 并行运算优化算法. [J]. 传感技术学报. 第 18 卷,第 4 期. 2005-12.
    [46] 李春林,李国兵. 基于 PC 的 SIMD 技术在 1/4 象素精度运动预测中的应用. [J]. 重庆邮电学院学报. 第 17 卷,第 1 期. 2005-02.
    [47] 朱林,冯燕. 基于单指令多数据技术的 H.264 编码优化. [J]. 计算机应用. 第 25 卷,第 12 期. 2005-12.
    [48] 魏芳,李学明. H.264 中变换和量化的 SIMD 优化. [J]. 计算机工程与应用. 第 17 期. 2004.
    [49] 侯金亭. H.264/AVC 编码器子象素插值快速实现方法. [J]. 计算机工程与应用. 第 33 期. 2006.
    [50] Yong-Hwan Kim, Jin-Woo Yoo, Seong-Won Lee, Joonki Paik, Byeongho Choi. Optimization of H.264 Encoder Using Adaptive Mode Decision and SIMD Instructions. [J]. International Conference on Image Processing (ICIP). 2005.
    [51] Hyunchang Im, Wonchul Lee, Wonyong Sung. Implementation of an H.264 Motion Estimation Algorithm on a VLIW Programmable Digital Signal Processor. [J]. International Conference on Image Processing (ICIP). 2005.
    [52] 李杰. H.264 解码器的 DSP 移植及优化. [D]. 华侨大学. 2005.
    [53] 朱晓东. H.264 视频编码标准中帧间预测算法研究与 DSP 实现. [D]. 合肥工业大学. 2005.
    [54] 于培松. 基于 BLACKFIN533 的 H.264/AVC 视频编码研究. [D]. 西安电子科技大学. 2005.
    [55] Equator Technologies, Inc. Introduction to Programming the MAP-CA Digital Signal Processor. [Z]. http://www.pixelworks.com. 2001-08-01.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700