-
Notifications
You must be signed in to change notification settings - Fork 10
API: C API: Functions
SPERR C API supports 3 different compression modes: 1) fixed-bpp, 2) fixed-psnr, and 3) fixed-pwe.
The intended compression mode to use, thus, is passed to the C API by an integer:
mode == 1 means fixed-bpp
mode == 2 means fixed-psnr
mode == 3 means fixed-pwe
Any other mode numbers passed in will result in an error.
A pair of functions provide support for fixed-size compression in 2D:
-
sperr_comp_2d()
takes in a 2D slice and produces a compressed bitstream. -
sperr_decomp_2d()
decompresses a bitstream and reconstructs a 2D slice.
Each of his pair of functions takes a relatively long list of parameters, and the best place to look up their meanings is the C header.
Note that this page documents the memory model of SPERR output, and this example code demonstrates the usage of 2D compression and decompression.
Again, a pair of functions provide support for compression and decompression in 3D:
-
sperr_comp_3d()
compresses a 3D volume and produces a compressed bitstream. -
sperr_decomp_3d()
decompresses a bitstream and reconstructs a 3D volume.
Each of his pair of functions takes a relatively long list of parameters, and the best place to look up their meanings is the C header.
Note that this page documents the memory model of SPERR output, and this example code demonstrates the usage of 3D compression and decompression.
A 3D SPERR bitstream can be simply truncated to take less space and still valid for decompression, only at a lower quality.
Function sperr_trunc_3d()
performs this task.
Lossy Scientific data compression with SPERR