OpenCL™规范 5.3.3.1. DirectX 9媒体表面共享的图像格式

5.3.3.1. Image Formats for DirectX 9 Media Surface Sharing
5.3.3.1. DirectX 9媒体表面共享的图像格式

When the cl_khr_dx9_media_sharing extension is supported, image objects sharing storage with Direct3D 9 surfaces can be created. This section describes the Direct3D 9 surface formats that are supported when the adapter type is one of the Direct 3D lineage. Using a Direct3D 9 surface format not listed here is an error. To extend the use of this extension to support media adapters beyond DirectX 9 tables similar to the ones in this section will need to be defined for the surface formats supported by the new media adapter. All implementations that support this extension are required to support the NV12 surface format. The other surface formats supported are the same surface formats that the adapter you are sharing with supports as long as they are listed in the YUV FourCC Codes and Corresponding OpenCL Image Formats or Direct3D 9 Formats and Corresponding OpenCL Image Formats tables.

​当支持cl_khr_dx9_media_sharing扩展时,可以创建与Direct3D 9表面共享存储的图像对象。本节介绍适配器类型为Direct 3D沿袭时支持的Direct3D 9表面格式。使用此处未列出的Direct3D 9表面格式是错误的。要将此扩展的使用扩展到支持DirectX 9以外的介质适配器,需要为新介质适配器支持的表面格式定义与本节中的表类似的表。所有支持此扩展的实现都需要支持NV12表面格式。支持的其他表面格式与共享的适配器支持的表面格式相同,只要它们列在YUV FourCC代码和相应的OpenCL图像格式或Direct3D 9格式和相应的OpenCL图像格式表中即可。

Table 31. YUV FourCC Codes and Corresponding OpenCL Image Formats

表31 YUV FourCC码及相应的OpenCL图像格式

FOUR CC Code

CL Image Format (Channel Order, Channel Data Type)

CL图像格式(通道顺序、通道数据类型)

FOURCC('N','V','1','2'), Plane 0

CL_RCL_UNORM_INT8

FOURCC('N','V','1','2'), Plane 1

CL_RGCL_UNORM_INT8

FOURCC('Y','V','1','2'), Plane 0

CL_RCL_UNORM_INT8

FOURCC('Y','V','1','2'), Plane 1

CL_RCL_UNORM_INT8

FOURCC('Y','V','1','2'), Plane 2

CL_RCL_UNORM_INT8

In the YUV FourCC Codes and Corresponding OpenCL Image Formats table, NV12 Plane 0 corresponds to the luminance (Y) channel and Plane 1 corresponds to the UV channels. The YV12 Plane 0 corresponds to the Y channel, Plane 1 corresponds to the V channel and Plane 2 corresponds to the U channel. Note that the YUV formats map to CL_R and CL_RG but do not perform any YUV to RGB conversion, and vice-versa.

​在YUV FourCC码和相应的OpenCL图像格式表中,NV12平面0对应于亮度(Y)通道,平面1对应于UV通道。YV12平面0对应于Y通道,平面1对应于V通道,平面2对应于U通道。注意,YUV格式映射到CL_R和CL_RG,但不执行任何YUV到RGB的转换,反之亦然。

Table 32. Direct3D 9 Formats and Corresponding OpenCL Image Formats

表32 Direct3D9格式和相应的OpenCL图像格式

Direct3D 9 Format

Direct3D 9格式

CL Image Format (Channel Order, Channel Data Type)

CL图像格式(通道顺序、通道数据类型)

D3DFMT_R32F

CL_RCL_FLOAT

D3DFMT_R16F

CL_RCL_HALF_FLOAT

D3DFMT_L16

CL_RCL_UNORM_INT16

D3DFMT_A8

CL_ACL_UNORM_INT8

D3DFMT_L8

CL_RCL_UNORM_INT8

D3DFMT_G32R32F

CL_RGCL_FLOAT

D3DFMT_G16R16F

CL_RGCL_HALF_FLOAT

D3DFMT_G16R16

CL_RGCL_UNORM_INT16

D3DFMT_A8L8

CL_RGCL_UNORM_INT8

D3DFMT_A32B32G32R32F

CL_RGBACL_FLOAT

D3DFMT_A16B16G16R16F

CL_RGBACL_HALF_FLOAT

D3DFMT_A16B16G16R16

CL_RGBACL_UNORM_INT16

D3DFMT_A8B8G8R8

CL_RGBACL_UNORM_INT8

D3DFMT_X8B8G8R8

CL_RGBACL_UNORM_INT8

D3DFMT_A8R8G8B8

CL_BGRACL_UNORM_INT8

D3DFMT_X8R8G8B8

CL_BGRACL_UNORM_INT8

The Direct3D 9 format names in the table above seem to imply that the order of the color channels are switched relative to OpenCL, but this is not the case. For example, the layout of channels for each pixel for D3DFMT_A32FB32FG32FR32F is the same as CL_RGBACL_FLOAT.


上表中的Direct3D 9格式名称似乎意味着颜色通道的顺序是相对于OpenCL切换的,但事实并非如此。例如,D3DFMT_A22FB32FG32FR32F的每个像素的通道布局与CL_RGBA、CL_FLOAT相同。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值