Repository navigation
Expand file tree
/
Copy pathdecode1.c
More file actions
53 lines (47 loc) · 1.46 KB
/
Copy pathdecode1.c
File metadata and controls
53 lines (47 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* private functions ------------------------------------------------------- */
/* scatter 4-value block to strided array */
static void
_t2(scatter, Scalar, 1)(const Scalar* q, Scalar* p, ptrdiff_t sx)
{
uint x;
for (x = 0; x < 4; x++, p += sx)
*p = *q++;
}
/* scatter nx-value block to strided array */
static void
_t2(scatter_partial, Scalar, 1)(const Scalar* q, Scalar* p, size_t nx, ptrdiff_t sx)
{
size_t x;
for (x = 0; x < nx; x++, p += sx)
*p = *q++;
}
/* inverse decorrelating 1D transform */
static void
_t2(inv_xform, Int, 1)(Int* p)
{
/* transform along x */
_t1(inv_lift, Int)(p, 1);
}
/* public functions -------------------------------------------------------- */
/* decode 4-value block and store at p using stride sx */
size_t
_t2(zfp_decode_block_strided, Scalar, 1)(zfp_stream* stream, Scalar* p, ptrdiff_t sx)
{
/* decode contiguous block */
cache_align_(Scalar block[4]);
size_t bits = _t2(zfp_decode_block, Scalar, 1)(stream, block);
/* scatter block to strided array */
_t2(scatter, Scalar, 1)(block, p, sx);
return bits;
}
/* decode nx-value block and store at p using stride sx */
size_t
_t2(zfp_decode_partial_block_strided, Scalar, 1)(zfp_stream* stream, Scalar* p, size_t nx, ptrdiff_t sx)
{
/* decode contiguous block */
cache_align_(Scalar block[4]);
size_t bits = _t2(zfp_decode_block, Scalar, 1)(stream, block);
/* scatter block to strided array */
_t2(scatter_partial, Scalar, 1)(block, p, nx, sx);
return bits;
}