static void
_t2(scatter, Scalar, 2)(const Scalar* q, Scalar* p, ptrdiff_t sx, ptrdiff_t sy)
{
uint x, y;
for (y = 0; y < 4; y++, p += sy - 4 * sx)
for (x = 0; x < 4; x++, p += sx)
*p = *q++;
}
static void
_t2(scatter_partial, Scalar, 2)(const Scalar* q, Scalar* p, size_t nx, size_t ny, ptrdiff_t sx, ptrdiff_t sy)
{
size_t x, y;
for (y = 0; y < ny; y++, p += sy - (ptrdiff_t)nx * sx, q += 4 - nx)
for (x = 0; x < nx; x++, p += sx, q++)
*p = *q;
}
static void
_t2(inv_xform, Int, 2)(Int* p)
{
uint x, y;
for (x = 0; x < 4; x++)
_t1(inv_lift, Int)(p + 1 * x, 4);
for (y = 0; y < 4; y++)
_t1(inv_lift, Int)(p + 4 * y, 1);
}
size_t
_t2(zfp_decode_block_strided, Scalar, 2)(zfp_stream* stream, Scalar* p, ptrdiff_t sx, ptrdiff_t sy)
{
cache_align_(Scalar block[16]);
size_t bits = _t2(zfp_decode_block, Scalar, 2)(stream, block);
_t2(scatter, Scalar, 2)(block, p, sx, sy);
return bits;
}
size_t
_t2(zfp_decode_partial_block_strided, Scalar, 2)(zfp_stream* stream, Scalar* p, size_t nx, size_t ny, ptrdiff_t sx, ptrdiff_t sy)
{
cache_align_(Scalar block[16]);
size_t bits = _t2(zfp_decode_block, Scalar, 2)(stream, block);
_t2(scatter_partial, Scalar, 2)(block, p, nx, ny, sx, sy);
return bits;
}