1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
|
<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>ARM Compute Library: src/core/CL/cl_kernels/convolution3x3.cl File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">ARM Compute Library
 <span id="projectnumber">17.04</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.xhtml"><span>Main Page</span></a></li>
<li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
<li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
<li class="current"><a href="files.xhtml"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.xhtml"><span>File List</span></a></li>
<li><a href="globals.xhtml"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('convolution3x3_8cl.xhtml','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">convolution3x3.cl File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br />
</div>
<p><a href="convolution3x3_8cl_source.xhtml">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:afb8c72ce35c4a1f4a2588d6573e54aa1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>   short</td></tr>
<tr class="separator:afb8c72ce35c4a1f4a2588d6573e54aa1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac06f3e24d3fffd3c465d8b2a6e7c985e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="convolution3x3_8cl.xhtml#ac06f3e24d3fffd3c465d8b2a6e7c985e">DATA_TYPE_OUT</a>   uchar</td></tr>
<tr class="separator:ac06f3e24d3fffd3c465d8b2a6e7c985e"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a92702074338198e81a46c3e309d9b04f"><td class="memItemLeft" align="right" valign="top">short8 </td><td class="memItemRight" valign="bottom"><a class="el" href="convolution3x3_8cl.xhtml#a92702074338198e81a46c3e309d9b04f">convolution1x3</a> (__global const uchar *left_pixel, const short left_coeff, const short middle_coeff, const short right_coeff)</td></tr>
<tr class="memdesc:a92702074338198e81a46c3e309d9b04f"><td class="mdescLeft"> </td><td class="mdescRight">Compute a 1D horizontal convolution of size 3 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels). <a href="#a92702074338198e81a46c3e309d9b04f">More...</a><br /></td></tr>
<tr class="separator:a92702074338198e81a46c3e309d9b04f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afc5fefe72e66f0ae5191fd5b708fade9"><td class="memItemLeft" align="right" valign="top">short8 </td><td class="memItemRight" valign="bottom"><a class="el" href="convolution3x3_8cl.xhtml#afc5fefe72e66f0ae5191fd5b708fade9">convolution3x3</a> (<a class="el" href="struct_image.xhtml">Image</a> *src, const short mat0, const short mat1, const short mat2, const short mat3, const short mat4, const short mat5, const short mat6, const short mat7, const short mat8, uint scale)</td></tr>
<tr class="memdesc:afc5fefe72e66f0ae5191fd5b708fade9"><td class="mdescLeft"> </td><td class="mdescRight">Apply a 3x3 convolution matrix to a single channel U8 input image and return the result. <a href="#afc5fefe72e66f0ae5191fd5b708fade9">More...</a><br /></td></tr>
<tr class="separator:afc5fefe72e66f0ae5191fd5b708fade9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa0b80492bb4faef0b052d95a8aa147e4"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="convolution3x3_8cl.xhtml#aa0b80492bb4faef0b052d95a8aa147e4">convolution3x3_static</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)</td></tr>
<tr class="memdesc:aa0b80492bb4faef0b052d95a8aa147e4"><td class="mdescLeft"> </td><td class="mdescRight">Apply a 3x3 static convolution matrix to a single channel U8 input image and output a single channel image. <a href="#aa0b80492bb4faef0b052d95a8aa147e4">More...</a><br /></td></tr>
<tr class="separator:aa0b80492bb4faef0b052d95a8aa147e4"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="afb8c72ce35c4a1f4a2588d6573e54aa1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DATA_TYPE   short</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">27</a> of file <a class="el" href="convolution3x3_8cl_source.xhtml">convolution3x3.cl</a>.</p>
<p>Referenced by <a class="el" href="activation__layer_8cl_source.xhtml#l00046">activation_layer()</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00080">bilinear_interpolate()</a>, <a class="el" href="convolution__layer_8cl_source.xhtml#l00175">col2im()</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00043">convolution1x3()</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00082">convolution3x3()</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00123">convolution3x3_static()</a>, <a class="el" href="convolution__rectangle_8cl_source.xhtml#l00064">convolution_rectangle()</a>, <a class="el" href="fill__border_8cl_source.xhtml#l00118">fill_image_borders_constant()</a>, <a class="el" href="fill__border_8cl_source.xhtml#l00044">fill_image_borders_replicate()</a>, <a class="el" href="harris__corners_8cl_source.xhtml#l00138">harris_score_1x5()</a>, <a class="el" href="harris__corners_8cl_source.xhtml#l00253">harris_score_1x7()</a>, <a class="el" href="harris__corners_8cl_source.xhtml#l00053">harris_score_3x3()</a>, <a class="el" href="convolution__layer_8cl_source.xhtml#l00105">im2col_generic()</a>, <a class="el" href="convolution__layer_8cl_source.xhtml#l00208">im2col_reduced()</a>, <a class="el" href="magnitude__phase_8cl_source.xhtml#l00045">magnitude_l2()</a>, <a class="el" href="magnitude__phase_8cl_source.xhtml#l00131">magnitude_phase()</a>, <a class="el" href="minmaxloc_8cl_source.xhtml#l00123">minmaxloc()</a>, <a class="el" href="nonmax_8cl_source.xhtml#l00041">non_max_suppression()</a>, <a class="el" href="normalization__layer_8cl_source.xhtml#l00059">normalization_layer_cross_map()</a>, <a class="el" href="normalization__layer_8cl_source.xhtml#l00124">normalization_layer_in_map()</a>, <a class="el" href="pooling__layer_8cl_source.xhtml#l00064">pooling_layer_2()</a>, <a class="el" href="pooling__layer_8cl_source.xhtml#l00118">pooling_layer_3()</a>, <a class="el" href="warp__helpers_8h_source.xhtml#l00045">read_texels4()</a>, <a class="el" href="convolution__layer_8cl_source.xhtml#l00053">reshape_to_columns()</a>, <a class="el" href="scale_8cl_source.xhtml#l00110">scale_bilinear()</a>, <a class="el" href="scale_8cl_source.xhtml#l00076">scale_nearest_neighbour()</a>, and <a class="el" href="transpose_8cl_source.xhtml#l00145">transpose()</a>.</p>
</div>
</div>
<a class="anchor" id="ac06f3e24d3fffd3c465d8b2a6e7c985e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DATA_TYPE_OUT   uchar</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="convolution3x3_8cl_source.xhtml#l00031">31</a> of file <a class="el" href="convolution3x3_8cl_source.xhtml">convolution3x3.cl</a>.</p>
<p>Referenced by <a class="el" href="absdiff_8cl_source.xhtml#l00050">absdiff()</a>, <a class="el" href="arithmetic__op_8cl_source.xhtml#l00059">arithmetic_add()</a>, <a class="el" href="arithmetic__op_8cl_source.xhtml#l00104">arithmetic_sub()</a>, <a class="el" href="canny_8cl_source.xhtml#l00057">combine_gradients_L1()</a>, <a class="el" href="canny_8cl_source.xhtml#l00121">combine_gradients_L2()</a>, <a class="el" href="depth__convert_8cl_source.xhtml#l00051">convert_depth_down()</a>, <a class="el" href="depth__convert_8cl_source.xhtml#l00085">convert_depth_up()</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00123">convolution3x3_static()</a>, <a class="el" href="convolution__rectangle_8cl_source.xhtml#l00064">convolution_rectangle()</a>, <a class="el" href="pixelwise__mul__float_8cl_source.xhtml#l00061">pixelwise_mul_float()</a>, <a class="el" href="pixelwise__mul__int_8cl_source.xhtml#l00060">pixelwise_mul_int()</a>, and <a class="el" href="canny_8cl_source.xhtml#l00191">suppress_non_maximum()</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a92702074338198e81a46c3e309d9b04f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">short8 convolution1x3 </td>
<td>(</td>
<td class="paramtype">__global const uchar * </td>
<td class="paramname"><em>left_pixel</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>left_coeff</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>middle_coeff</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>right_coeff</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Compute a 1D horizontal convolution of size 3 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">left_pixel</td><td>Pointer to the left pixel. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">left_coeff</td><td>Weight of the left pixel </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">middle_coeff</td><td>Weight of the middle pixel </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">right_coeff</td><td>Weight of the right pixel</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a short8 containing 8 convoluted values. </dd></dl>
<p>Definition at line <a class="el" href="convolution3x3_8cl_source.xhtml#l00043">43</a> of file <a class="el" href="convolution3x3_8cl_source.xhtml">convolution3x3.cl</a>.</p>
<p>References <a class="el" href="helpers_8h_source.xhtml#l00035">CONVERT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p>
<p>Referenced by <a class="el" href="convolution3x3_8cl_source.xhtml#l00082">convolution3x3()</a>, and <a class="el" href="convolution__rectangle_8cl_source.xhtml#l00064">convolution_rectangle()</a>.</p>
<div class="fragment"><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  uchar16 temp = vload16(0, left_pixel);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 8)</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  left = <a class="code" href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(temp.s01234567, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 8));</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8)</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  middle = <a class="code" href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(temp.s12345678, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8));</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8)</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  right = <a class="code" href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(temp.s23456789, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8));</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  return left * (<a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8))left_coeff + middle * (<a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8))middle_coeff + right * (<a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 8))right_coeff;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> }</div><div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_aa8d95ba04fc73845abc6045952cae5be"><div class="ttname"><a href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a></div><div class="ttdeci">#define CONVERT(x, type)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00035">helpers.h:35</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="afc5fefe72e66f0ae5191fd5b708fade9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">short8 convolution3x3 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_image.xhtml">Image</a> * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat3</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat4</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat5</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat6</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat7</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const short </td>
<td class="paramname"><em>mat8</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>scale</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Apply a 3x3 convolution matrix to a single channel U8 input image and return the result. </p>
<p>Convolution matrix layout:</p>
<p>[ mat0, mat1, mat2 ]<br />
[ mat3, mat4, mat5 ]<br />
[ mat6, mat7, mat8 ]<br />
</p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>A pointer to source <a class="el" href="struct_image.xhtml" title="Structure to hold Image information. ">Image</a> structure </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat0</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat1</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat2</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat3</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat4</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat5</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat6</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat0</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat7</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">mat8</td><td>Coefficient from the convolution matrix </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">scale</td><td>Convolution matrix scale (Sum of the coefficients, or 1 if the sum is 0)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a short8 containing 8 convoluted and scaled values. </dd></dl>
<p>Definition at line <a class="el" href="convolution3x3_8cl_source.xhtml#l00082">82</a> of file <a class="el" href="convolution3x3_8cl_source.xhtml">convolution3x3.cl</a>.</p>
<p>References <a class="el" href="convolution3x3_8cl_source.xhtml#l00043">convolution1x3()</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p>
<p>Referenced by <a class="el" href="convolution3x3_8cl_source.xhtml#l00123">convolution3x3_static()</a>.</p>
<div class="fragment"><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> {</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment">// Output pixels</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 8)</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  pixels;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">// Row 0</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  pixels = <a class="code" href="convolution3x3_8cl.xhtml#a92702074338198e81a46c3e309d9b04f">convolution1x3</a>(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(src, -1, -1), mat0, mat1, mat2);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="comment">// Row</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  pixels += <a class="code" href="convolution3x3_8cl.xhtml#a92702074338198e81a46c3e309d9b04f">convolution1x3</a>(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(src, -1, 0), mat3, mat4, mat5);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">// Row 2</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  pixels += <a class="code" href="convolution3x3_8cl.xhtml#a92702074338198e81a46c3e309d9b04f">convolution1x3</a>(<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(src, -1, 1), mat6, mat7, mat8);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">// Divide by the scale</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  return pixels / (<a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 8))scale;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> }</div><div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00201">helpers.h:201</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div>
<div class="ttc" id="convolution3x3_8cl_xhtml_a92702074338198e81a46c3e309d9b04f"><div class="ttname"><a href="convolution3x3_8cl.xhtml#a92702074338198e81a46c3e309d9b04f">convolution1x3</a></div><div class="ttdeci">short8 convolution1x3(__global const uchar *left_pixel, const short left_coeff, const short middle_coeff, const short right_coeff)</div><div class="ttdoc">Compute a 1D horizontal convolution of size 3 for 8 bytes assuming the input is made of 1 channel of ...</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00043">convolution3x3.cl:43</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aa0b80492bb4faef0b052d95a8aa147e4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">__kernel void convolution3x3_static </td>
<td>(</td>
<td class="paramtype">__global uchar * </td>
<td class="paramname"><em>src_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>src_stride_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>src_step_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>src_stride_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>src_step_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">__global uchar * </td>
<td class="paramname"><em>dst_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>dst_stride_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>dst_step_x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>dst_stride_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>dst_step_y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint </td>
<td class="paramname"><em>dst_offset_first_element_in_bytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Apply a 3x3 static convolution matrix to a single channel U8 input image and output a single channel image. </p>
<dl class="section attention"><dt>Attention</dt><dd>The matrix coefficients(MAT0, MAT1, ... MAT8, SCALE), DATA_TYPE, and DATA_TYPE_OUT need to be passed at compile time.<br />
e.g. -DMAT0=1 -DMAT2=2, ...-DMAT8=8, -DSCALE=1, -DDATA_TYPE=int, -DDATA_TYPE_OUT=int</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination image. Supported data types: U8, S16 </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="convolution3x3_8cl_source.xhtml#l00123">123</a> of file <a class="el" href="convolution3x3_8cl_source.xhtml">convolution3x3.cl</a>.</p>
<p>References <a class="el" href="helpers_8h_source.xhtml#l00038">CONVERT_SAT</a>, <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00082">convolution3x3()</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00031">DATA_TYPE_OUT</a>, <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p>
<div class="fragment"><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="struct_image.xhtml">Image</a> dst = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(dst);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 8)</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  pixels = <a class="code" href="convolution3x3_8cl.xhtml#afc5fefe72e66f0ae5191fd5b708fade9">convolution3x3</a>(&src,</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  MAT0, MAT1, MAT2, MAT3, MAT4, MAT5, MAT6, MAT7, MAT8, SCALE);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="comment">// Store the result as is in dst</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  vstore8(<a class="code" href="helpers_8h.xhtml#a23fb01b6f3453cc0e48a026fd44f6acd">CONVERT_SAT</a>(pixels, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#ac06f3e24d3fffd3c465d8b2a6e7c985e">DATA_TYPE_OUT</a>, 8)), 0, (__global DATA_TYPE_OUT *)dst.ptr);</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> }</div><div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00073">helpers.h:73</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div>
<div class="ttc" id="convolution3x3_8cl_xhtml_afc5fefe72e66f0ae5191fd5b708fade9"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afc5fefe72e66f0ae5191fd5b708fade9">convolution3x3</a></div><div class="ttdeci">short8 convolution3x3(Image *src, const short mat0, const short mat1, const short mat2, const short mat3, const short mat4, const short mat5, const short mat6, const short mat7, const short mat8, uint scale)</div><div class="ttdoc">Apply a 3x3 convolution matrix to a single channel U8 input image and return the result. </div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00082">convolution3x3.cl:82</a></div></div>
<div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00095">helpers.h:95</a></div></div>
<div class="ttc" id="helpers_8h_xhtml_a23fb01b6f3453cc0e48a026fd44f6acd"><div class="ttname"><a href="helpers_8h.xhtml#a23fb01b6f3453cc0e48a026fd44f6acd">CONVERT_SAT</a></div><div class="ttdeci">#define CONVERT_SAT(x, type)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00038">helpers.h:38</a></div></div>
<div class="ttc" id="convolution3x3_8cl_xhtml_ac06f3e24d3fffd3c465d8b2a6e7c985e"><div class="ttname"><a href="convolution3x3_8cl.xhtml#ac06f3e24d3fffd3c465d8b2a6e7c985e">DATA_TYPE_OUT</a></div><div class="ttdeci">#define DATA_TYPE_OUT</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00031">convolution3x3.cl:31</a></div></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_8c278f79c760e5c5fbd911f9870614c1.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_25885286e9dad4fa105b7b25a8031bbf.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="convolution3x3_8cl.xhtml">convolution3x3.cl</a></li>
<li class="footer">Generated on Wed Apr 12 2017 14:26:05 for ARM Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>
|