utils.hpp File Reference
`#include <cstdint>`
`#include <cstdlib>`
`#include <x86intrin.h>`

Go to the source code of this file.

## Macros

#define | round_up(x, n) (((x) + (n)-1) & (-n))
#define | round_down(x, n) ((x) & (-n))
#define | ceil_int(a, b) ((a) + ((b)-1)) / (b)

## Functions

static size_t | popcount32 (uintmax_t num)
static uint32_t | int_log2 (const uint32_t x)
static uint32_t | count_leading_zeros (const uint32_t x)

## Macro Definition Documentation

## ceil_int

#define ceil_int | ( |  | a,
|  |  | b
| ) |  | ((a) + ((b)-1)) / (b)

## round_down

#define round_down | ( |  | x,
|  |  | n
| ) |  | ((x) & (-n))

## round_up

#define round_up | ( |  | x,
|  |  | n
| ) |  | (((x) + (n)-1) & (-n))

## Function Documentation

## count_leading_zeros()

static uint32_t count_leading_zeros | ( | const uint32_t | x | ) |

inline static

References int_log2().

Referenced by ht_cleanup_decode(), make_storage(), and make_storage_one().

## int_log2()

static uint32_t int_log2 | ( | const uint32_t | x | ) |

inline static

Referenced by count_leading_zeros().

## popcount32()

static size_t popcount32 | ( | uintmax_t | num | ) |

inline static

Referenced by htj2k_encode().