#include <errno.h>
#include <math.h>
#include <assert.h>
#include <vector>
#include "bit/exceptions.hh"
Go to the source code of this file.
Namespaces | |
namespace | bit |
Typedefs | |
typedef unsigned int | bit::u32 |
Unsigned 32-bit type. | |
typedef signed int | bit::s32 |
Signed 32-bit type. | |
typedef unsigned long long | bit::u64 |
Unsigned 64-bit type. | |
typedef unsigned long long | bit::s64 |
Signed 64-bit type. | |
Functions | |
u64 | bit::bytes_required (u64 num_elems, unsigned int bits_per_elem) |
The number of 8-bit bytes required to store a number of fixed-width elements. | |
unsigned int | bit::highest_bit (u64 value) |
The number of highest non-zero bit. | |
unsigned int | bit::float2uint (float f) |
Convert float to 32-bit integer representation. | |
float | bit::uint2float (unsigned int i) |
Restore float from 32-bit integer representation. | |
float | bit::unquantize_float (u32 i, double step) |
Restore a quantized float value using linear quantization centered around zero. | |
u32 | bit::quantize_float (float f, double step) |
Quantize float value using linear quantization centered around zero. | |
Variables | |
static const unsigned int | bit::max_bits_per_value = 32 |
Maximum value width in bits. | |
static const u32 | bit::max_u32 = (u32)-1 |
Maximum value of u64 type. | |
static const s32 | bit::max_s32 = 0x7fffffff |
Maximum value of s32 type. | |
static const u64 | bit::max_u64 = (u64)-1 |
Maximum value of u64 type. | |
static const unsigned int | bit::one_masks [] |
Bit-masks containin n lowest bits set to one. | |
static const int | bit::shift [] = { 0, 8, 16, 24, 32 } |
Bit-shifts for byte positions. |