<ahref="opj__intmath_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/*</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> * The copyright in this software is being made available under the 2-clauses</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment"> * BSD License, included below. This software may be subject to other third</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> * party and contributor rights, including patent rights, and no such rights</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * are granted under this license.</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment"> * Copyright (c) 2002-2014, Professor Benoit Macq</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment"> * Copyright (c) 2001-2003, David Janssens</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment"> * Copyright (c) 2002-2003, Yannick Verschueren</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> * Copyright (c) 2003-2007, Francois-Olivier Devaux</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> * Copyright (c) 2003-2014, Antonin Descampe</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> * Copyright (c) 2005, Herve Drolon, FreeImage Team</span></div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"> * All rights reserved.</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> * Redistribution and use in source and binary forms, with or without</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> * modification, are permitted provided that the following conditions</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment"> * are met:</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment"> * 1. Redistributions of source code must retain the above copyright</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment"> * notice, this list of conditions and the following disclaimer.</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment"> * notice, this list of conditions and the following disclaimer in the</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment"> * documentation and/or other materials provided with the distribution.</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment"> * THIS SOFTWARE IS PROVIDED BY THE
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gaac315c40dca690742df538fcc21d4f91"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gaac315c40dca690742df538fcc21d4f91">opj_int_min</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b)</div><divclass="ttdoc">Get the minimum of two integers. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:56</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gabdf6c78f5b60afd230901e5e0c57f491"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gabdf6c78f5b60afd230901e5e0c57f491">opj_int_floordivpow2</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b)</div><divclass="ttdoc">Divide an integer by a power of 2 and round downwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:207</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gae4b2e5a7c8b8f09faacc4a895f866ea1"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gae4b2e5a7c8b8f09faacc4a895f866ea1">opj_uint_ceildiv</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Divide an integer and round upwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:170</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga6881e82a881556059d14d265a8d0aa25"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga6881e82a881556059d14d265a8d0aa25">opj_int64_ceildivpow2</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b)</div><divclass="ttdoc">Divide a 64bits integer by a power of 2 and round upwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:189</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gaaa1e441dec325d33ccd86aa7ca8ccfdc"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gaaa1e441dec325d33ccd86aa7ca8ccfdc">opj_int_ceildivpow2</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b)</div><divclass="ttdoc">Divide an integer by a power of 2 and round upwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:180</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga06c1c4470f9765a3ed04963b0daa111a"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga06c1c4470f9765a3ed04963b0daa111a">opj_uint_min</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Get the minimum of two integers. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:65</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gaa6a55d57af96308459f6de414227ae40"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gaa6a55d57af96308459f6de414227ae40">opj_int_floorlog2</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a)</div><divclass="ttdoc">Get logarithm of an integer and round downwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:225</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga91ef25eaa56320684de5d1e3a4097823"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga91ef25eaa56320684de5d1e3a4097823">opj_uint_floorlog2</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a)</div><divclass="ttdoc">Get logarithm of an integer and round downwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:237</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga2f7d5c3934ee6be38763652b7f80ea6c"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga2f7d5c3934ee6be38763652b7f80ea6c">opj_int_max</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b)</div><divclass="ttdoc">Get the maximum of two integers. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:74</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gae592eb75f221decddec51834b6c4177d"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gae592eb75f221decddec51834b6c4177d">opj_uint_ceildivpow2</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Divide an integer by a power of 2 and round upwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:198</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga20a9a9e2aee9a99897131989b4a9e7e9"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga20a9a9e2aee9a99897131989b4a9e7e9">opj_int64_clamp</a></div><divclass="ttdeci">static INLINE OPJ_INT64 opj_int64_clamp(OPJ_INT64 a, OPJ_INT64 min, OPJ_INT64 max)</div><divclass="ttdoc">Clamp an integer inside an interval. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:137</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga2c3eb35fddab83fef25256485b926fc0"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga2c3eb35fddab83fef25256485b926fc0">opj_uint_max</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Get the maximum of two integers. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:83</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gab00a7c3619b5af7595961047baff120e"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gab00a7c3619b5af7595961047baff120e">opj_int_ceildiv</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)</div><divclass="ttdoc">Divide an integer and round upwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:160</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_ga6972ea9bd03fb83a3421e2578fa486f1"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#ga6972ea9bd03fb83a3421e2578fa486f1">opj_uint_floordivpow2</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_floordivpow2(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Divide an integer by a power of 2 and round downwards. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:216</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gaefb4572107a9aea093be96d966869a0d"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gaefb4572107a9aea093be96d966869a0d">opj_int_clamp</a></div><divclass="ttdeci">static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min, OPJ_INT32 max)</div><divclass="ttdoc">Clamp an integer inside an interval. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:116</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gaef70413f6c794150eec1fc019b4de2d4"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gaef70413f6c794150eec1fc019b4de2d4">opj_uint_subs</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_subs(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Get the saturated difference of two unsigned integers. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:102</div></div>
<divclass="ttc"id="group___o_p_j___i_n_t_m_a_t_h_html_gab9aad885f5c9bc9e39420003b2b32fe5"><divclass="ttname"><ahref="group___o_p_j___i_n_t_m_a_t_h.html#gab9aad885f5c9bc9e39420003b2b32fe5">opj_uint_adds</a></div><divclass="ttdeci">static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b)</div><divclass="ttdoc">Get the saturated sum of two unsigned integers. </div><divclass="ttdef"><b>Definition:</b> opj_intmath.h:92</div></div>