📄 jpeg 编解码在 cell 上的优化.htm
字号:
alt=表1:JPEG编码在一个SPU上的性能 src="JPEG 编解码在 Cell 上的优化.files/table1.gif"
width=553 border=0> <BR><BR><A
name=N10265><B>表2:JPEG解码在一个SPU上的性能</B></A><BR><IMG height=201
alt=表2:JPEG解码在一个SPU上的性能 src="JPEG 编解码在 Cell 上的优化.files/table2.gif"
width=554 border=0> <BR>
<P>*:图片使用的是EEMBC bechmark中的测试图片,每秒帧数也是由EEMBC bechmark测得(参见参考资料)。</P>
<P>由两个表格结果可以看出,优化后的cycle分布是比较合理的,dual cycle在20%左右,branch
miss在10%左右,dependency在20%左右,channel
stall控制在3%之内。各个cycel的分布和程序本身的算法比较相关,通过上面的两个表格可以看出,JPEG解码过程中的dependency
cycel较高,这与解码算法中数据之间依赖性很大有关。Intel在其官方的IPP性能测试白皮书(参见 <A
href="http://www.ibm.com/developerworks/cn/linux/l-cn-celljpegopt/#resources">参考资料</A>)中提到了JPEG编解码的速度,可以看出,一个SPU的性能可以与一个intel的P4相当。一个Cell芯片有8个SPU,并行处理数据的话,可以达到P4速度的8倍。</P><BR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><IMG height=1 alt=""
src="JPEG 编解码在 Cell 上的优化.files/blue_rule.gif"
width="100%"><BR><IMG height=6 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width=8
border=0></TD></TR></TBODY></TABLE>
<TABLE class=no-print cellSpacing=0 cellPadding=0 align=right>
<TBODY>
<TR align=right>
<TD><IMG height=4 alt="" src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width="100%"><BR>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=center><IMG height=16 alt=""
src="JPEG 编解码在 Cell 上的优化.files/u_bold.gif" width=16
border=0><BR></TD>
<TD vAlign=top align=right><A class=fbox
href="http://www.ibm.com/developerworks/cn/linux/l-cn-celljpegopt/#main"><B>回页首</B></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR>
<P><A name=N1027F><SPAN class=atitle>结束语</SPAN></A></P>
<P>通过对于JPEG编解码在Cell上优化,我们发现这个独特的CPU的确具有很好的性能。这种异构的CPU使得资源调配的空间变大,我们可以利用一个SPU来做JPEG编解码,同时用另外的SPU来做别的计算处理工作。独特的SPU架构使得程序员有很大的空间来做性能的优化,充分发挥SIMD的优势。随着Cell上相应编程工具、编程框架、性能检测工具、和编译器的完善和改进,Cell上的编程和优化工作会更加简单和高效。</P><BR><BR>
<P><A name=resources><SPAN class=atitle>参考资料 </SPAN></A></P>
<UL>
<LI>在这个 <A href="http://www.ijg.org/files/">网页</A>
上可以找到开源的JPEG编解码源代码,文件名为jpegsrc.v6b.tar.gz。<BR><BR>
<LI>关于JPEG编解码的原理,可以参考 <A
href="http://en.wikipedia.org/wiki/JPEG">wikipedia上的JPEG介绍</A>。<BR><BR>
<LI>Cell上使用mambo测试性能的步骤,可以参考文章 “<A
href="http://www.ibm.com/developerworks/cn/linux/l-cn-cellprogramming/index.html">Cell
编程登堂入室</A>”。<BR><BR>
<LI>有关 Cell BE 处理器本身的权威性信息资源,可参考 <A
href="http://www.ibm.com/chips/techlib/techlib.nsf/techdocs/9F820A5FFA3ECE8C8725716A0062585F">Cell
BE Handbook</A>。<BR><BR>
<LI><A href="http://www.eembc.org/">EEMBC bechmark</A>
网站上还有其他平台的JPEG编解码的benchmark数据。<BR><BR>
<LI>Intel IPP库的JPEG编解码的benchmark数据,可以参见白皮书 “<A
href="http://cache-www.intel.com/cd/00/00/21/93/219360_wp_ipp_benchmark.pdf">Performance
Benchmarks for Intel Integrated Performance
Primitives</A>”。<BR><BR>
<LI>其他的一些Cell行优化应用程序的技巧,可以参见 <A
href="http://www.ibm.com/developerworks/power/library/pa-celltips1/">Maximizing
the power of the Cell Broadband Engine processor: 25 tips to
optimal application performance</A>。<BR><BR>
<LI>关于Cell编程相关的问题,可以在 <A
href="http://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=739&cat=46">Cell
Broadband Engine Architecture forum</A> 上提问。<BR><BR>
<LI>Cell 技术中心:<A
href="http://www.alphaworks.ibm.com/topics/cell">http://www.alphaworks.ibm.com/topics/cell</A>
<BR><BR>
<LI>Software Development Kit 2.0 Installation Guide:<A
href="http://www-1.ibm.com/support/docview.wss?uid=psg1MIGR-65726">http://www-1.ibm.com/support/docview.wss?uid=psg1MIGR-65726</A>
<BR><BR>
<LI>CBE Programming Tutorial:<A
href="http://www.ibm.com/chips/techlib/techlib.nsf/techdocs/FC857AE550F7EB83872571A80061F788">http://www.ibm.com/chips/techlib/techlib.nsf/techdocs/FC857AE550F7EB83872571A80061F788</A>
<BR><BR>
<LI>developerWorks 中国网站 <A
href="http://www.ibm.com/developerworks/cn/linux/">Linux 技术专区</A>
<BR><BR>
<LI>developerWorks 中国网站 <A
href="http://www.ibm.com/developerworks/cn/power/">Power
Architecture 技术专区</A> <BR></LI></UL><BR><BR>
<P><A name=author><SPAN class=atitle>作者简介</SPAN></A></P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD colSpan=3><IMG height=5 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width="100%"></TD></TR>
<TR vAlign=top align=left>
<TD>
<P></P></TD>
<TD><IMG height=5 alt="" src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width=4></TD>
<TD width="100%">
<P>魏琼,IBM 中国软件开发中心,CETI 部门软件工程师,从事 cell blade server
上的应用库向量化编程工作,喜爱 Linux,精通 Linux 上的 C
编程。</P></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD colSpan=3><IMG height=5 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width="100%"></TD></TR>
<TR vAlign=top align=left>
<TD>
<P></P></TD>
<TD><IMG height=5 alt="" src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width=4></TD>
<TD width="100%">
<P>龚志刚,IBM 中国软件开发中心,CETI 高级软件工程师。主要从事 Cell 芯片上的程序开发与优化,以及 Cell
芯片技术在中国的推广工作。</P></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD colSpan=3><IMG height=5 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width="100%"></TD></TR>
<TR vAlign=top align=left>
<TD>
<P></P></TD>
<TD><IMG height=5 alt="" src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width=4></TD>
<TD width="100%">
<P>王佰玲,IBM 中国软件开发中心,CETI 高级软件工程师。主要从事 Cell
芯片相关研发工作。</P></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD colSpan=3><IMG height=5 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width="100%"></TD></TR>
<TR vAlign=top align=left>
<TD>
<P></P></TD>
<TD><IMG height=5 alt="" src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width=4></TD>
<TD width="100%">
<P>潘家铭,IBM 中国软件开发中心,CETI 软件工程师。主要从事 Cell
芯片上的软件开发工作。</P></TD></TR></TBODY></TABLE><BR><BR><BR>
<P class=no-print><SPAN class=atitle><A
name=rate>对本文的评价</A></SPAN></P><SPAN class=no-print>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD>
<FORM
action=https://www.ibm.com/developerworks/secure/cnratings.jsp
method=get><INPUT type=hidden value="JPEG 编解码在 Cell 上的优化"
name=ArticleTitle><INPUT type=hidden value=Linux
name=Zone><INPUT type=hidden
value=http://www.ibm.com/developerworks/cn/thankyou/
name=RedirectURL><INPUT type=hidden value=china
name=localsite>
<SCRIPT language=javascript>document.write('<input type="hidden" name="url" value="'+location.href+'" />');</SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><IMG height=8 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width=100
border=0></TD></TR>
<TR vAlign=top>
<TD><INPUT type=radio value=1 name=Rating>太差! (1)</TD></TR>
<TR vAlign=top>
<TD><INPUT type=radio value=2 name=Rating>需提高 (2)</TD></TR>
<TR vAlign=top>
<TD><INPUT type=radio value=3 name=Rating>一般;尚可
(3)</TD></TR>
<TR vAlign=top>
<TD><INPUT type=radio value=4 name=Rating>好文章 (4)</TD></TR>
<TR vAlign=top>
<TD><INPUT type=radio value=5
name=Rating>真棒!(5)</TD></TR></TBODY></TABLE><BR><B>建议?</B><BR><TEXTAREA id=Comments name=Comments rows=5 wrap=virtual cols=60> </TEXTAREA><BR><BR><INPUT type=submit value=反馈意见></FORM></TD></TR>
<TR vAlign=top>
<TD bgColor=#ffffff><IMG height=8 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif" width=100
border=0></TD></TR></TBODY></TABLE></SPAN><SPAN class=no-print>
<TABLE cellSpacing=0 cellPadding=0 align=right>
<TBODY>
<TR align=right>
<TD><IMG height=8 alt="" src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width="100%"><BR>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=center><IMG height=16 alt=""
src="JPEG 编解码在 Cell 上的优化.files/u_bold.gif" width=16
border=0><BR></TD>
<TD vAlign=top align=right><A class=fbox
href="http://www.ibm.com/developerworks/cn/linux/l-cn-celljpegopt/#main"><B>回页首</B></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR></SPAN></TD>
<TD width=10><IMG height=1 alt=""
src="JPEG 编解码在 Cell 上的优化.files/c.gif"
width=10></TD></TR></TBODY></TABLE><SPAN class=small>IBM 公司保留在
developerWorks 网站上发表的内容的著作权。未经IBM公司或原始作者的书面明确许可,请勿转载。如果您希望转载,请通过 <A
href="https://www.ibm.com/developerworks/secure/reprintreq.jsp?domain=dwchina">提交转载请求表单</A>
联系我们的编辑团队。</SPAN></TD></TR></TBODY></TABLE><!--FOOTER_BEGIN--><!-- IBM FOOTER -->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=bbg height=19>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><SPAN class=spacer> </SPAN><A
class=mainlink href="http://www.ibm.com/cn/ibm/index.shtml">关于
IBM</A></TD>
<TD class=footer-divider width=27> </TD>
<TD><A class=mainlink
href="http://www.ibm.com/cn/ibm/privacy/index.shtml">隐私条约</A></TD>
<TD class=footer-divider width=27> </TD>
<TD><A class=mainlink href="http://www.ibm.com/contact/cn/">联系
IBM</A></TD>
<TD class=footer-divider width=27> </TD>
<TD><A class=mainlink
href="http://www.ibm.com/legal/cn/zh/">使用条款</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!-- end footer -->
<SCRIPT language=JavaScript1.2 src="JPEG 编解码在 Cell 上的优化.files/stats.js"
type=text/javascript></SCRIPT>
<NOSCRIPT><IMG height=1 alt="" src="H:\JPEG 编解码在 Cell 上的优化.files\c(1).gif"
width=1 border=0></NOSCRIPT><!--FOOTER_END--><!--XSLT stylesheet used to transform this file: dw-document-html-5.8.xsl--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -