/src/c-blosc2/_deps/zfp-src/src/template/codecf.c
Line | Count | Source |
1 | | #include <limits.h> |
2 | | #include <math.h> |
3 | | |
4 | | /* maximum number of bit planes to encode */ |
5 | | static uint |
6 | | precision(int maxexp, uint maxprec, int minexp, int dims) |
7 | 0 | { |
8 | | #if (ZFP_ROUNDING_MODE != ZFP_ROUND_NEVER) && defined(ZFP_WITH_TIGHT_ERROR) |
9 | | return MIN(maxprec, (uint)MAX(0, maxexp - minexp + 2 * dims + 1)); |
10 | | #else |
11 | 0 | return MIN(maxprec, (uint)MAX(0, maxexp - minexp + 2 * dims + 2)); |
12 | 0 | #endif |
13 | 0 | } Unexecuted instantiation: encode1f.c:precision Unexecuted instantiation: encode1d.c:precision Unexecuted instantiation: decode1f.c:precision Unexecuted instantiation: decode1d.c:precision Unexecuted instantiation: encode2f.c:precision Unexecuted instantiation: encode2d.c:precision Unexecuted instantiation: decode2f.c:precision Unexecuted instantiation: decode2d.c:precision Unexecuted instantiation: encode3f.c:precision Unexecuted instantiation: encode3d.c:precision Unexecuted instantiation: decode3f.c:precision Unexecuted instantiation: decode3d.c:precision Unexecuted instantiation: encode4f.c:precision Unexecuted instantiation: encode4d.c:precision Unexecuted instantiation: decode4f.c:precision Unexecuted instantiation: decode4d.c:precision |
14 | | |
15 | | /* map integer x relative to exponent e to floating-point number */ |
16 | | static Scalar |
17 | | _t1(dequantize, Scalar)(Int x, int e) |
18 | 0 | { |
19 | 0 | return LDEXP((Scalar)x, e - ((int)(CHAR_BIT * sizeof(Scalar)) - 2)); |
20 | 0 | } Unexecuted instantiation: encode1f.c:dequantize_float Unexecuted instantiation: encode1d.c:dequantize_double Unexecuted instantiation: decode1f.c:dequantize_float Unexecuted instantiation: decode1d.c:dequantize_double Unexecuted instantiation: encode2f.c:dequantize_float Unexecuted instantiation: encode2d.c:dequantize_double Unexecuted instantiation: decode2f.c:dequantize_float Unexecuted instantiation: decode2d.c:dequantize_double Unexecuted instantiation: encode3f.c:dequantize_float Unexecuted instantiation: encode3d.c:dequantize_double Unexecuted instantiation: decode3f.c:dequantize_float Unexecuted instantiation: decode3d.c:dequantize_double Unexecuted instantiation: encode4f.c:dequantize_float Unexecuted instantiation: encode4d.c:dequantize_double Unexecuted instantiation: decode4f.c:dequantize_float Unexecuted instantiation: decode4d.c:dequantize_double |
21 | | |
22 | | /* inverse block-floating-point transform from signed integers */ |
23 | | static void |
24 | | _t1(inv_cast, Scalar)(const Int* iblock, Scalar* fblock, uint n, int emax) |
25 | 0 | { |
26 | | /* compute power-of-two scale factor s */ |
27 | 0 | Scalar s = _t1(dequantize, Scalar)(1, emax); |
28 | | /* compute p-bit float x = s*y where |y| <= 2^(p-2) - 1 */ |
29 | 0 | do |
30 | 0 | *fblock++ = (Scalar)(s * *iblock++); |
31 | 0 | while (--n); |
32 | 0 | } Unexecuted instantiation: encode1f.c:inv_cast_float Unexecuted instantiation: encode1d.c:inv_cast_double Unexecuted instantiation: decode1f.c:inv_cast_float Unexecuted instantiation: decode1d.c:inv_cast_double Unexecuted instantiation: encode2f.c:inv_cast_float Unexecuted instantiation: encode2d.c:inv_cast_double Unexecuted instantiation: decode2f.c:inv_cast_float Unexecuted instantiation: decode2d.c:inv_cast_double Unexecuted instantiation: encode3f.c:inv_cast_float Unexecuted instantiation: encode3d.c:inv_cast_double Unexecuted instantiation: decode3f.c:inv_cast_float Unexecuted instantiation: decode3d.c:inv_cast_double Unexecuted instantiation: encode4f.c:inv_cast_float Unexecuted instantiation: encode4d.c:inv_cast_double Unexecuted instantiation: decode4f.c:inv_cast_float Unexecuted instantiation: decode4d.c:inv_cast_double |