openjpeg/doxygen/opj__intmath_8h_source.html

297 lines
56 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenJPEG: opj_intmath.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OpenJPEG
&#160;<span id="projectnumber">2.5.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="dir_cb9b2b419d92b64f7cee83d8faf7a4ab.html">even</a></li><li class="navelem"><a class="el" href="dir_f75d9a0165d6564a1e04793ef847d41d.html">openjpeg</a></li><li class="navelem"><a class="el" href="dir_5f588d7ea139c1aae751d03c13a16064.html">openjpeg</a></li><li class="navelem"><a class="el" href="dir_378f732e812ef6cbaaae22e96a4fa79f.html">src</a></li><li class="navelem"><a class="el" href="dir_19dcb5713315405a27e1bde75a489a4c.html">lib</a></li><li class="navelem"><a class="el" href="dir_54e5bc4f0640fea590afaf04f4d9c88d.html">openjp2</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">opj_intmath.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="opj__intmath_8h.html">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"> * The copyright in this software is being made available under the 2-clauses</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * BSD License, included below. This software may be subject to other third</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * party and contributor rights, including patent rights, and no such rights</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * are granted under this license.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * Copyright (c) 2002-2014, Professor Benoit Macq</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * Copyright (c) 2001-2003, David Janssens</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * Copyright (c) 2002-2003, Yannick Verschueren</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * Copyright (c) 2003-2007, Francois-Olivier Devaux</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * Copyright (c) 2003-2014, Antonin Descampe</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * Copyright (c) 2005, Herve Drolon, FreeImage Team</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * All rights reserved.</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"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * modification, are permitted provided that the following conditions</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * are met:</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> * 1. Redistributions of source code must retain the above copyright</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment"> * notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment"> * notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment"> * documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS&#39;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="comment"> * POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#ifndef OPJ_INTMATH_H</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#define OPJ_INTMATH_H</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">/* ----------------------------------------------------------------------- */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#aac315c40dca690742df538fcc21d4f91"> 56</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#aac315c40dca690742df538fcc21d4f91">opj_int_min</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</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; <span class="keywordflow">return</span> a &lt; b ? a : b;</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; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a06c1c4470f9765a3ed04963b0daa111a"> 65</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#a06c1c4470f9765a3ed04963b0daa111a">opj_uint_min</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;{</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">return</span> a &lt; b ? a : b;</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; </div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a2f7d5c3934ee6be38763652b7f80ea6c"> 74</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#a2f7d5c3934ee6be38763652b7f80ea6c">opj_int_max</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;{</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">return</span> (a &gt; b) ? a : b;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;}</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a2c3eb35fddab83fef25256485b926fc0"> 83</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#a2c3eb35fddab83fef25256485b926fc0">opj_uint_max</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</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; <span class="keywordflow">return</span> (a &gt; b) ? a : b;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;}</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#ab9aad885f5c9bc9e39420003b2b32fe5"> 92</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#ab9aad885f5c9bc9e39420003b2b32fe5">opj_uint_adds</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;{</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <a class="code" href="openjpeg_8h.html#ad915cf26c4c9cc10a75b2d9287dbbb5e">OPJ_UINT64</a> sum = (<a class="code" href="openjpeg_8h.html#ad915cf26c4c9cc10a75b2d9287dbbb5e">OPJ_UINT64</a>)a + (<a class="code" href="openjpeg_8h.html#ad915cf26c4c9cc10a75b2d9287dbbb5e">OPJ_UINT64</a>)b;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>)(-(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>)(sum &gt;&gt; 32)) | (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>)sum;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;}</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#aef70413f6c794150eec1fc019b4de2d4"> 102</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#aef70413f6c794150eec1fc019b4de2d4">opj_uint_subs</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;{</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> (a &gt;= b) ? a - b : 0;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;}</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#aefb4572107a9aea093be96d966869a0d"> 116</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#aefb4572107a9aea093be96d966869a0d">opj_int_clamp</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a>,</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a>)</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;{</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">if</span> (a &lt; <a class="code" href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a>) {</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordflow">return</span> <a class="code" href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a>;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; }</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">if</span> (a &gt; <a class="code" href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a>) {</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordflow">return</span> <a class="code" href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a>;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; }</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordflow">return</span> a;</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="l00137"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a20a9a9e2aee9a99897131989b4a9e7e9"> 137</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> <a class="code" href="opj__intmath_8h.html#a20a9a9e2aee9a99897131989b4a9e7e9">opj_int64_clamp</a>(<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> a, <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> <a class="code" href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a>,</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> <a class="code" href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a>)</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;{</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordflow">if</span> (a &lt; <a class="code" href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a>) {</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">return</span> <a class="code" href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a>;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; }</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">if</span> (a &gt; <a class="code" href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a>) {</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">return</span> <a class="code" href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a>;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; }</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordflow">return</span> a;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;}</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#acaef279a9031adbd9319990646328a01"> 152</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#acaef279a9031adbd9319990646328a01">opj_int_abs</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a)</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;{</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">return</span> a &lt; 0 ? -a : a;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;}</div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#ab00a7c3619b5af7595961047baff120e"> 160</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#ab00a7c3619b5af7595961047baff120e">opj_int_ceildiv</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;{</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; assert(b);</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>)(((<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)a + b - 1) / b);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;}</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#ae4b2e5a7c8b8f09faacc4a895f866ea1"> 170</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#ae4b2e5a7c8b8f09faacc4a895f866ea1">opj_uint_ceildiv</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;{</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; assert(b);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>)(((<a class="code" href="openjpeg_8h.html#ad915cf26c4c9cc10a75b2d9287dbbb5e">OPJ_UINT64</a>)a + b - 1) / b);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;}</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#aaa1e441dec325d33ccd86aa7ca8ccfdc"> 180</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#aaa1e441dec325d33ccd86aa7ca8ccfdc">opj_int_ceildivpow2</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;{</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>)((a + ((<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)1 &lt;&lt; b) - 1) &gt;&gt; b);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;}</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a6881e82a881556059d14d265a8d0aa25"> 189</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#a6881e82a881556059d14d265a8d0aa25">opj_int64_ceildivpow2</a>(<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;{</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>)((a + ((<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)1 &lt;&lt; b) - 1) &gt;&gt; b);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;}</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; </div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#ae592eb75f221decddec51834b6c4177d"> 198</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#ae592eb75f221decddec51834b6c4177d">opj_uint_ceildivpow2</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;{</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>)((a + ((<a class="code" href="openjpeg_8h.html#ad915cf26c4c9cc10a75b2d9287dbbb5e">OPJ_UINT64</a>)1U &lt;&lt; b) - 1U) &gt;&gt; b);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;}</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#abdf6c78f5b60afd230901e5e0c57f491"> 207</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#abdf6c78f5b60afd230901e5e0c57f491">opj_int_floordivpow2</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;{</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">return</span> a &gt;&gt; b;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;}</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; </div>
<div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a6972ea9bd03fb83a3421e2578fa486f1"> 216</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#a6972ea9bd03fb83a3421e2578fa486f1">opj_uint_floordivpow2</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a, <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> b)</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;{</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">return</span> a &gt;&gt; b;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;}</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#aa6a55d57af96308459f6de414227ae40"> 225</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#aa6a55d57af96308459f6de414227ae40">opj_int_floorlog2</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a)</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;{</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> l;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordflow">for</span> (l = 0; a &gt; 1; l++) {</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; a &gt;&gt;= 1;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; }</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordflow">return</span> l;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;}</div>
<div class="line"><a name="l00237"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a91ef25eaa56320684de5d1e3a4097823"> 237</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> <a class="code" href="opj__intmath_8h.html#a91ef25eaa56320684de5d1e3a4097823">opj_uint_floorlog2</a>(<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> a)</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;{</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> l;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">for</span> (l = 0; a &gt; 1; ++l) {</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; a &gt;&gt;= 1;</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; }</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="keywordflow">return</span> l;</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;}</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#aa2130d6482126a20e6680f82b254857b"> 252</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#aa2130d6482126a20e6680f82b254857b">opj_int_fix_mul</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;{</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="preprocessor">#if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1400) &amp;&amp; !defined(__INTEL_COMPILER) &amp;&amp; defined(_M_IX86)</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> temp = __emul(a, b);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> temp = (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>) a * (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>) b ;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; temp += 4096;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; assert((temp &gt;&gt; 13) &lt;= (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)0x7FFFFFFF);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; assert((temp &gt;&gt; 13) &gt;= (-(<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)0x7FFFFFFF - (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)1));</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>)(temp &gt;&gt; 13);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;}</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; </div>
<div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a5ce489e764483d741e8953475341ba14"> 265</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#a5ce489e764483d741e8953475341ba14">opj_int_fix_mul_t1</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;{</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="preprocessor">#if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1400) &amp;&amp; !defined(__INTEL_COMPILER) &amp;&amp; defined(_M_IX86)</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> temp = __emul(a, b);</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a> temp = (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>) a * (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>) b ;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; temp += 4096;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; assert((temp &gt;&gt; (13 + 11 - <a class="code" href="t1_8h.html#a46ab5a09928a8d3872a6128d5aa80ca1">T1_NMSEDEC_FRACBITS</a>)) &lt;= (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)0x7FFFFFFF);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; assert((temp &gt;&gt; (13 + 11 - <a class="code" href="t1_8h.html#a46ab5a09928a8d3872a6128d5aa80ca1">T1_NMSEDEC_FRACBITS</a>)) &gt;= (-(<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)0x7FFFFFFF -</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; (<a class="code" href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a>)1));</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>)(temp &gt;&gt; (13 + 11 - <a class="code" href="t1_8h.html#a46ab5a09928a8d3872a6128d5aa80ca1">T1_NMSEDEC_FRACBITS</a>)) ;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;}</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a384853368e8aae9b2b5130746bed0566"> 286</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#a384853368e8aae9b2b5130746bed0566">opj_int_add_no_overflow</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;{</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordtype">void</span>* pa = &amp;a;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordtype">void</span>* pb = &amp;b;</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>* upa = (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>*)pa;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>* upb = (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>*)pb;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> ures = *upa + *upb;</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordtype">void</span>* pures = &amp;ures;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>* ipres = (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>*)pures;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="keywordflow">return</span> *ipres;</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160;}</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="opj__intmath_8h.html#a4f7a6ab779e13fa2116b4b820173190d"> 305</a></span>&#160;<span class="keyword">static</span> <a class="code" href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a> <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> <a class="code" href="opj__intmath_8h.html#a4f7a6ab779e13fa2116b4b820173190d">opj_int_sub_no_overflow</a>(<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> a, <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a> b)</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;{</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordtype">void</span>* pa = &amp;a;</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="keywordtype">void</span>* pb = &amp;b;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>* upa = (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>*)pa;</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>* upb = (<a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a>*)pb;</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <a class="code" href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a> ures = *upa - *upb;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="keywordtype">void</span>* pures = &amp;ures;</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>* ipres = (<a class="code" href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a>*)pures;</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">return</span> *ipres;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;}</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; </div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;<span class="comment">/* ----------------------------------------------------------------------- */</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; </div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* OPJ_INTMATH_H */</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aopj__intmath_8h_html_a6881e82a881556059d14d265a8d0aa25"><div class="ttname"><a href="opj__intmath_8h.html#a6881e82a881556059d14d265a8d0aa25">opj_int64_ceildivpow2</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b)</div><div class="ttdoc">Divide a 64bits integer by a power of 2 and round upwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:189</div></div>
<div class="ttc" id="aopj__intmath_8h_html_acaef279a9031adbd9319990646328a01"><div class="ttname"><a href="opj__intmath_8h.html#acaef279a9031adbd9319990646328a01">opj_int_abs</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a)</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:152</div></div>
<div class="ttc" id="aopj__intmath_8h_html_aa6a55d57af96308459f6de414227ae40"><div class="ttname"><a href="opj__intmath_8h.html#aa6a55d57af96308459f6de414227ae40">opj_int_floorlog2</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a)</div><div class="ttdoc">Get logarithm of an integer and round downwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:225</div></div>
<div class="ttc" id="aopj__intmath_8h_html_aac315c40dca690742df538fcc21d4f91"><div class="ttname"><a href="opj__intmath_8h.html#aac315c40dca690742df538fcc21d4f91">opj_int_min</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Get the minimum of two integers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:56</div></div>
<div class="ttc" id="aopj__intmath_8h_html_ae4b2e5a7c8b8f09faacc4a895f866ea1"><div class="ttname"><a href="opj__intmath_8h.html#ae4b2e5a7c8b8f09faacc4a895f866ea1">opj_uint_ceildiv</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Divide an integer and round upwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:170</div></div>
<div class="ttc" id="aopenjpeg_8h_html_a871a81193cb4972db35948edd67360bd"><div class="ttname"><a href="openjpeg_8h.html#a871a81193cb4972db35948edd67360bd">OPJ_INT64</a></div><div class="ttdeci">int64_t OPJ_INT64</div><div class="ttdef"><b>Definition:</b> openjpeg.h:133</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a6972ea9bd03fb83a3421e2578fa486f1"><div class="ttname"><a href="opj__intmath_8h.html#a6972ea9bd03fb83a3421e2578fa486f1">opj_uint_floordivpow2</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_floordivpow2(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Divide an integer by a power of 2 and round downwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:216</div></div>
<div class="ttc" id="aopenjpeg_8h_html_a2eb6f9e0395b47b8d5e3eeae4fe0c116"><div class="ttname"><a href="openjpeg_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">INLINE</a></div><div class="ttdeci">#define INLINE</div><div class="ttdef"><b>Definition:</b> openjpeg.h:65</div></div>
<div class="ttc" id="aopj__intmath_8h_html_aa2130d6482126a20e6680f82b254857b"><div class="ttname"><a href="opj__intmath_8h.html#aa2130d6482126a20e6680f82b254857b">opj_int_fix_mul</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Multiply two fixed-precision rational numbers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:252</div></div>
<div class="ttc" id="aopj__intmath_8h_html_ab9aad885f5c9bc9e39420003b2b32fe5"><div class="ttname"><a href="opj__intmath_8h.html#ab9aad885f5c9bc9e39420003b2b32fe5">opj_uint_adds</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Get the saturated sum of two unsigned integers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:92</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a5ce489e764483d741e8953475341ba14"><div class="ttname"><a href="opj__intmath_8h.html#a5ce489e764483d741e8953475341ba14">opj_int_fix_mul_t1</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:265</div></div>
<div class="ttc" id="aopenjpeg_8h_html_ad915cf26c4c9cc10a75b2d9287dbbb5e"><div class="ttname"><a href="openjpeg_8h.html#ad915cf26c4c9cc10a75b2d9287dbbb5e">OPJ_UINT64</a></div><div class="ttdeci">uint64_t OPJ_UINT64</div><div class="ttdef"><b>Definition:</b> openjpeg.h:134</div></div>
<div class="ttc" id="aopenjpeg_8h_html_a3cec91ef9e73677f0dbd60d4e42401b9"><div class="ttname"><a href="openjpeg_8h.html#a3cec91ef9e73677f0dbd60d4e42401b9">OPJ_INT32</a></div><div class="ttdeci">int32_t OPJ_INT32</div><div class="ttdef"><b>Definition:</b> openjpeg.h:131</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a91ef25eaa56320684de5d1e3a4097823"><div class="ttname"><a href="opj__intmath_8h.html#a91ef25eaa56320684de5d1e3a4097823">opj_uint_floorlog2</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a)</div><div class="ttdoc">Get logarithm of an integer and round downwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:237</div></div>
<div class="ttc" id="aindex__manager_8c_html_aecefdbf80129b12f2ef66ccfbedbb7fe"><div class="ttname"><a href="index__manager_8c.html#aecefdbf80129b12f2ef66ccfbedbb7fe">max</a></div><div class="ttdeci">Byte4_t max(Byte4_t n1, Byte4_t n2)</div><div class="ttdef"><b>Definition:</b> index_manager.c:774</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a20a9a9e2aee9a99897131989b4a9e7e9"><div class="ttname"><a href="opj__intmath_8h.html#a20a9a9e2aee9a99897131989b4a9e7e9">opj_int64_clamp</a></div><div class="ttdeci">static INLINE OPJ_INT64 opj_int64_clamp(OPJ_INT64 a, OPJ_INT64 min, OPJ_INT64 max)</div><div class="ttdoc">Clamp an integer inside an interval.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:137</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a06c1c4470f9765a3ed04963b0daa111a"><div class="ttname"><a href="opj__intmath_8h.html#a06c1c4470f9765a3ed04963b0daa111a">opj_uint_min</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Get the minimum of two integers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:65</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a2c3eb35fddab83fef25256485b926fc0"><div class="ttname"><a href="opj__intmath_8h.html#a2c3eb35fddab83fef25256485b926fc0">opj_uint_max</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Get the maximum of two integers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:83</div></div>
<div class="ttc" id="aopj__intmath_8h_html_aef70413f6c794150eec1fc019b4de2d4"><div class="ttname"><a href="opj__intmath_8h.html#aef70413f6c794150eec1fc019b4de2d4">opj_uint_subs</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_subs(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Get the saturated difference of two unsigned integers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:102</div></div>
<div class="ttc" id="aindex__manager_8c_html_ac1d9c713f42b405f9e353ec99b880755"><div class="ttname"><a href="index__manager_8c.html#ac1d9c713f42b405f9e353ec99b880755">min</a></div><div class="ttdeci">Byte4_t min(Byte4_t n1, Byte4_t n2)</div><div class="ttdef"><b>Definition:</b> index_manager.c:783</div></div>
<div class="ttc" id="at1_8h_html_a46ab5a09928a8d3872a6128d5aa80ca1"><div class="ttname"><a href="t1_8h.html#a46ab5a09928a8d3872a6128d5aa80ca1">T1_NMSEDEC_FRACBITS</a></div><div class="ttdeci">#define T1_NMSEDEC_FRACBITS</div><div class="ttdef"><b>Definition:</b> t1.h:68</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a2f7d5c3934ee6be38763652b7f80ea6c"><div class="ttname"><a href="opj__intmath_8h.html#a2f7d5c3934ee6be38763652b7f80ea6c">opj_int_max</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Get the maximum of two integers.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:74</div></div>
<div class="ttc" id="aopj__intmath_8h_html_aefb4572107a9aea093be96d966869a0d"><div class="ttname"><a href="opj__intmath_8h.html#aefb4572107a9aea093be96d966869a0d">opj_int_clamp</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min, OPJ_INT32 max)</div><div class="ttdoc">Clamp an integer inside an interval.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:116</div></div>
<div class="ttc" id="aopj__intmath_8h_html_abdf6c78f5b60afd230901e5e0c57f491"><div class="ttname"><a href="opj__intmath_8h.html#abdf6c78f5b60afd230901e5e0c57f491">opj_int_floordivpow2</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Divide an integer by a power of 2 and round downwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:207</div></div>
<div class="ttc" id="aopj__intmath_8h_html_ae592eb75f221decddec51834b6c4177d"><div class="ttname"><a href="opj__intmath_8h.html#ae592eb75f221decddec51834b6c4177d">opj_uint_ceildivpow2</a></div><div class="ttdeci">static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b)</div><div class="ttdoc">Divide an integer by a power of 2 and round upwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:198</div></div>
<div class="ttc" id="aopj__intmath_8h_html_ab00a7c3619b5af7595961047baff120e"><div class="ttname"><a href="opj__intmath_8h.html#ab00a7c3619b5af7595961047baff120e">opj_int_ceildiv</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Divide an integer and round upwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:160</div></div>
<div class="ttc" id="aopenjpeg_8h_html_a4cb1e6e6b6ef2df499d5c02f7df54cbb"><div class="ttname"><a href="openjpeg_8h.html#a4cb1e6e6b6ef2df499d5c02f7df54cbb">OPJ_UINT32</a></div><div class="ttdeci">uint32_t OPJ_UINT32</div><div class="ttdef"><b>Definition:</b> openjpeg.h:132</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a384853368e8aae9b2b5130746bed0566"><div class="ttname"><a href="opj__intmath_8h.html#a384853368e8aae9b2b5130746bed0566">opj_int_add_no_overflow</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_add_no_overflow(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Addition two signed integers with a wrap-around behaviour.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:286</div></div>
<div class="ttc" id="aopj__intmath_8h_html_aaa1e441dec325d33ccd86aa7ca8ccfdc"><div class="ttname"><a href="opj__intmath_8h.html#aaa1e441dec325d33ccd86aa7ca8ccfdc">opj_int_ceildivpow2</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Divide an integer by a power of 2 and round upwards.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:180</div></div>
<div class="ttc" id="aopj__intmath_8h_html_a4f7a6ab779e13fa2116b4b820173190d"><div class="ttname"><a href="opj__intmath_8h.html#a4f7a6ab779e13fa2116b4b820173190d">opj_int_sub_no_overflow</a></div><div class="ttdeci">static INLINE OPJ_INT32 opj_int_sub_no_overflow(OPJ_INT32 a, OPJ_INT32 b)</div><div class="ttdoc">Subtract two signed integers with a wrap-around behaviour.</div><div class="ttdef"><b>Definition:</b> opj_intmath.h:305</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>