arm_compute v18.05
[platform/upstream/armcl.git] / documentation / warp__helpers_8h_source.xhtml
index 3f328e8..771d68e 100644 (file)
@@ -40,7 +40,7 @@
  <tr style="height: 56px;">
   <td style="padding-left: 0.5em;">
    <div id="projectname">Compute Library
-   &#160;<span id="projectnumber">v17.06</span>
+   &#160;<span id="projectnumber">18.05</span>
    </div>
   </td>
  </tr>
@@ -117,25 +117,29 @@ $(document).ready(function(){initNavTree('warp__helpers_8h_source.xhtml','');});
 <div class="title">warp_helpers.h</div>  </div>
 </div><!--header-->
 <div class="contents">
-<a href="warp__helpers_8h.xhtml">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2016, 2017 ARM Limited.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * deal in the Software without restriction, including without limitation the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * sell copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * copies or substantial portions of the Software.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * SOFTWARE.</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="helpers_8h.xhtml">helpers.h</a>&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">   33</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float8 <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(float8 coords, <span class="keyword">const</span> <span class="keywordtype">float</span> width, <span class="keyword">const</span> <span class="keywordtype">float</span> height)</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;{</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keyword">const</span> float4 clamped_x = <a class="code" href="namespacearm__compute.xhtml#a1c0b9414fe3a6ef6a7a23bd324ae9e67">clamp</a>(coords.even, -1.0f, width);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keyword">const</span> float4 clamped_y = <a class="code" href="namespacearm__compute.xhtml#a1c0b9414fe3a6ef6a7a23bd324ae9e67">clamp</a>(coords.odd, -1.0f, height);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keywordflow">return</span> (float8)(clamped_x.s0, clamped_y.s0, clamped_x.s1, clamped_y.s1, clamped_x.s2, clamped_y.s2, clamped_x.s3, clamped_y.s3);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;}</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">   45</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4) <a class="code" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a>(const <a class="code" href="struct_image.xhtml">Image</a> *in, const int8 coords)</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4))(*((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s0, coords.s1)),</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                                         *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s2, coords.s3)),</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;                                         *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s4, coords.s5)),</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                                         *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s6, coords.s7)));</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;}</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">   54</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float2 <a class="code" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a>()</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;    <span class="keywordflow">return</span> (float2)(get_global_id(0) * 4, get_global_id(1));</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;}</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">   68</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float8 <a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>(<span class="keyword">const</span> float2 coord)</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;{</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">return</span> (float8)(<span class="comment">/*tl*/</span> coord.s0, coord.s1, <span class="comment">/*tr*/</span> coord.s0 + 1, coord.s1, <span class="comment">/*bl*/</span> coord.s0, coord.s1 + 1, <span class="comment">/*br*/</span> coord.s0 + 1, coord.s1 + 1);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;}</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">   80</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4) <a class="code" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a>(const <a class="code" href="struct_image.xhtml">Image</a> *in, const float8 coords, const <span class="keywordtype">float</span> width, const <span class="keywordtype">float</span> height)</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;{</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="comment">// If any of the 4 texels is out of the image&#39;s boundaries we use the border value (REPLICATE or CONSTANT) for any texel out of the image.</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <span class="comment">// Sets the 4x4 coordinates for each of the four input texels</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">const</span> float8  fc = floor(coords);</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">const</span> float16 c1 = (float16)(</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s0, fc.s1)), width, height),</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s2, fc.s3)), width, height));</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">const</span> float16 c2 = (float16)(</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s4, fc.s5)), width, height),</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s6, fc.s7)), width, height));</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="comment">// Loads the values from the input image</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keyword">const</span> float16 t = (float16)(</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                          <span class="comment">/* tl, tr, bl, br */</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                          * ((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s0, c1.s1)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s2, c1.s3)),</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s4, c1.s5)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s6, c1.s7)),</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s8, c1.s9)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.sa, c1.sb)),</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.sc, c1.sd)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.se, c1.sf)),</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s0, c2.s1)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s2, c2.s3)),</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s4, c2.s5)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s6, c2.s7)),</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s8, c2.s9)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.sa, c2.sb)),</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.sc, c2.sd)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.se, c2.sf)));</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keyword">const</span> float8 a  = coords - fc;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keyword">const</span> float8 b  = ((float8)(1.f)) - a;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">const</span> float4 fr = (float4)(</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                          ((t.s0 * b.s0 * b.s1) + (t.s1 * a.s0 * b.s1) + (t.s2 * b.s0 * a.s1) + (t.s3 * a.s0 * a.s1)),</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                          ((t.s4 * b.s2 * b.s3) + (t.s5 * a.s2 * b.s3) + (t.s6 * b.s2 * a.s3) + (t.s7 * a.s2 * a.s3)),</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                          ((t.s8 * b.s4 * b.s5) + (t.s9 * a.s4 * b.s5) + (t.sa * b.s4 * a.s5) + (t.sb * a.s4 * a.s5)),</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                          ((t.sc * b.s6 * b.s7) + (t.sd * a.s6 * b.s7) + (t.se * b.s6 * a.s7) + (t.sf * a.s6 * a.s7)));</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(fr, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4));</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;}</div><div class="ttc" id="warp__helpers_8h_xhtml_adbdf2ca9e8fe0b67f9359929ef743126"><div class="ttname"><a href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a></div><div class="ttdeci">const float8 clamp_to_border(float8 coords, const float width, const float height)</div><div class="ttdoc">Clamps the given coordinates to the borders. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00033">warp_helpers.h:33</a></div></div>
+<a href="warp__helpers_8h.xhtml">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2016, 2017 ARM Limited.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * deal in the Software without restriction, including without limitation the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * sell copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * copies or substantial portions of the Software.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * SOFTWARE.</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="helpers_8h.xhtml">helpers.h</a>&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">   34</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float8 <a class="code" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a>(float8 coords, <span class="keyword">const</span> <span class="keywordtype">float</span> width, <span class="keyword">const</span> <span class="keywordtype">float</span> height, <span class="keyword">const</span> <span class="keywordtype">float</span> border_size)</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;{</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="keyword">const</span> float4 clamped_x = <a class="code" href="namespacearm__compute_1_1utility.xhtml#a12c3c62f510452805c289e180ec78bb7">clamp</a>(coords.even, 0.0f - border_size, width - 1 + border_size);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keyword">const</span> float4 clamped_y = <a class="code" href="namespacearm__compute_1_1utility.xhtml#a12c3c62f510452805c289e180ec78bb7">clamp</a>(coords.odd, 0.0f - border_size, height - 1 + border_size);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">return</span> (float8)(clamped_x.s0, clamped_y.s0, clamped_x.s1, clamped_y.s1, clamped_x.s2, clamped_y.s2, clamped_x.s3, clamped_y.s3);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;}</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">   48</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float8 <a class="code" href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a>(float8 coords, <span class="keyword">const</span> <span class="keywordtype">float</span> width, <span class="keyword">const</span> <span class="keywordtype">float</span> height)</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;{</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a>(coords, width, height, 1);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;}</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">   58</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4) <a class="code" href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a>(const <a class="code" href="struct_image.xhtml">Image</a> *in, const int8 coords)</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4))(*((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s0, coords.s1)),</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                                         *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s2, coords.s3)),</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                                         *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s4, coords.s5)),</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                                         *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, coords.s6, coords.s7)));</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;}</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">   67</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float2 <a class="code" href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a>()</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;{</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordflow">return</span> (float2)(get_global_id(0) * 4, get_global_id(1));</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;}</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">   81</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float8 <a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>(<span class="keyword">const</span> float2 coord)</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;{</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">return</span> (float8)(<span class="comment">/*tl*/</span> coord.s0, coord.s1, <span class="comment">/*tr*/</span> coord.s0 + 1, coord.s1, <span class="comment">/*bl*/</span> coord.s0, coord.s1 + 1, <span class="comment">/*br*/</span> coord.s0 + 1, coord.s1 + 1);</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#a8eda58d341afa44da00ebf47f9349499">   94</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4) <a class="code" href="warp__helpers_8h.xhtml#a8eda58d341afa44da00ebf47f9349499">bilinear_interpolate_with_border</a>(const <a class="code" href="struct_image.xhtml">Image</a> *in, const float8 coords, const <span class="keywordtype">float</span> width, const <span class="keywordtype">float</span> height, const <span class="keywordtype">float</span> border_size)</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;{</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="comment">// If any of the 4 texels is out of the image&#39;s boundaries we use the border value (REPLICATE or CONSTANT) for any texel out of the image.</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="comment">// Sets the 4x4 coordinates for each of the four input texels</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">const</span> float8  fc = floor(coords);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keyword">const</span> float16 c1 = (float16)(</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s0, fc.s1)), width, height, border_size),</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s2, fc.s3)), width, height, border_size));</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keyword">const</span> float16 c2 = (float16)(</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s4, fc.s5)), width, height, border_size),</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                           <a class="code" href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a>(<a class="code" href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a>((float2)(fc.s6, fc.s7)), width, height, border_size));</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="comment">// Loads the values from the input image</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">const</span> float16 t = (float16)(</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                          <span class="comment">/* tl, tr, bl, br */</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                          * ((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s0, c1.s1)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s2, c1.s3)),</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s4, c1.s5)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s6, c1.s7)),</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.s8, c1.s9)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.sa, c1.sb)),</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.sc, c1.sd)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c1.se, c1.sf)),</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s0, c2.s1)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s2, c2.s3)),</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s4, c2.s5)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s6, c2.s7)),</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.s8, c2.s9)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.sa, c2.sb)),</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                          *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.sc, c2.sd)), *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(in, c2.se, c2.sf)));</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">const</span> float8 <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#aac40b7097f2bda9274ae07fa33d15a79">a</a>  = coords - fc;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keyword">const</span> float8 <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a7b8004eef325a40dd43eb80755610fff">b</a>  = ((float8)(1.f)) - a;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keyword">const</span> float4 fr = (float4)(</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                          ((t.s0 * b.s0 * b.s1) + (t.s1 * a.s0 * b.s1) + (t.s2 * b.s0 * a.s1) + (t.s3 * a.s0 * a.s1)),</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                          ((t.s4 * b.s2 * b.s3) + (t.s5 * a.s2 * b.s3) + (t.s6 * b.s2 * a.s3) + (t.s7 * a.s2 * a.s3)),</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                          ((t.s8 * b.s4 * b.s5) + (t.s9 * a.s4 * b.s5) + (t.sa * b.s4 * a.s5) + (t.sb * a.s4 * a.s5)),</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                          ((t.sc * b.s6 * b.s7) + (t.sd * a.s6 * b.s7) + (t.se * b.s6 * a.s7) + (t.sf * a.s6 * a.s7)));</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="fixed__point_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(fr, <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4));</div><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;</div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">  135</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 4) <a class="code" href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a>(const <a class="code" href="struct_image.xhtml">Image</a> *in, const float8 coords, const <span class="keywordtype">float</span> width, const <span class="keywordtype">float</span> height)</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;{</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="warp__helpers_8h.xhtml#a8eda58d341afa44da00ebf47f9349499">bilinear_interpolate_with_border</a>(in, coords, width, height, 1);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;}</div><div class="ttc" id="fixed__point_8h_xhtml_aa8d95ba04fc73845abc6045952cae5be"><div class="ttname"><a href="fixed__point_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a></div><div class="ttdeci">#define CONVERT(x, type)</div><div class="ttdef"><b>Definition:</b> <a href="fixed__point_8h_source.xhtml#l00098">fixed_point.h:98</a></div></div>
+<div class="ttc" id="warp__helpers_8h_xhtml_adbdf2ca9e8fe0b67f9359929ef743126"><div class="ttname"><a href="warp__helpers_8h.xhtml#adbdf2ca9e8fe0b67f9359929ef743126">clamp_to_border</a></div><div class="ttdeci">const float8 clamp_to_border(float8 coords, const float width, const float height)</div><div class="ttdoc">Clamps the given coordinates to the borders. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00048">warp_helpers.h:48</a></div></div>
+<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_aac40b7097f2bda9274ae07fa33d15a79"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#aac40b7097f2bda9274ae07fa33d15a79">arm_compute::test::validation::a</a></div><div class="ttdeci">CLTensor a</div><div class="ttdef"><b>Definition:</b> <a href="validation_2_c_l_2_g_e_m_m_8cpp_source.xhtml#l00121">GEMM.cpp:121</a></div></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="namespacearm__compute_xhtml_a1c0b9414fe3a6ef6a7a23bd324ae9e67"><div class="ttname"><a href="namespacearm__compute.xhtml#a1c0b9414fe3a6ef6a7a23bd324ae9e67">arm_compute::clamp</a></div><div class="ttdeci">T clamp(const T &amp;n, const T &amp;lower, const T &amp;upper)</div><div class="ttdoc">Performs clamping among a lower and upper value. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_helpers_8h_source.xhtml#l00193">Helpers.h:193</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="warp__helpers_8h_xhtml_a8eda58d341afa44da00ebf47f9349499"><div class="ttname"><a href="warp__helpers_8h.xhtml#a8eda58d341afa44da00ebf47f9349499">bilinear_interpolate_with_border</a></div><div class="ttdeci">const DATA_TYPE4 bilinear_interpolate_with_border(const Image *in, const float8 coords, const float width, const float height, const float border_size)</div><div class="ttdoc">Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00094">warp_helpers.h:94</a></div></div>
+<div class="ttc" id="namespacearm__compute_1_1utility_xhtml_a12c3c62f510452805c289e180ec78bb7"><div class="ttname"><a href="namespacearm__compute_1_1utility.xhtml#a12c3c62f510452805c289e180ec78bb7">arm_compute::utility::clamp</a></div><div class="ttdeci">T clamp(const T &amp;n, const T &amp;lower, const T &amp;upper)</div><div class="ttdoc">Performs clamping among a lower and upper value. </div><div class="ttdef"><b>Definition:</b> <a href="_utility_8h_source.xhtml#l00084">Utility.h:84</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#l00303">helpers.h:303</a></div></div>
 <div class="ttc" id="helpers_8h_xhtml"><div class="ttname"><a href="helpers_8h.xhtml">helpers.h</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="warp__helpers_8h_xhtml_a2d8047717d6464cad02c5979d09576db"><div class="ttname"><a href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a></div><div class="ttdeci">const float8 get_neighbour_coords(const float2 coord)</div><div class="ttdoc">Given a texel coordinates this function will return the following array of coordinates: [ P...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00068">warp_helpers.h:68</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="warp__helpers_8h_xhtml_aba42442a4c991cdbb52727fa370676f1"><div class="ttname"><a href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a></div><div class="ttdeci">const DATA_TYPE4 read_texels4(const Image *in, const int8 coords)</div><div class="ttdoc">Reads four texels from the input image. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00045">warp_helpers.h:45</a></div></div>
-<div class="ttc" id="warp__helpers_8h_xhtml_a4caaeeb51ea58015267a9974675226d1"><div class="ttname"><a href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a></div><div class="ttdeci">const float2 get_current_coords()</div><div class="ttdoc">Returns the current thread coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00054">warp_helpers.h:54</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 class="ttc" id="warp__helpers_8h_xhtml_abea9f226daf3e0ad741d03cf7417d353"><div class="ttname"><a href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a></div><div class="ttdeci">const DATA_TYPE4 bilinear_interpolate(const Image *in, const float8 coords, const float width, const float height)</div><div class="ttdoc">Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00080">warp_helpers.h:80</a></div></div>
+<div class="ttc" id="warp__helpers_8h_xhtml_a2d8047717d6464cad02c5979d09576db"><div class="ttname"><a href="warp__helpers_8h.xhtml#a2d8047717d6464cad02c5979d09576db">get_neighbour_coords</a></div><div class="ttdeci">const float8 get_neighbour_coords(const float2 coord)</div><div class="ttdoc">Given a texel coordinates this function will return the following array of coordinates: [ P...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00081">warp_helpers.h:81</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#l00142">helpers.h:142</a></div></div>
+<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>
+<div class="ttc" id="warp__helpers_8h_xhtml_aba42442a4c991cdbb52727fa370676f1"><div class="ttname"><a href="warp__helpers_8h.xhtml#aba42442a4c991cdbb52727fa370676f1">read_texels4</a></div><div class="ttdeci">const DATA_TYPE4 read_texels4(const Image *in, const int8 coords)</div><div class="ttdoc">Reads four texels from the input image. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00058">warp_helpers.h:58</a></div></div>
+<div class="ttc" id="warp__helpers_8h_xhtml_aaef9851523cbc6f833700f0eb572002b"><div class="ttname"><a href="warp__helpers_8h.xhtml#aaef9851523cbc6f833700f0eb572002b">clamp_to_border_with_size</a></div><div class="ttdeci">const float8 clamp_to_border_with_size(float8 coords, const float width, const float height, const float border_size)</div><div class="ttdoc">Clamps the given coordinates to the borders according to the border size. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00034">warp_helpers.h:34</a></div></div>
+<div class="ttc" id="warp__helpers_8h_xhtml_a4caaeeb51ea58015267a9974675226d1"><div class="ttname"><a href="warp__helpers_8h.xhtml#a4caaeeb51ea58015267a9974675226d1">get_current_coords</a></div><div class="ttdeci">const float2 get_current_coords()</div><div class="ttdoc">Returns the current thread coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00067">warp_helpers.h:67</a></div></div>
+<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a7b8004eef325a40dd43eb80755610fff"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a7b8004eef325a40dd43eb80755610fff">arm_compute::test::validation::b</a></div><div class="ttdeci">CLTensor b</div><div class="ttdef"><b>Definition:</b> <a href="validation_2_c_l_2_g_e_m_m_8cpp_source.xhtml#l00122">GEMM.cpp:122</a></div></div>
+<div class="ttc" id="warp__helpers_8h_xhtml_abea9f226daf3e0ad741d03cf7417d353"><div class="ttname"><a href="warp__helpers_8h.xhtml#abea9f226daf3e0ad741d03cf7417d353">bilinear_interpolate</a></div><div class="ttdeci">const DATA_TYPE4 bilinear_interpolate(const Image *in, const float8 coords, const float width, const float height)</div><div class="ttdoc">Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers_8h_source.xhtml#l00135">warp_helpers.h:135</a></div></div>
 </div><!-- fragment --></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="warp__helpers_8h.xhtml">warp_helpers.h</a></li>
-    <li class="footer">Generated on Fri Jun 23 2017 15:44:33 for Compute Library by
+    <li class="footer">Generated on Wed May 23 2018 11:36:36 for 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>