High Level SZIP APIs

Proposed New High Level SZIP API functions

Two new high level SZIP API functions are proposed. First one attempts to compress data in the source buffer into the destination buffer, the second one attempts to decompress data in the source buffer into the destination buffer. Both functions use complete SZIP data stream. These two functions will facilitate integration of SZIP compression method with the HDF5 Library.


Name: SZ_szBufftoBuffCompress
Signature:
int SZ_szBufftoBuffCompress(void * dest, size_t * destLen, const void * source, size_t sourceLen, SZ_com_t *param )
Purpose:
Compress the data in the source buffer into the destination buffer.
Description:
SZ_szBufftoBuffCompress attempts to compress the data in source buffer into dest buffer. If destination buffer is big enough, *destLen is set to the size of the compressed data, and SZ_OK is returned. Otherwise, *destLen is unchanged and SZ_OUTBUFF_FULL is returned. The resulting compressed data is a complete SZIP format data stream. param is a structure of type SZ_com_t with parameters that may control compression.
Parameters:
void * dest
OUT: Destination buffer
size_t * destLen
IN/OUT: Size of the destination buffer; on return is a length of compressed data if successful
const void * source
IN: Source buffer
size_t sourceLen
IN: Length of the source buffer in bytes
SZ_com_t * param
IN: Structure with parameters to control compression; NULL may be passed for default values.
Returns:
SZ_CONFIG_ERROR if the library has been mis-compiled
SZ_PARAM_ERROR if there is an error in parameters list
SZ_MEM_ERROR if unsufficient memory is available
SZ_OUTBUF_FULL if size of compressed data bigger than *destLen
SZ_??? other returned values (specify if needed)
SZ_OK if successful

Name: SZ_szBufftoBuffDecompress
Signature:
int SZ_szBufftoBuffDecompress(void * dest, size_t * destLen, const void * source, size_t sourceLen, SZ_decom_t *param )
Purpose:
Decompress the data in the source buffer into the destination buffer.
Description:
SZ_szBufftoBuffdecompress attempts to decompress the data in source buffer into dest buffer. If destination buffer is big enough, *destLen is set to the size of the uncompressed data, and SZ_OK is returned. Otherwise, *destLen is unchanged and SZ_OUTBUFF_FULL is returned. It is assumed that source holds complete compressed SZIP data stream. param is a structure of type SZ_decom_t with parameters that may control decompression.
Parameters:
void * dest
OUT: Destination buffer
size_t * destLen
IN/OUT: Size of the destination buffer; on return is a length of uncompressed data if successful
const void * source
IN: Source buffer
size_t sourceLen
IN: Length of the source buffer in bytes
SZ_decom_t * param
IN: Structure with parameters to control decompression; NULL may be passed for default values.
Returns:
SZ_CONFIG_ERROR if the library has been mis-compiled
SZ_PARAM_ERROR if there is an error in parameters list
SZ_MEM_ERROR if unsufficient memory is available
SZ_OUTBUF_FULL if size of uncompressed data bigger than *destLen
SZ_UNEXPECTED_EOF if compressed data iends unexpectedly
SZ_??? other returned values (specify if needed)
SZ_OK if successful

Elena Pourmal
Last modified: December 11, 2002