Grok 10.0.5
Macros | Functions
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,
 
)    ((a) + ((b)-1)) / (b)

◆ round_down

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

◆ round_up

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

Function Documentation

◆ count_leading_zeros()

static uint32_t count_leading_zeros ( const uint32_t  x)
inlinestatic

◆ int_log2()

static uint32_t int_log2 ( const uint32_t  x)
inlinestatic

Referenced by count_leading_zeros().

◆ popcount32()

static size_t popcount32 ( uintmax_t  num)
inlinestatic

Referenced by htj2k_encode().