OpenJPEG 1.5.2
int.h File Reference

Implementation of operations on integers (INT). More...

Go to the source code of this file.

Functions

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

Detailed Description

Implementation of operations on integers (INT).

The functions in INT.H have for goal to realize operations on integers.

Function Documentation

◆ int_abs()

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

References INLINE, and int_abs().

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

◆ int_ceildiv()

INLINE int int_ceildiv ( int a,
int b )
static

◆ int_ceildivpow2()

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

References INLINE, and int_ceildivpow2().

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

◆ int_clamp()

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 INLINE, int_clamp(), and min.

Referenced by int_clamp(), and tcd_decode_tile().

◆ int_floordivpow2()

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

References INLINE, and int_floordivpow2().

Referenced by int_floordivpow2(), 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().

◆ int_floorlog2()

INLINE int int_floorlog2 ( int a)
static

Get logarithm of an integer and round downwards.

Returns
Returns log2(a)

References INLINE.

◆ int_max()

INLINE int int_max ( int a,
int b )
static

◆ int_min()

INLINE int int_min ( int a,
int b )
static

Get the minimum of two integers.

Returns
Returns a if a < b else b

References INLINE.