blob: 047ed14fa5cf52ec88e127f99ac7c7f4b922fa23 [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001<!-- 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"/>
Kaizen8938bd32017-09-28 14:38:23 +01007<meta name="generator" content="Doxygen 1.8.6"/>
Anthony Barbier871448e2017-03-24 14:54:29 +00008<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
Anthony Barbierdbdab852017-06-23 15:42:00 +01009<title>Compute Library: src/core/CL/cl_kernels/magnitude_phase.cl File Reference</title>
Anthony Barbier871448e2017-03-24 14:54:29 +000010<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>
Anthony Barbier871448e2017-03-24 14:54:29 +000015<script type="text/javascript" src="navtree.js"></script>
16<script type="text/javascript">
17 $(document).ready(initResizable);
18 $(window).load(resizeHeight);
19</script>
20<link href="search/search.css" rel="stylesheet" type="text/css"/>
Anthony Barbier871448e2017-03-24 14:54:29 +000021<script type="text/javascript" src="search/search.js"></script>
22<script type="text/javascript">
Kaizen8938bd32017-09-28 14:38:23 +010023 $(document).ready(function() { searchBox.OnSelectItem(0); });
Anthony Barbier871448e2017-03-24 14:54:29 +000024</script>
25<script type="text/x-mathjax-config">
26 MathJax.Hub.Config({
27 extensions: ["tex2jax.js"],
28 jax: ["input/TeX","output/HTML-CSS"],
29});
Kaizen8938bd32017-09-28 14:38:23 +010030</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000031<link href="doxygen.css" rel="stylesheet" type="text/css" />
32</head>
33<body>
34<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
35<div id="titlearea">
36<table cellspacing="0" cellpadding="0">
37 <tbody>
38 <tr style="height: 56px;">
39 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010040 <div id="projectname">Compute Library
Kaizen8938bd32017-09-28 14:38:23 +010041 &#160;<span id="projectnumber">17.09</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000042 </div>
43 </td>
44 </tr>
45 </tbody>
46</table>
47</div>
48<!-- end header part -->
Kaizen8938bd32017-09-28 14:38:23 +010049<!-- Generated by Doxygen 1.8.6 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000050<script type="text/javascript">
51var searchBox = new SearchBox("searchBox", "search",false,'Search');
52</script>
53 <div id="navrow1" class="tabs">
54 <ul class="tablist">
55 <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010056 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000057 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
58 <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
59 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
60 <li>
61 <div id="MSearchBox" class="MSearchBoxInactive">
62 <span class="left">
63 <img id="MSearchSelect" src="search/mag_sel.png"
64 onmouseover="return searchBox.OnSearchSelectShow()"
65 onmouseout="return searchBox.OnSearchSelectHide()"
66 alt=""/>
67 <input type="text" id="MSearchField" value="Search" accesskey="S"
68 onfocus="searchBox.OnSearchFieldFocus(true)"
69 onblur="searchBox.OnSearchFieldFocus(false)"
70 onkeyup="searchBox.OnSearchFieldChange(event)"/>
71 </span><span class="right">
72 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
73 </span>
74 </div>
75 </li>
76 </ul>
77 </div>
78 <div id="navrow2" class="tabs2">
79 <ul class="tablist">
80 <li><a href="files.xhtml"><span>File&#160;List</span></a></li>
81 <li><a href="globals.xhtml"><span>Globals</span></a></li>
82 </ul>
83 </div>
84</div><!-- top -->
85<div id="side-nav" class="ui-resizable side-nav-resizable">
86 <div id="nav-tree">
87 <div id="nav-tree-contents">
88 <div id="nav-sync" class="sync"></div>
89 </div>
90 </div>
91 <div id="splitbar" style="-moz-user-select:none;"
92 class="ui-resizable-handle">
93 </div>
94</div>
95<script type="text/javascript">
96$(document).ready(function(){initNavTree('magnitude__phase_8cl.xhtml','');});
97</script>
98<div id="doc-content">
99<!-- window showing the filter options -->
100<div id="MSearchSelectWindow"
101 onmouseover="return searchBox.OnSearchSelectShow()"
102 onmouseout="return searchBox.OnSearchSelectHide()"
103 onkeydown="return searchBox.OnSearchSelectKey(event)">
Kaizen8938bd32017-09-28 14:38:23 +0100104<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000105
106<!-- iframe showing the search results (closed by default) -->
107<div id="MSearchResultsWindow">
108<iframe src="javascript:void(0)" frameborder="0"
109 name="MSearchResults" id="MSearchResults">
110</iframe>
111</div>
112
113<div class="header">
114 <div class="summary">
115<a href="#define-members">Macros</a> &#124;
116<a href="#func-members">Functions</a> </div>
117 <div class="headertitle">
118<div class="title">magnitude_phase.cl File Reference</div> </div>
119</div><!--header-->
120<div class="contents">
Kaizen8938bd32017-09-28 14:38:23 +0100121<div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br/>
Anthony Barbier871448e2017-03-24 14:54:29 +0000122</div>
123<p><a href="magnitude__phase_8cl_source.xhtml">Go to the source code of this file.</a></p>
124<table class="memberdecls">
125<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
126Macros</h2></td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100127<tr class="memitem:a259a59d7a4f247119c457af235827a29"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#a259a59d7a4f247119c457af235827a29">MAGNITUDE_OP</a>(x, y)&#160;&#160;&#160;<a class="el" href="magnitude__phase_8cl.xhtml#aedc7e5ee4cb8f5a0240e422f9a9e7ce9">magnitude_l1</a>((x), (y))</td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000128<tr class="separator:a259a59d7a4f247119c457af235827a29"><td class="memSeparator" colspan="2">&#160;</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100129<tr class="memitem:a4434551334149479f843f87424bbb8c8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#a4434551334149479f843f87424bbb8c8">PHASE_OP</a>(x, y)&#160;&#160;&#160;<a class="el" href="magnitude__phase_8cl.xhtml#ab0d7e891c8a09824c46baa2393d6961f">phase_unsigned</a>((x), (y))</td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000130<tr class="separator:a4434551334149479f843f87424bbb8c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
131</table><table class="memberdecls">
132<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
133Functions</h2></td></tr>
134<tr class="memitem:aedc7e5ee4cb8f5a0240e422f9a9e7ce9"><td class="memItemLeft" align="right" valign="top">DATA_TYPE16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#aedc7e5ee4cb8f5a0240e422f9a9e7ce9">magnitude_l1</a> (DATA_TYPE16 a, DATA_TYPE16 b)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100135<tr class="memdesc:aedc7e5ee4cb8f5a0240e422f9a9e7ce9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates L1 normalization between two inputs. <a href="#aedc7e5ee4cb8f5a0240e422f9a9e7ce9">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000136<tr class="separator:aedc7e5ee4cb8f5a0240e422f9a9e7ce9"><td class="memSeparator" colspan="2">&#160;</td></tr>
137<tr class="memitem:aec9387519a61474acb0b2bf90ef6d94d"><td class="memItemLeft" align="right" valign="top">DATA_TYPE16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#aec9387519a61474acb0b2bf90ef6d94d">magnitude_l2</a> (int16 a, int16 b)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100138<tr class="memdesc:aec9387519a61474acb0b2bf90ef6d94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates L2 normalization between two inputs. <a href="#aec9387519a61474acb0b2bf90ef6d94d">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000139<tr class="separator:aec9387519a61474acb0b2bf90ef6d94d"><td class="memSeparator" colspan="2">&#160;</td></tr>
140<tr class="memitem:ab0d7e891c8a09824c46baa2393d6961f"><td class="memItemLeft" align="right" valign="top">uchar16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#ab0d7e891c8a09824c46baa2393d6961f">phase_unsigned</a> (DATA_TYPE16 a, DATA_TYPE16 b)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100141<tr class="memdesc:ab0d7e891c8a09824c46baa2393d6961f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates unsigned phase between two inputs. <a href="#ab0d7e891c8a09824c46baa2393d6961f">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000142<tr class="separator:ab0d7e891c8a09824c46baa2393d6961f"><td class="memSeparator" colspan="2">&#160;</td></tr>
143<tr class="memitem:a02ff978b574e44604d625dbd470ab870"><td class="memItemLeft" align="right" valign="top">uchar16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#a02ff978b574e44604d625dbd470ab870">phase_signed</a> (DATA_TYPE16 a, DATA_TYPE16 b)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100144<tr class="memdesc:a02ff978b574e44604d625dbd470ab870"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates signed phase between two inputs. <a href="#a02ff978b574e44604d625dbd470ab870">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000145<tr class="separator:a02ff978b574e44604d625dbd470ab870"><td class="memSeparator" colspan="2">&#160;</td></tr>
146<tr class="memitem:a76ac02e1f05a26f67090c9464434e04a"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="magnitude__phase_8cl.xhtml#a76ac02e1f05a26f67090c9464434e04a">magnitude_phase</a> (__global uchar *gx_ptr, uint gx_stride_x, uint gx_step_x, uint gx_stride_y, uint gx_step_y, uint gx_offset_first_element_in_bytes, __global uchar *gy_ptr, uint gy_stride_x, uint gy_step_x, uint gy_stride_y, uint gy_step_y, uint gy_offset_first_element_in_bytes, __global uchar *magnitude_ptr, uint magnitude_stride_x, uint magnitude_step_x, uint magnitude_stride_y, uint magnitude_step_y, uint magnitude_offset_first_element_in_bytes, __global uchar *phase_ptr, uint phase_stride_x, uint phase_step_x, uint phase_stride_y, uint phase_step_y, uint phase_offset_first_element_in_bytes)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100147<tr class="memdesc:a76ac02e1f05a26f67090c9464434e04a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the magnitude and phase of given the gradients of an image. <a href="#a76ac02e1f05a26f67090c9464434e04a">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000148<tr class="separator:a76ac02e1f05a26f67090c9464434e04a"><td class="memSeparator" colspan="2">&#160;</td></tr>
149</table>
150<h2 class="groupheader">Macro Definition Documentation</h2>
151<a class="anchor" id="a259a59d7a4f247119c457af235827a29"></a>
152<div class="memitem">
153<div class="memproto">
154 <table class="memname">
155 <tr>
156 <td class="memname">#define MAGNITUDE_OP</td>
157 <td>(</td>
158 <td class="paramtype">&#160;</td>
159 <td class="paramname">x, </td>
160 </tr>
161 <tr>
162 <td class="paramkey"></td>
163 <td></td>
164 <td class="paramtype">&#160;</td>
165 <td class="paramname">y&#160;</td>
166 </tr>
167 <tr>
168 <td></td>
169 <td>)</td>
170 <td></td><td>&#160;&#160;&#160;<a class="el" href="magnitude__phase_8cl.xhtml#aedc7e5ee4cb8f5a0240e422f9a9e7ce9">magnitude_l1</a>((x), (y))</td>
171 </tr>
172 </table>
173</div><div class="memdoc">
174
Anthony Barbierdbdab852017-06-23 15:42:00 +0100175<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00081">81</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000176
Anthony Barbierdbdab852017-06-23 15:42:00 +0100177<p>Referenced by <a class="el" href="magnitude__phase_8cl_source.xhtml#l00130">magnitude_phase()</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000178
179</div>
180</div>
181<a class="anchor" id="a4434551334149479f843f87424bbb8c8"></a>
182<div class="memitem">
183<div class="memproto">
184 <table class="memname">
185 <tr>
186 <td class="memname">#define PHASE_OP</td>
187 <td>(</td>
188 <td class="paramtype">&#160;</td>
189 <td class="paramname">x, </td>
190 </tr>
191 <tr>
192 <td class="paramkey"></td>
193 <td></td>
194 <td class="paramtype">&#160;</td>
195 <td class="paramname">y&#160;</td>
196 </tr>
197 <tr>
198 <td></td>
199 <td>)</td>
200 <td></td><td>&#160;&#160;&#160;<a class="el" href="magnitude__phase_8cl.xhtml#ab0d7e891c8a09824c46baa2393d6961f">phase_unsigned</a>((x), (y))</td>
201 </tr>
202 </table>
203</div><div class="memdoc">
204
Anthony Barbierdbdab852017-06-23 15:42:00 +0100205<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00089">89</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000206
Anthony Barbierdbdab852017-06-23 15:42:00 +0100207<p>Referenced by <a class="el" href="magnitude__phase_8cl_source.xhtml#l00130">magnitude_phase()</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000208
209</div>
210</div>
211<h2 class="groupheader">Function Documentation</h2>
212<a class="anchor" id="aedc7e5ee4cb8f5a0240e422f9a9e7ce9"></a>
213<div class="memitem">
214<div class="memproto">
215<table class="mlabels">
216 <tr>
217 <td class="mlabels-left">
218 <table class="memname">
219 <tr>
220 <td class="memname">DATA_TYPE16 magnitude_l1 </td>
221 <td>(</td>
222 <td class="paramtype">DATA_TYPE16&#160;</td>
223 <td class="paramname"><em>a</em>, </td>
224 </tr>
225 <tr>
226 <td class="paramkey"></td>
227 <td></td>
228 <td class="paramtype">DATA_TYPE16&#160;</td>
229 <td class="paramname"><em>b</em>&#160;</td>
230 </tr>
231 <tr>
232 <td></td>
233 <td>)</td>
234 <td></td><td></td>
235 </tr>
236 </table>
237 </td>
238 <td class="mlabels-right">
239<span class="mlabels"><span class="mlabel">inline</span></span> </td>
240 </tr>
241</table>
242</div><div class="memdoc">
243
244<p>Calculates L1 normalization between two inputs. </p>
245<dl class="params"><dt>Parameters</dt><dd>
246 <table class="params">
247 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>First input. Supported data types: S16, S32 </td></tr>
248 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Second input. Supported data types: S16, S32</td></tr>
249 </table>
250 </dd>
251</dl>
252<dl class="section return"><dt>Returns</dt><dd>L1 normalization magnitude result. Supported data types: S16, S32 </dd></dl>
253
254<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00033">33</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
255
Kaizen8938bd32017-09-28 14:38:23 +0100256<p>References <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00914">arm_compute::test::fixed_point_arithmetic::detail::abs()</a>, <a class="el" href="direct__convolution1x1_8cl_source.xhtml#l00040">CONVERT_SAT</a>, and <a class="el" href="fixed__point_8h_source.xhtml#l00093">VEC_DATA_TYPE</a>.</p>
257<div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;{</div>
258<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keywordflow">return</span> <a class="code" href="direct__convolution1x1_8cl.xhtml#a1f15728672380ade7a238f5e783d54d2">CONVERT_SAT</a>(add_sat(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ae115fc750a92fb6a5e094998b56fcc56">abs</a>(a), <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ae115fc750a92fb6a5e094998b56fcc56">abs</a>(b)), <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 16));</div>
259<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;}</div>
260<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>
261<div class="ttc" id="direct__convolution1x1_8cl_xhtml_a1f15728672380ade7a238f5e783d54d2"><div class="ttname"><a href="direct__convolution1x1_8cl.xhtml#a1f15728672380ade7a238f5e783d54d2">CONVERT_SAT</a></div><div class="ttdeci">#define CONVERT_SAT(a, b)</div><div class="ttdef"><b>Definition:</b> <a href="direct__convolution1x1_8cl_source.xhtml#l00040">direct_convolution1x1.cl:40</a></div></div>
262<div class="ttc" id="fixed__point_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="fixed__point_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="fixed__point_8h_source.xhtml#l00093">fixed_point.h:93</a></div></div>
263<div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ae115fc750a92fb6a5e094998b56fcc56"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ae115fc750a92fb6a5e094998b56fcc56">arm_compute::test::fixed_point_arithmetic::detail::abs</a></div><div class="ttdeci">fixed_point&lt; T &gt; abs(fixed_point&lt; T &gt; x)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00914">FixedPoint.h:914</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000264</div><!-- fragment -->
265</div>
266</div>
267<a class="anchor" id="aec9387519a61474acb0b2bf90ef6d94d"></a>
268<div class="memitem">
269<div class="memproto">
270<table class="mlabels">
271 <tr>
272 <td class="mlabels-left">
273 <table class="memname">
274 <tr>
275 <td class="memname">DATA_TYPE16 magnitude_l2 </td>
276 <td>(</td>
277 <td class="paramtype">int16&#160;</td>
278 <td class="paramname"><em>a</em>, </td>
279 </tr>
280 <tr>
281 <td class="paramkey"></td>
282 <td></td>
283 <td class="paramtype">int16&#160;</td>
284 <td class="paramname"><em>b</em>&#160;</td>
285 </tr>
286 <tr>
287 <td></td>
288 <td>)</td>
289 <td></td><td></td>
290 </tr>
291 </table>
292 </td>
293 <td class="mlabels-right">
294<span class="mlabels"><span class="mlabel">inline</span></span> </td>
295 </tr>
296</table>
297</div><div class="memdoc">
298
299<p>Calculates L2 normalization between two inputs. </p>
300<dl class="params"><dt>Parameters</dt><dd>
301 <table class="params">
302 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>First input. Supported data types: S16, S32 </td></tr>
303 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Second input. Supported data types: S16, S32</td></tr>
304 </table>
305 </dd>
306</dl>
307<dl class="section return"><dt>Returns</dt><dd>L2 normalization magnitude result. Supported data types: S16, S32 </dd></dl>
308
309<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00045">45</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
310
Kaizen8938bd32017-09-28 14:38:23 +0100311<p>References <a class="el" href="direct__convolution1x1_8cl_source.xhtml#l00040">CONVERT_SAT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, and <a class="el" href="fixed__point_8h_source.xhtml#l00093">VEC_DATA_TYPE</a>.</p>
312<div class="fragment"><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div>
313<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">return</span> <a class="code" href="direct__convolution1x1_8cl.xhtml#a1f15728672380ade7a238f5e783d54d2">CONVERT_SAT</a>((sqrt(convert_float16((convert_uint16(a * a) + convert_uint16(b * b)))) + 0.5f),</div>
314<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 16));</div>
315<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;}</div>
316<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>
317<div class="ttc" id="direct__convolution1x1_8cl_xhtml_a1f15728672380ade7a238f5e783d54d2"><div class="ttname"><a href="direct__convolution1x1_8cl.xhtml#a1f15728672380ade7a238f5e783d54d2">CONVERT_SAT</a></div><div class="ttdeci">#define CONVERT_SAT(a, b)</div><div class="ttdef"><b>Definition:</b> <a href="direct__convolution1x1_8cl_source.xhtml#l00040">direct_convolution1x1.cl:40</a></div></div>
318<div class="ttc" id="fixed__point_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="fixed__point_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="fixed__point_8h_source.xhtml#l00093">fixed_point.h:93</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000319</div><!-- fragment -->
320</div>
321</div>
322<a class="anchor" id="a76ac02e1f05a26f67090c9464434e04a"></a>
323<div class="memitem">
324<div class="memproto">
325 <table class="memname">
326 <tr>
327 <td class="memname">__kernel void magnitude_phase </td>
328 <td>(</td>
329 <td class="paramtype">__global uchar *&#160;</td>
330 <td class="paramname"><em>gx_ptr</em>, </td>
331 </tr>
332 <tr>
333 <td class="paramkey"></td>
334 <td></td>
335 <td class="paramtype">uint&#160;</td>
336 <td class="paramname"><em>gx_stride_x</em>, </td>
337 </tr>
338 <tr>
339 <td class="paramkey"></td>
340 <td></td>
341 <td class="paramtype">uint&#160;</td>
342 <td class="paramname"><em>gx_step_x</em>, </td>
343 </tr>
344 <tr>
345 <td class="paramkey"></td>
346 <td></td>
347 <td class="paramtype">uint&#160;</td>
348 <td class="paramname"><em>gx_stride_y</em>, </td>
349 </tr>
350 <tr>
351 <td class="paramkey"></td>
352 <td></td>
353 <td class="paramtype">uint&#160;</td>
354 <td class="paramname"><em>gx_step_y</em>, </td>
355 </tr>
356 <tr>
357 <td class="paramkey"></td>
358 <td></td>
359 <td class="paramtype">uint&#160;</td>
360 <td class="paramname"><em>gx_offset_first_element_in_bytes</em>, </td>
361 </tr>
362 <tr>
363 <td class="paramkey"></td>
364 <td></td>
365 <td class="paramtype">__global uchar *&#160;</td>
366 <td class="paramname"><em>gy_ptr</em>, </td>
367 </tr>
368 <tr>
369 <td class="paramkey"></td>
370 <td></td>
371 <td class="paramtype">uint&#160;</td>
372 <td class="paramname"><em>gy_stride_x</em>, </td>
373 </tr>
374 <tr>
375 <td class="paramkey"></td>
376 <td></td>
377 <td class="paramtype">uint&#160;</td>
378 <td class="paramname"><em>gy_step_x</em>, </td>
379 </tr>
380 <tr>
381 <td class="paramkey"></td>
382 <td></td>
383 <td class="paramtype">uint&#160;</td>
384 <td class="paramname"><em>gy_stride_y</em>, </td>
385 </tr>
386 <tr>
387 <td class="paramkey"></td>
388 <td></td>
389 <td class="paramtype">uint&#160;</td>
390 <td class="paramname"><em>gy_step_y</em>, </td>
391 </tr>
392 <tr>
393 <td class="paramkey"></td>
394 <td></td>
395 <td class="paramtype">uint&#160;</td>
396 <td class="paramname"><em>gy_offset_first_element_in_bytes</em>, </td>
397 </tr>
398 <tr>
399 <td class="paramkey"></td>
400 <td></td>
401 <td class="paramtype">__global uchar *&#160;</td>
402 <td class="paramname"><em>magnitude_ptr</em>, </td>
403 </tr>
404 <tr>
405 <td class="paramkey"></td>
406 <td></td>
407 <td class="paramtype">uint&#160;</td>
408 <td class="paramname"><em>magnitude_stride_x</em>, </td>
409 </tr>
410 <tr>
411 <td class="paramkey"></td>
412 <td></td>
413 <td class="paramtype">uint&#160;</td>
414 <td class="paramname"><em>magnitude_step_x</em>, </td>
415 </tr>
416 <tr>
417 <td class="paramkey"></td>
418 <td></td>
419 <td class="paramtype">uint&#160;</td>
420 <td class="paramname"><em>magnitude_stride_y</em>, </td>
421 </tr>
422 <tr>
423 <td class="paramkey"></td>
424 <td></td>
425 <td class="paramtype">uint&#160;</td>
426 <td class="paramname"><em>magnitude_step_y</em>, </td>
427 </tr>
428 <tr>
429 <td class="paramkey"></td>
430 <td></td>
431 <td class="paramtype">uint&#160;</td>
432 <td class="paramname"><em>magnitude_offset_first_element_in_bytes</em>, </td>
433 </tr>
434 <tr>
435 <td class="paramkey"></td>
436 <td></td>
437 <td class="paramtype">__global uchar *&#160;</td>
438 <td class="paramname"><em>phase_ptr</em>, </td>
439 </tr>
440 <tr>
441 <td class="paramkey"></td>
442 <td></td>
443 <td class="paramtype">uint&#160;</td>
444 <td class="paramname"><em>phase_stride_x</em>, </td>
445 </tr>
446 <tr>
447 <td class="paramkey"></td>
448 <td></td>
449 <td class="paramtype">uint&#160;</td>
450 <td class="paramname"><em>phase_step_x</em>, </td>
451 </tr>
452 <tr>
453 <td class="paramkey"></td>
454 <td></td>
455 <td class="paramtype">uint&#160;</td>
456 <td class="paramname"><em>phase_stride_y</em>, </td>
457 </tr>
458 <tr>
459 <td class="paramkey"></td>
460 <td></td>
461 <td class="paramtype">uint&#160;</td>
462 <td class="paramname"><em>phase_step_y</em>, </td>
463 </tr>
464 <tr>
465 <td class="paramkey"></td>
466 <td></td>
467 <td class="paramtype">uint&#160;</td>
468 <td class="paramname"><em>phase_offset_first_element_in_bytes</em>&#160;</td>
469 </tr>
470 <tr>
471 <td></td>
472 <td>)</td>
473 <td></td><td></td>
474 </tr>
475 </table>
476</div><div class="memdoc">
477
478<p>Calculate the magnitude and phase of given the gradients of an image. </p>
479<dl class="section note"><dt>Note</dt><dd>Magnitude calculation supported: L1 normalization(type = 1) and L2 normalization(type = 2). </dd>
480<dd>
481Phase calculation supported: Unsigned(type = 1) [0,128] and Signed(type = 2) [0,256).</dd></dl>
482<dl class="section attention"><dt>Attention</dt><dd>To enable phase calculation -DPHASE="phase_calculation_type_id" must be provided at compile time. eg -DPHASE=1 </dd>
483<dd>
484To enable magnitude calculation -DMAGNITUDE="magnitude_calculation_type_id" must be provided at compile time. eg -DMAGNITUDE=1 </dd>
485<dd>
486Datatype of the two inputs is passed at compile time using -DDATA_TYPE. e.g -DDATA_TYPE=short. Supported data_types are: short and int</dd></dl>
487<dl class="params"><dt>Parameters</dt><dd>
488 <table class="params">
489 <tr><td class="paramdir">[in]</td><td class="paramname">gx_ptr</td><td>Pointer to the first source image (gradient X). Supported data types: S16, S32 </td></tr>
490 <tr><td class="paramdir">[in]</td><td class="paramname">gx_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
491 <tr><td class="paramdir">[in]</td><td class="paramname">gx_step_x</td><td>gx_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
492 <tr><td class="paramdir">[in]</td><td class="paramname">gx_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
493 <tr><td class="paramdir">[in]</td><td class="paramname">gx_step_y</td><td>gx_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
494 <tr><td class="paramdir">[in]</td><td class="paramname">gx_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
495 <tr><td class="paramdir">[in]</td><td class="paramname">gy_ptr</td><td>Pointer to the second source image (gradient Y) . Supported data types: S16, S32 </td></tr>
496 <tr><td class="paramdir">[in]</td><td class="paramname">gy_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
497 <tr><td class="paramdir">[in]</td><td class="paramname">gy_step_x</td><td>gy_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
498 <tr><td class="paramdir">[in]</td><td class="paramname">gy_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
499 <tr><td class="paramdir">[in]</td><td class="paramname">gy_step_y</td><td>gy_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
500 <tr><td class="paramdir">[in]</td><td class="paramname">gy_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
501 <tr><td class="paramdir">[out]</td><td class="paramname">magnitude_ptr</td><td>Pointer to the magnitude destination image. Supported data types: S16, S32 </td></tr>
502 <tr><td class="paramdir">[in]</td><td class="paramname">magnitude_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
503 <tr><td class="paramdir">[in]</td><td class="paramname">magnitude_step_x</td><td>magnitude_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
504 <tr><td class="paramdir">[in]</td><td class="paramname">magnitude_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
505 <tr><td class="paramdir">[in]</td><td class="paramname">magnitude_step_y</td><td>magnitude_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
506 <tr><td class="paramdir">[in]</td><td class="paramname">magnitude_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
507 <tr><td class="paramdir">[out]</td><td class="paramname">phase_ptr</td><td>Pointer to the phase destination image. Supported data types: U8 </td></tr>
508 <tr><td class="paramdir">[in]</td><td class="paramname">phase_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
509 <tr><td class="paramdir">[in]</td><td class="paramname">phase_step_x</td><td>phase_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
510 <tr><td class="paramdir">[in]</td><td class="paramname">phase_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
511 <tr><td class="paramdir">[in]</td><td class="paramname">phase_step_y</td><td>phase_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
512 <tr><td class="paramdir">[in]</td><td class="paramname">phase_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
513 </table>
514 </dd>
515</dl>
516
Anthony Barbierdbdab852017-06-23 15:42:00 +0100517<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00130">130</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000518
Kaizen8938bd32017-09-28 14:38:23 +0100519<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="magnitude__phase_8cl_source.xhtml#l00081">MAGNITUDE_OP</a>, <a class="el" href="magnitude__phase_8cl_source.xhtml#l00089">PHASE_OP</a>, <a class="el" href="helpers_8h_source.xhtml#l00133">Image::ptr</a>, and <a class="el" href="fixed__point_8h_source.xhtml#l00093">VEC_DATA_TYPE</a>.</p>
520<div class="fragment"><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;{</div>
521<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">// Get pixels pointer</span></div>
522<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> gx = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(gx);</div>
523<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> gy = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(gy);</div>
524<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
525<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="comment">// Load values</span></div>
526<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 16)</div>
527<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; in_a = vload16(0, (__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)gx.ptr);</div>
528<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 16)</div>
529<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; in_b = vload16(0, (__global DATA_TYPE *)gy.ptr);</div>
530<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div>
531<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="comment">// Calculate and store the results</span></div>
532<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;<span class="preprocessor">#ifdef MAGNITUDE</span></div>
533<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="preprocessor"></span> <a class="code" href="struct_image.xhtml">Image</a> magnitude = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(magnitude);</div>
534<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; vstore16(<a class="code" href="magnitude__phase_8cl.xhtml#a259a59d7a4f247119c457af235827a29">MAGNITUDE_OP</a>(in_a, in_b), 0, (__global DATA_TYPE *)magnitude.ptr);</div>
535<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* MAGNITUDE */</span><span class="preprocessor"></span></div>
536<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef PHASE</span></div>
537<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="preprocessor"></span> <a class="code" href="struct_image.xhtml">Image</a> phase = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(phase);</div>
538<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; vstore16(<a class="code" href="magnitude__phase_8cl.xhtml#a4434551334149479f843f87424bbb8c8">PHASE_OP</a>(in_a, in_b), 0, phase.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div>
539<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* PHASE */</span><span class="preprocessor"></span></div>
540<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="preprocessor"></span>}</div>
541<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>
542<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#l00093">helpers.h:93</a></div></div>
543<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#l00131">helpers.h:131</a></div></div>
544<div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00133">helpers.h:133</a></div></div>
545<div class="ttc" id="fixed__point_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="fixed__point_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="fixed__point_8h_source.xhtml#l00093">fixed_point.h:93</a></div></div>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100546<div class="ttc" id="magnitude__phase_8cl_xhtml_a4434551334149479f843f87424bbb8c8"><div class="ttname"><a href="magnitude__phase_8cl.xhtml#a4434551334149479f843f87424bbb8c8">PHASE_OP</a></div><div class="ttdeci">#define PHASE_OP(x, y)</div><div class="ttdef"><b>Definition:</b> <a href="magnitude__phase_8cl_source.xhtml#l00089">magnitude_phase.cl:89</a></div></div>
547<div class="ttc" id="magnitude__phase_8cl_xhtml_a259a59d7a4f247119c457af235827a29"><div class="ttname"><a href="magnitude__phase_8cl.xhtml#a259a59d7a4f247119c457af235827a29">MAGNITUDE_OP</a></div><div class="ttdeci">#define MAGNITUDE_OP(x, y)</div><div class="ttdef"><b>Definition:</b> <a href="magnitude__phase_8cl_source.xhtml#l00081">magnitude_phase.cl:81</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000548</div><!-- fragment -->
549</div>
550</div>
551<a class="anchor" id="a02ff978b574e44604d625dbd470ab870"></a>
552<div class="memitem">
553<div class="memproto">
554<table class="mlabels">
555 <tr>
556 <td class="mlabels-left">
557 <table class="memname">
558 <tr>
559 <td class="memname">uchar16 phase_signed </td>
560 <td>(</td>
561 <td class="paramtype">DATA_TYPE16&#160;</td>
562 <td class="paramname"><em>a</em>, </td>
563 </tr>
564 <tr>
565 <td class="paramkey"></td>
566 <td></td>
567 <td class="paramtype">DATA_TYPE16&#160;</td>
568 <td class="paramname"><em>b</em>&#160;</td>
569 </tr>
570 <tr>
571 <td></td>
572 <td>)</td>
573 <td></td><td></td>
574 </tr>
575 </table>
576 </td>
577 <td class="mlabels-right">
578<span class="mlabels"><span class="mlabel">inline</span></span> </td>
579 </tr>
580</table>
581</div><div class="memdoc">
582
583<p>Calculates signed phase between two inputs. </p>
584<dl class="params"><dt>Parameters</dt><dd>
585 <table class="params">
586 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>First input. Supported data types: S16, S32 </td></tr>
587 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Second input. Supported data types: S16, S32</td></tr>
588 </table>
589 </dd>
590</dl>
591<dl class="section return"><dt>Returns</dt><dd>Signed phase mapped in the interval [0, 256). Supported data types: U8 </dd></dl>
592
Anthony Barbierdbdab852017-06-23 15:42:00 +0100593<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00072">72</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
Kaizen8938bd32017-09-28 14:38:23 +0100594<div class="fragment"><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;{</div>
595<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; float16 arct = atan2pi(convert_float16(b), convert_float16(a));</div>
596<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; arct = select(arct, arct + 2, arct &lt; 0.0f);</div>
597<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div>
598<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">return</span> convert_uchar16(convert_int16(mad(arct, 128, 0.5f)) &amp; 0xFFu);</div>
599<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;}</div>
600</div><!-- fragment -->
Anthony Barbier871448e2017-03-24 14:54:29 +0000601</div>
602</div>
603<a class="anchor" id="ab0d7e891c8a09824c46baa2393d6961f"></a>
604<div class="memitem">
605<div class="memproto">
606<table class="mlabels">
607 <tr>
608 <td class="mlabels-left">
609 <table class="memname">
610 <tr>
611 <td class="memname">uchar16 phase_unsigned </td>
612 <td>(</td>
613 <td class="paramtype">DATA_TYPE16&#160;</td>
614 <td class="paramname"><em>a</em>, </td>
615 </tr>
616 <tr>
617 <td class="paramkey"></td>
618 <td></td>
619 <td class="paramtype">DATA_TYPE16&#160;</td>
620 <td class="paramname"><em>b</em>&#160;</td>
621 </tr>
622 <tr>
623 <td></td>
624 <td>)</td>
625 <td></td><td></td>
626 </tr>
627 </table>
628 </td>
629 <td class="mlabels-right">
630<span class="mlabels"><span class="mlabel">inline</span></span> </td>
631 </tr>
632</table>
633</div><div class="memdoc">
634
635<p>Calculates unsigned phase between two inputs. </p>
636<dl class="params"><dt>Parameters</dt><dd>
637 <table class="params">
638 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>First input. Supported data types: S16, S32 </td></tr>
639 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Second input. Supported data types: S16, S32</td></tr>
640 </table>
641 </dd>
642</dl>
643<dl class="section return"><dt>Returns</dt><dd>Unsigned phase mapped in the interval [0, 180]. Supported data types: U8 </dd></dl>
644
645<p>Definition at line <a class="el" href="magnitude__phase_8cl_source.xhtml#l00058">58</a> of file <a class="el" href="magnitude__phase_8cl_source.xhtml">magnitude_phase.cl</a>.</p>
Kaizen8938bd32017-09-28 14:38:23 +0100646<div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;{</div>
647<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; float16 angle_deg_f32 = atan2pi(convert_float16(b), convert_float16(a)) * (float16)180.0f;</div>
648<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; angle_deg_f32 = select(angle_deg_f32, (float16)180.0f + angle_deg_f32, angle_deg_f32 &lt; (float16)0.0f);</div>
649<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">return</span> convert_uchar16(angle_deg_f32);</div>
650<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;}</div>
651</div><!-- fragment -->
Anthony Barbier871448e2017-03-24 14:54:29 +0000652</div>
653</div>
654</div><!-- contents -->
655</div><!-- doc-content -->
656<!-- start footer part -->
657<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
658 <ul>
Kaizen8938bd32017-09-28 14:38:23 +0100659 <li class="navelem"><a class="el" href="dir_55b5a5006e943fb664ff8cff3cfe7768.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_f6c3ae42d7e27145d0a3c3e38ca1c000.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_1b7ae9123c88e650426d50d95c19d414.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_b7c3d80b0dadb2139bc73b7161751c12.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="magnitude__phase_8cl.xhtml">magnitude_phase.cl</a></li>
660 <li class="footer">Generated on Thu Sep 28 2017 14:37:53 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000661 <a href="http://www.doxygen.org/index.html">
Kaizen8938bd32017-09-28 14:38:23 +0100662 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000663 </ul>
664</div>
665</body>
666</html>