36static inline bool is_power_of_2(
long x) {
return x != 0 && (x & (x - 1)) == 0; }
61 float x1 = fabsf(x +
clip);
62 float x2 = fabsf(x -
clip);
89 if ((r >= 0) && (i >= 0))
91 else if ((r < 0) && (i >= 0))
93 else if ((r < 0) && (i < 0))
102 unsigned int ret = 0;
103 if (fabsf(r) > fabsf(i)) {
133 unsigned int ret = 0;
134 ret = (fabsf(r) > fabsf(i)) * (((r < 0) << 0x1));
135 ret |= (fabsf(i) > fabsf(r)) * (((i < 0) << 0x1) | 0x1);
148 ret |= ((i <= 0) << 1);
149 return (ret ^ ((ret & 0x2) >> 0x1));
162static inline size_t p2_round_down(
size_t x,
size_t pow2) {
return x & -pow2; }
179static inline size_t p2_modulo(
size_t x,
size_t pow2) {
return x & (pow2 - 1); }
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
std::complex< float > gr_complex
Definition: gr_complex.h:27
GR_RUNTIME_API float fast_atan2f(float y, float x)
Fast arc tangent using table lookup and linear interpolation.
Include this header to use the message passing features.
Definition: basic_block.h:45
static unsigned int binary_slicer(float x)
Definition: math.h:78
static unsigned int branchless_quad_45deg_slicer(float r, float i)
Definition: math.h:145
static unsigned int quad_0deg_slicer(float r, float i)
Definition: math.h:100
static size_t p2_round_up(size_t x, size_t pow2)
Definition: math.h:169
static unsigned int quad_45deg_slicer(float r, float i)
Definition: math.h:86
static float clip(float x, float clip)
Definition: math.h:67
static size_t p2_round_down(size_t x, size_t pow2)
Definition: math.h:162
static unsigned int branchless_quad_0deg_slicer(float r, float i)
Definition: math.h:131
static size_t p2_modulo_neg(size_t x, size_t pow2)
Definition: math.h:186
static float branchless_clip(float x, float clip)
Definition: math.h:59
static unsigned int branchless_binary_slicer(float x)
Definition: math.h:129
static bool is_power_of_2(long x)
Definition: math.h:36
static size_t p2_modulo(size_t x, size_t pow2)
Definition: math.h:179