36 return (uint32_t)((
a + (uint64_t)b - 1) / b);
42 return (T)((
a + ((uint64_t)1 << b) - 1) >> b);
66static inline int32_t
fix_mul(int32_t
a, int32_t b)
68#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
69 int64_t temp = __emul(
a, b);
71 int64_t temp = (int64_t)
a * (int64_t)b;
74 assert((temp >> 13) <= (int64_t)0x7FFFFFFF);
75 assert((temp >> 13) >= (-(int64_t)0x7FFFFFFF - (int64_t)1));
78 return (int32_t)(temp >> 13);
uint32_t a
only used by MQ decoder
Definition mqc.h:48
Copyright (C) 2016-2023 Grok Image Compression Inc.
Definition ICacheable.h:20
uint32_t ceildiv(T a, T b)
Divide an integer by another integer and round upwards.
Definition grk_intmath.h:33
static uint32_t floordivpow2(uint32_t a, uint32_t b)
Divide an unsigned integer by a power of 2 and round downwards.
Definition grk_intmath.h:48
static int32_t fix_mul(int32_t a, int32_t b)
Multiply two fixed-point numbers.
Definition grk_intmath.h:66
uint8_t floorlog2(uint32_t a)
Get logarithm of an integer and round downwards.
Definition grk_intmath.cpp:22
T ceildivpow2(T a, uint32_t b)
Definition grk_intmath.h:40