图形图像处理-之-高质量的快速的图像缩放 补充 使用SSE2优化.docxVIP

  • 15
  • 0
  • 约1.22万字
  • 约 11页
  • 2022-06-29 发布于上海
  • 举报

图形图像处理-之-高质量的快速的图像缩放 补充 使用SSE2优化.docx

图形图像处理-之-高质量的快速的图像缩放 补充 使用 SSE2 优化 HouSisong@GM 2011.04.12 值,SSE2,scale,bilinear,bicubic,StretchBlttag: 图像缩放,速度优化,线性插值,三次卷积插 值,SSE2,scale,bilinear,bicubic,StretchBlt 摘要: 使用了 SSE2 的 128bit 使用了 SSE2 的 128bit 寄存器及相关指令;并预先建立 SSE2 用到的缩放系数表; 实现的结果在我的 实现的结果在我的 i7 电脑上比以前的版本分别快出 145%和 75%! 线性插值的速度是 StretchBlt 的 13 倍! 正文: (请先看看我的 blog 里高质量的快速的图像缩放的前 3 篇文章!) 少),支持 SSE2 指令集的 CPU 越来越多,CPU 的 SSE2 实现性能也好了很多(以前不比 MMX 好多 少), 而且软件在 而且软件在 64 位模式的时候不再支持 MMX,所以尝试了 SSE2 的缩放优化,效果不错! 只测试内存数据到内存数据的缩放测试图片都是800*600 只测试内存数据到内存数据的缩放 测试图片都是800*600 缩放到 1024*768,单线程;fps 表示每秒钟的帧数,值越大表示 函数越快. 速度测试对比: (CPU:i7 920 内存:DDR3 1333 3 通道) (windows) (windows) StretchBlt 近邻取样 869.09 fps StretchBlt 线性插值44.46 fps StretchBlt 线性插值 44.46 fps //SetStretchBltMode(dc,4);? PicZoom0: 95.69 fps PicZoom1: 158.35 fps PicZoom2: 332.78 fps PicZoom3: 1172.79 fps PicZoom3_float: 874.13 fps PicZoom3_Table: 1158.30 fps PicZoom3_SSE: 1908.40 fps PicZoom_Bilinear0: 28.80 fps PicZoom_Bilinear1: 56.09 fps PicZoom_Bilinear2: 97.09 fps PicZoom_Bilinear_Common: 119.83 fps PicZoom_Bilinear_MMX: 180.12 fps PicZoom_Bilinear_MMX_Ex: 237.34 fps PicZoom_ftBilinear_Common: 118.67 fps PicZoom_ftBilinear_MMX: 213.68 fps PicZoom_ThreeOrder0: 6.11 fps PicZoom_ThreeOrder_Common: 25.38 fps PicZoom_ThreeOrder_MMX: 52.32 fps (SSE2 的实现) PicZoom_ftBilinearTable_SSE2: 588.24 fps PicZoom_ThreeOrderTable_SSE2: 93.24 fps PicZoom_ftBilinearTable_SSE2 实现代码如下: typedef UInt64 typedef UInt64 TMMXData64; //ftBilinearTable_SSE2(out [edi+ebx*4]; xmm5=v,xmm6=vr,xmm7=0,[ebp]=( u,ur),[edx]=srx_x,esi=PSrcLineColor,ecx=PSrcLineColorNext) 19. 20. 21. 22. 23. //ret //for declspec(naked) //} //} //void declspec(naked) ftBilinearTable_SSE2_expand2(){ #define ftBilinearTable_SSE2_expand2() / view plain view plain 3. //void declspec(naked) ftBilinearTable_SSE2(){ 4. #define ftBilinearTable_SSE2() / 5. asm mov eax,[edx+ebx] / 6. asm movq xmm0,qword ptr[esi+eax*4] / 7. asm movq xmm1,qword ptr[ecx+eax*4] / 8. asm punpcklbw xmm0,xmm7 / 9. asm punpcklbw xmm1,xmm

文档评论(0)

1亿VIP精品文档

相关文档