Skip to content

Commit a25dfe2

Browse files
authored
Add specification for cl_ext_image_raw10_raw12 (#919)
* Add specification for cl_ext_image_raw10_raw12 Change-Id: I5aa9e6f289e4326a35df75fb245f0a628149de87 Signed-off-by: Kevin Petit <kevin.petit@arm.com> * Update extensions/cl_ext_image_raw10_raw12.asciidoc --------- Signed-off-by: Kevin Petit <kevin.petit@arm.com>
1 parent 94dc220 commit a25dfe2

2 files changed

Lines changed: 284 additions & 1 deletion

File tree

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
// Copyright 2018-2023 The Khronos Group. This work is licensed under a
2+
// Creative Commons Attribution 4.0 International License; see
3+
// http://creativecommons.org/licenses/by/4.0/
4+
5+
:data-uri:
6+
:icons: font
7+
include::../config/attribs.txt[]
8+
include::{generated}/api/api-dictionary-no-links.asciidoc[]
9+
:source-highlighter: coderay
10+
11+
= cl_ext_image_raw10_raw12
12+
:R: pass:q,r[^(R)^]
13+
Khronos{R} OpenCL Working Group
14+
15+
== Name Strings
16+
17+
`cl_ext_image_raw10_raw12`
18+
19+
== Contact
20+
21+
Please see the *Issues* list in the Khronos *OpenCL-Docs* repository: +
22+
https://github.com/KhronosGroup/OpenCL-Docs
23+
24+
== Contributors
25+
26+
Kevin Petit, Arm Ltd. +
27+
Jeremy Kemp, Google +
28+
29+
== Notice
30+
31+
include::../copyrights.txt[]
32+
33+
== Status
34+
35+
Complete.
36+
37+
== Version
38+
39+
Built On: {docdate} +
40+
Version: 1.0.0
41+
42+
== Dependencies
43+
44+
This extension is written against the OpenCL Specification version 3.0.14.
45+
46+
This extension requires OpenCL 1.2.
47+
48+
== Overview
49+
50+
This extension adds support for single channel RAW10 and RAW12 images typically
51+
used to represent Bayer pattern images coming from an image sensor.
52+
53+
== New API Enums
54+
55+
New values for `cl_channel_type`:
56+
57+
[source,c]
58+
----
59+
CL_UNSIGNED_INT_RAW10_EXT 0x10E3
60+
CL_UNSIGNED_INT_RAW12_EXT 0x10E4
61+
----
62+
63+
== New OpenCL C Feature Names
64+
65+
[source,c]
66+
----
67+
__opencl_c_ext_image_raw10_raw12
68+
----
69+
70+
== New OpenCL C Enums
71+
72+
Value returned by `get_image_channel_data_type`:
73+
74+
[source,c]
75+
----
76+
CLK_UNSIGNED_INT_RAW10_EXT
77+
CLK_UNSIGNED_INT_RAW12_EXT
78+
----
79+
80+
== Modifications to the OpenCL API Specification
81+
82+
(Modify Section 5.3.1, *Creating Image Objects*) ::
83+
+
84+
--
85+
86+
(Add the following to Table 17, _List of supported Image Channel Data Types_) ::
87+
+
88+
--
89+
90+
[cols="1,1",options="header"]
91+
|====
92+
| Image Channel Data Type
93+
| Description
94+
95+
| {CL_UNSIGNED_INT_RAW10_EXT}
96+
| Each channel component is an unnormalized unsigned 10-bit integer value.
97+
The channel order must be {CL_R}.
98+
99+
| {CL_UNSIGNED_INT_RAW12_EXT}
100+
| Each channel component is an unnormalized unsigned 12-bit integer value.
101+
The channel order must be {CL_R}.
102+
103+
|====
104+
105+
--
106+
107+
(Add the following to Section 5.3.1.1, _Image Format Descriptor_) ::
108+
+
109+
--
110+
If `image_channel_data_type` = {CL_UNSIGNED_INT_RAW10_EXT}, pixel data is densely
111+
packed in each row and each 4 consecutive pixels are packed into 5 bytes. Each one
112+
of the first 4 bytes contains the top 8 bits of each pixel, the fifth byte
113+
contains the 2 least significant bits of the 4 pixels. The memory layout of
114+
this image format is described below (`Pi[j]` stands for the jth bit of the
115+
ith pixel):
116+
117+
[cols="9*1",options="header"]
118+
|====
119+
|
120+
| bit 7
121+
| bit 6
122+
| bit 5
123+
| bit 4
124+
| bit 3
125+
| bit 2
126+
| bit 1
127+
| bit 0
128+
129+
| Byte 0
130+
| P0[9]
131+
| P0[8]
132+
| P0[7]
133+
| P0[6]
134+
| P0[5]
135+
| P0[4]
136+
| P0[3]
137+
| P0[2]
138+
139+
| Byte 1
140+
| P1[9]
141+
| P1[8]
142+
| P1[7]
143+
| P1[6]
144+
| P1[5]
145+
| P1[4]
146+
| P1[3]
147+
| P1[2]
148+
149+
| Byte 2
150+
| P2[9]
151+
| P2[8]
152+
| P2[7]
153+
| P2[6]
154+
| P2[5]
155+
| P2[4]
156+
| P2[3]
157+
| P2[2]
158+
159+
| Byte 3
160+
| P3[9]
161+
| P3[8]
162+
| P3[7]
163+
| P3[6]
164+
| P3[5]
165+
| P3[4]
166+
| P3[3]
167+
| P3[2]
168+
169+
| Byte 4
170+
| P3[1]
171+
| P3[0]
172+
| P2[1]
173+
| P2[0]
174+
| P1[1]
175+
| P1[0]
176+
| P0[1]
177+
| P0[0]
178+
179+
|====
180+
181+
If `image_channel_data_type` = {CL_UNSIGNED_INT_RAW12_EXT}, pixel data is densely
182+
packed in each row and each 2 consecutive pixels are packed into 3 bytes. The
183+
first and second byte contains the top 8 bits of first and second pixel. The
184+
third byte contains the 4 least significant bits of the two pixels, the memory
185+
layout of this image format is described below (`Pi[j]` stands for the jth bit
186+
of the ith pixel):
187+
188+
[cols="9*1",options="header"]
189+
|====
190+
|
191+
| bit 7
192+
| bit 6
193+
| bit 5
194+
| bit 4
195+
| bit 3
196+
| bit 2
197+
| bit 1
198+
| bit 0
199+
200+
| Byte 0
201+
| P0[11]
202+
| P0[10]
203+
| P0[9]
204+
| P0[8]
205+
| P0[7]
206+
| P0[6]
207+
| P0[5]
208+
| P0[4]
209+
210+
| Byte 1
211+
| P1[11]
212+
| P1[10]
213+
| P1[9]
214+
| P1[8]
215+
| P1[7]
216+
| P1[6]
217+
| P1[5]
218+
| P1[4]
219+
220+
| Byte 2
221+
| P1[3]
222+
| P1[2]
223+
| P1[1]
224+
| P1[0]
225+
| P0[3]
226+
| P0[2]
227+
| P0[1]
228+
| P0[0]
229+
|====
230+
--
231+
232+
(Modify Section 5.3.1.2, _Image Descriptor_) ::
233+
+
234+
--
235+
Add the following to the description of `image_width`:
236+
237+
The image width must be a multiple of 4 for images `image_channel_data_type`
238+
is {CL_UNSIGNED_INT_RAW10_EXT}. The image width must be a multiple of 2 for
239+
images `image_channel_data_type` is {CL_UNSIGNED_INT_RAW12_EXT}.
240+
--
241+
242+
--
243+
244+
== Modifications to the OpenCL C Specification
245+
246+
(Modify section 6.15.15.5, *Built-in Image Query Functions*) ::
247+
+
248+
--
249+
250+
Add the following definitions to the list of valid values that can be
251+
returned by the `get_image_channel_data_type` functions:
252+
253+
[source,c]
254+
----
255+
CLK_UNSIGNED_INT_RAW10_EXT
256+
CLK_UNSIGNED_INT_RAW12_EXT
257+
----
258+
--
259+
260+
== Conformance tests
261+
262+
. Extend all image conformance tests to cover the new formats.
263+
264+
== Issues
265+
266+
None.
267+
268+
== Version History
269+
270+
[cols="5,15,15,70"]
271+
[grid="rows"]
272+
[options="header"]
273+
|====
274+
| Version | Date | Author | Changes
275+
| 1.0.0 | 2023-05-03 | Kevin Petit | *Initial revision*
276+
|====

xml/cl.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,8 @@ server's OpenCL/api-docs repository.
15741574
<enum value="0x10DF" name="CL_UNORM_INT24"/>
15751575
<enum value="0x10E0" name="CL_UNORM_INT_101010_2"/>
15761576
<unused start="0x10E1" end="0x10E2" comment="Reserved for cl_ext_yuv_images #722"/>
1577-
<unused start="0x10E3" end="0x10E4" comment="Reserved for cl_ext_image_raw10_raw12 #919"/>
1577+
<enum value="0x10E3" name="CL_UNSIGNED_INT_RAW10_EXT"/>
1578+
<enum value="0x10E4" name="CL_UNSIGNED_INT_RAW12_EXT"/>
15781579
<unused start="0x10E5" end="0x10EF" comment="Reserved for cl_channel_type"/>
15791580
<enum value="0x10F0" name="CL_MEM_OBJECT_BUFFER"/>
15801581
<enum value="0x10F1" name="CL_MEM_OBJECT_IMAGE2D"/>
@@ -7308,5 +7309,11 @@ server's OpenCL/api-docs repository.
73087309
<command name="clRemapCommandBufferKHR"/>
73097310
</require>
73107311
</extension>
7312+
<extension name="cl_ext_image_raw10_raw12" supported="opencl">
7313+
<require comment="cl_channel_type">
7314+
<enum name="CL_UNSIGNED_INT_RAW10_EXT"/>
7315+
<enum name="CL_UNSIGNED_INT_RAW12_EXT"/>
7316+
</require>
7317+
</extension>
73117318
</extensions>
73127319
</registry>

0 commit comments

Comments
 (0)