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