OpenJPEG  1.5.1
INT - Implementation of operations on integers

Exported functions (see also openjpeg.h)

static INLINE int int_min (int a, int b)
 Get the minimum of two integers. More...
 
static INLINE int int_max (int a, int b)
 Get the maximum of two integers. More...
 
static INLINE int int_clamp (int a, int min, int max)
 Clamp an integer inside an interval. More...
 
static INLINE int int_abs (int a)
 
static INLINE int int_ceildiv (int a, int b)
 Divide an integer and round upwards. More...
 
static INLINE int int_ceildivpow2 (int a, int b)
 Divide an integer by a power of 2 and round upwards. More...
 
static INLINE int int_floordivpow2 (int a, int b)
 Divide an integer by a power of 2 and round downwards. More...
 
static INLINE int int_floorlog2 (int a)
 Get logarithm of an integer and round downwards. More...
 

Detailed Description

Function Documentation

static INLINE int int_abs ( int  a)
static
Returns
Get absolute value of integer

Referenced by t1_enc_clnpass(), t1_enc_clnpass_step(), t1_enc_refpass_step(), and t1_enc_sigpass_step().

static INLINE int int_ceildiv ( int  a,
int  b 
)
static
static INLINE int int_ceildivpow2 ( int  a,
int  b 
)
static

Divide an integer by a power of 2 and round upwards.

Returns
Returns a divided by 2^b

Referenced by pi_create_decode(), pi_initialise_encode(), tcd_decode_tile(), tcd_init_encode(), tcd_malloc_decode(), tcd_malloc_decode_tile(), and tcd_malloc_encode().

static INLINE int int_clamp ( int  a,
int  min,
int  max 
)
static

Clamp an integer inside an interval.

Returns
  • Returns a if (min < a < max)
  • Returns max if (a > max)
  • Returns min if (a < min)

References min.

Referenced by tcd_decode_tile().

static INLINE int int_floordivpow2 ( int  a,
int  b 
)
static

Divide an integer by a power of 2 and round downwards.

Returns
Returns a divided by 2^b

Referenced by pi_create_decode(), pi_initialise_encode(), pi_next_cprl(), pi_next_pcrl(), pi_next_rpcl(), tcd_init_encode(), tcd_malloc_decode_tile(), and tcd_malloc_encode().

static INLINE int int_floorlog2 ( int  a)
static

Get logarithm of an integer and round downwards.

Returns
Returns log2(a)

Referenced by dwt_encode_stepsize(), j2k_setup_encoder(), t1_encode_cblk(), t2_decode_packet(), and t2_encode_packet().

static INLINE int int_max ( int  a,
int  b 
)
static
static INLINE int int_min ( int  a,
int  b 
)
static