/src/c-blosc2/plugins/codecs/zfp/src/template/decompress.c
Line | Count | Source |
1 | | /* decompress 1d contiguous array */ |
2 | | static void |
3 | | _t2(decompress, Scalar, 1)(zfp_stream* stream, zfp_field* field) |
4 | 0 | { |
5 | 0 | Scalar* data = (Scalar*)field->data; |
6 | 0 | size_t nx = field->nx; |
7 | 0 | size_t mx = nx & ~3u; |
8 | 0 | size_t x; |
9 | | |
10 | | /* decompress array one block of 4 values at a time */ |
11 | 0 | for (x = 0; x < mx; x += 4, data += 4) |
12 | 0 | _t2(zfp_decode_block, Scalar, 1)(stream, data); |
13 | 0 | if (x < nx) |
14 | 0 | _t2(zfp_decode_partial_block_strided, Scalar, 1)(stream, data, nx - x, 1); |
15 | 0 | } Unexecuted instantiation: zfp.c:decompress_int32_1 Unexecuted instantiation: zfp.c:decompress_int64_1 Unexecuted instantiation: zfp.c:decompress_float_1 Unexecuted instantiation: zfp.c:decompress_double_1 |
16 | | |
17 | | /* decompress 1d strided array */ |
18 | | static void |
19 | | _t2(decompress_strided, Scalar, 1)(zfp_stream* stream, zfp_field* field) |
20 | 0 | { |
21 | 0 | Scalar* data = field->data; |
22 | 0 | size_t nx = field->nx; |
23 | 0 | ptrdiff_t sx = field->sx ? field->sx : 1; |
24 | 0 | size_t x; |
25 | | |
26 | | /* decompress array one block of 4 values at a time */ |
27 | 0 | for (x = 0; x < nx; x += 4) { |
28 | 0 | Scalar* p = data + sx * (ptrdiff_t)x; |
29 | 0 | if (nx - x < 4) |
30 | 0 | _t2(zfp_decode_partial_block_strided, Scalar, 1)(stream, p, nx - x, sx); |
31 | 0 | else |
32 | 0 | _t2(zfp_decode_block_strided, Scalar, 1)(stream, p, sx); |
33 | 0 | } |
34 | 0 | } Unexecuted instantiation: zfp.c:decompress_strided_int32_1 Unexecuted instantiation: zfp.c:decompress_strided_int64_1 Unexecuted instantiation: zfp.c:decompress_strided_float_1 Unexecuted instantiation: zfp.c:decompress_strided_double_1 |
35 | | |
36 | | /* decompress 2d strided array */ |
37 | | static void |
38 | | _t2(decompress_strided, Scalar, 2)(zfp_stream* stream, zfp_field* field) |
39 | 0 | { |
40 | 0 | Scalar* data = (Scalar*)field->data; |
41 | 0 | size_t nx = field->nx; |
42 | 0 | size_t ny = field->ny; |
43 | 0 | ptrdiff_t sx = field->sx ? field->sx : 1; |
44 | 0 | ptrdiff_t sy = field->sy ? field->sy : (ptrdiff_t)nx; |
45 | 0 | size_t x, y; |
46 | | |
47 | | /* decompress array one block of 4x4 values at a time */ |
48 | 0 | for (y = 0; y < ny; y += 4) |
49 | 0 | for (x = 0; x < nx; x += 4) { |
50 | 0 | Scalar* p = data + sx * (ptrdiff_t)x + sy * (ptrdiff_t)y; |
51 | 0 | if (nx - x < 4 || ny - y < 4) |
52 | 0 | _t2(zfp_decode_partial_block_strided, Scalar, 2)(stream, p, MIN(nx - x, 4u), MIN(ny - y, 4u), sx, sy); |
53 | 0 | else |
54 | 0 | _t2(zfp_decode_block_strided, Scalar, 2)(stream, p, sx, sy); |
55 | 0 | } |
56 | 0 | } Unexecuted instantiation: zfp.c:decompress_strided_int32_2 Unexecuted instantiation: zfp.c:decompress_strided_int64_2 Unexecuted instantiation: zfp.c:decompress_strided_float_2 Unexecuted instantiation: zfp.c:decompress_strided_double_2 |
57 | | |
58 | | /* decompress 3d strided array */ |
59 | | static void |
60 | | _t2(decompress_strided, Scalar, 3)(zfp_stream* stream, zfp_field* field) |
61 | 0 | { |
62 | 0 | Scalar* data = (Scalar*)field->data; |
63 | 0 | size_t nx = field->nx; |
64 | 0 | size_t ny = field->ny; |
65 | 0 | size_t nz = field->nz; |
66 | 0 | ptrdiff_t sx = field->sx ? field->sx : 1; |
67 | 0 | ptrdiff_t sy = field->sy ? field->sy : (ptrdiff_t)nx; |
68 | 0 | ptrdiff_t sz = field->sz ? field->sz : (ptrdiff_t)(nx * ny); |
69 | 0 | size_t x, y, z; |
70 | | |
71 | | /* decompress array one block of 4x4x4 values at a time */ |
72 | 0 | for (z = 0; z < nz; z += 4) |
73 | 0 | for (y = 0; y < ny; y += 4) |
74 | 0 | for (x = 0; x < nx; x += 4) { |
75 | 0 | Scalar* p = data + sx * (ptrdiff_t)x + sy * (ptrdiff_t)y + sz * (ptrdiff_t)z; |
76 | 0 | if (nx - x < 4 || ny - y < 4 || nz - z < 4) |
77 | 0 | _t2(zfp_decode_partial_block_strided, Scalar, 3)(stream, p, MIN(nx - x, 4u), MIN(ny - y, 4u), MIN(nz - z, 4u), sx, sy, sz); |
78 | 0 | else |
79 | 0 | _t2(zfp_decode_block_strided, Scalar, 3)(stream, p, sx, sy, sz); |
80 | 0 | } |
81 | 0 | } Unexecuted instantiation: zfp.c:decompress_strided_int32_3 Unexecuted instantiation: zfp.c:decompress_strided_int64_3 Unexecuted instantiation: zfp.c:decompress_strided_float_3 Unexecuted instantiation: zfp.c:decompress_strided_double_3 |
82 | | |
83 | | /* decompress 4d strided array */ |
84 | | static void |
85 | | _t2(decompress_strided, Scalar, 4)(zfp_stream* stream, zfp_field* field) |
86 | 0 | { |
87 | 0 | Scalar* data = field->data; |
88 | 0 | size_t nx = field->nx; |
89 | 0 | size_t ny = field->ny; |
90 | 0 | size_t nz = field->nz; |
91 | 0 | size_t nw = field->nw; |
92 | 0 | ptrdiff_t sx = field->sx ? field->sx : 1; |
93 | 0 | ptrdiff_t sy = field->sy ? field->sy : (ptrdiff_t)nx; |
94 | 0 | ptrdiff_t sz = field->sz ? field->sz : (ptrdiff_t)(nx * ny); |
95 | 0 | ptrdiff_t sw = field->sw ? field->sw : (ptrdiff_t)(nx * ny * nz); |
96 | 0 | size_t x, y, z, w; |
97 | | |
98 | | /* decompress array one block of 4x4x4x4 values at a time */ |
99 | 0 | for (w = 0; w < nw; w += 4) |
100 | 0 | for (z = 0; z < nz; z += 4) |
101 | 0 | for (y = 0; y < ny; y += 4) |
102 | 0 | for (x = 0; x < nx; x += 4) { |
103 | 0 | Scalar* p = data + sx * (ptrdiff_t)x + sy * (ptrdiff_t)y + sz * (ptrdiff_t)z + sw * (ptrdiff_t)w; |
104 | 0 | if (nx - x < 4 || ny - y < 4 || nz - z < 4 || nw - w < 4) |
105 | 0 | _t2(zfp_decode_partial_block_strided, Scalar, 4)(stream, p, MIN(nx - x, 4u), MIN(ny - y, 4u), MIN(nz - z, 4u), MIN(nw - w, 4u), sx, sy, sz, sw); |
106 | 0 | else |
107 | 0 | _t2(zfp_decode_block_strided, Scalar, 4)(stream, p, sx, sy, sz, sw); |
108 | 0 | } |
109 | 0 | } Unexecuted instantiation: zfp.c:decompress_strided_int32_4 Unexecuted instantiation: zfp.c:decompress_strided_int64_4 Unexecuted instantiation: zfp.c:decompress_strided_float_4 Unexecuted instantiation: zfp.c:decompress_strided_double_4 |