Chinaunix首页 | 论坛 | 博客
  • 博客访问: 980713
  • 博文数量: 153
  • 博客积分: 4195
  • 博客等级: 上校
  • 技术积分: 2631
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-22 11:32
文章存档

2012年(7)

2010年(35)

2009年(111)

分类:

2010-03-16 09:45:19

关于2D图形加速引擎的详细报告

leeming

 

根据会议总结,对2D加速引擎继续深入调研,主要关注的方面有两大类:1.需要的功能(包括是否支持openVG2.性能评估。

 

1.    需要的功能:

首先,比较一下几个常见的高端soc芯片中对2D加速引擎的功能:

注:此处仅列出2D加速特性,其他的一些通用特性(如对颜色格式的支持,local buffer不列出)

 

Marvell公司的PXA3xx系列:

Line draw:画线(线宽可变)

Anti-aliased line draw:绘制锯齿线(线宽可变)

Color fill:为目标矩形填充颜色

Chroma key stretch BLT

Rotate BLT

Raster OP BLT (serves as source copy BLT)

Pattern copy BLT

Alpha blend BLT

Scale BLT

Bias BLT

Chroma key BLT

Stretch BLT

Decimate BLT

可以看到它的加速功能主要包括绘制直线、填充矩形、及各类BLT操作(矩形区域的缩放、旋转、复制和Alpha混合)。这是一款为图形窗口操作量身定制的硬件图形加速器。

 

三星公司的6410处理器:

6410使用的2D加速引擎为FIMG-2D

•画点画线

bitblt(位区块传输)

•彩色扩展(文本绘图)

•角度旋转(90度,180度,270度,x轴,y轴)

Alpha Blending

 

Telechips公司的TCC 8900处理器:

采用了arm公司的Mali 200 GPU.是一个2D/3D引擎。兼容OpenGL ES 2.0  OpenGL ES 1.1 OpenVG 1.0等图像标准。Tcc 8900的图形引擎特性包括像素处理器和几何处理器两大部分:

The pixel processor features are:

z  Programmable fragment shader

z  Access to framebuffer from fragment shaders

z  Alpha blending

z  Arbitrary memory reads and writes

z  Complete non-power-of-2 texture support

z  Cube mapping

z  Dynamic recursion

z  Fast dynamic branching

z  Fast trigonometric functions, including arctangent

z  Full floating-point arithmetic

z  Framebuffer blend with destination Alpha

z  High Dynamic Range (HDR) textures and framebuffers

z  Indexable texture samplers

z  Line, quad, triangle and point sprites

z  Multiple render targets

z  No limit on program length

z  Perspective Anisotropic Filtering (AF)

z  Perspective correct texturing

z  Point sampling, bilinear, and trilinear filtering

z  Programmable mipmap level-of-detail biasing and replacement

z  Register indirect jumps

z  Stencil buffering, 8-bit

z  Two-sided stencil

z  Unlimited dependent texture reads

z  Virtualized texture samplers

z  4-level hierarchical Z and stencil operations

z  4 times and 16 times Full Scene Anti-Aliasing (FSAA)

z  4-bit per texel texture compression

 

The geometry processor features are:

z  Programmable vertex shader

z  Autonomous operation tile list generation

z  Flexible input and output formats

z  Indexed and non-indexed geometry input

z  Primitive constructions with points, lines, triangles and quads.

Mali-200GPU具有一个可编程的渲染管线(shaderpipeline)、市场上最高的Alpha-blended(α混合)像素填充率效率、无需额外带宽的全屏抗锯齿功能,以及无层数限制的α混合功能,由于Mali-200是支持2/3D的,所以它的特性中很多事我们所不需要的。

 

单芯片解决方案SM-501

SM-501Sillicon Motion公司推出的一款便携式多媒体协处理器芯片,专门为嵌入式工业提供补充功能,具有视频和2D能力。是现在主流的单芯片2D加速引擎之一。它的主要特性有:

1. BitBlt (from system/local memory to system/local memory) with 256 raster operations. Pattern is selectable between 8x8 monochrome pattern, 8x8 color pattern or another surface located in either system

or local memory.

2. Transparent BitBlt with the same capabilities as the previous command, but only the source or destination can be transparent (either ColorKey or ChromaKey).

3. Alpha BitBlt with a constant alpha value.

4. Rotation BitBlt for any block size. This feature allows high speeds conversion between landscape and portrait display without the need for special software drivers. (90°, 180°, 270°.)

5. YUV to 16-bit/32-bit RGB Blt conversion with 1:216 stretch or 4:1 shrink to provide high speeds video in common format.

6. Auto-wrapping for smooth scrolling support for navigational or other data.

7. Support for tiled memory to optimize performance for 2D operations and rotation.

当然它也支持最基本的画线,图案填充,彩色扩展等功能。

 

结论:通过对上面这些市面主流的2D图形加速引擎的对比分析,我们可以基本认为对于一个2D图形加速引擎它应该具有的功能有:

A.点线的绘制(高级的可以有三角形,四边形,锯齿线等)

B. 彩色扩展,彩色填充,裁减

C. 各类bitblt(缩放,旋转,复制等)

D.Alpha blending

一般的2D加速引擎都不支持Open VG,在调研的四款芯片中只有TCC8900支持,而TCC8900采用了一款2D/3D引擎,对于我们只需要2D引擎没有直接意义,因此基本认为是否支持Open VG只是2D图形加速引擎的一个可选项。

 

2.    性能评估:

2D图形加速性能最基本的指标的每秒完成的图形操作次数。当前PC系统上进行图形性能测试一般有两种性能指标,一种是渲染固定场景所得到的每秒帧数(这种方法适合于3D 性能测试),另一种是绘制固定数目的图形的时间,来得到每秒钟绘制图形的数目。这两种性能指标,其本质都是单位时间内完成的图形操作次数。

 

一般可以通过第二种性能指标,即绘制固定数目的图形的时间来测试。绘制的内容包括:绘制直线,矩形区域的填充、旋转、复制、缩放和Alpha Blending操作。

 

 

以下是pxa300的测试步骤:

1.       性能测试方法:
本次测试选择了计算绘制65536条直线和16384个矩形区域的填充、旋转、复制、缩放和Alpha操作的时间来得到绘制的速度。因为绘制直线的速度比较快,所以绘制直线的数量相比其他操作要多一点,以达到比较好的效果。
为模拟正常应用的情况,利用随机函数来生成各种图形参数,随机函数采用普遍应用的乘线性同余函数。

2.       测试结果与分析

本次测试测试了纯软件加速——即依赖CPU计算的软件绘图和硬件加速进行对比(本次测试只实现了一部分图形指令)。对比软件绘图和硬件绘图的差别,可以发现2D硬件加速器在绘制速度上的优势非常明显,其中绘制直线和绘制矩形比软件加速10倍左右,而复制区域和Alpha混合则比软件加速20倍左右。硬件加速器在绘制图形的时候,只有填充指令这一步是需要CPU来完成的,其余时间CPU都是空闲状态,因此在测试环境下,硬件加速器的CPU占用率是相当低的。

综合以上分析结果,2D图形加速器在计算能力、数据传输速度和CPU占用率上,对比软件加速都存在非常明显的优势。

阅读(8012) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~