mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
[svn-r7126] Purpose:
Code cleanup Description: Add in rest of szip "options mask" macros that were missing. Also made "raw" options mask set by the library, instead of requiring users to always set it. Platforms tested: FreeBSD 4.8 (sleipnir) Minor tweaks too small fo h5committest
This commit is contained in:
parent
82a89d2c18
commit
70db25c561
@ -1020,6 +1020,13 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block)
|
||||
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE)))
|
||||
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
|
||||
|
||||
/* Always set "raw" (no szip header) flag for data */
|
||||
options_mask |= H5_SZIP_RAW_OPTION_MASK;
|
||||
|
||||
/* Mask off the LSB and MSB options, if they were given */
|
||||
/* (The HDF5 library sets them internally, as needed) */
|
||||
options_mask &= ~(H5_SZIP_LSB_OPTION_MASK|H5_SZIP_MSB_OPTION_MASK);
|
||||
|
||||
/* Set the parameters for the filter */
|
||||
cd_values[0]=options_mask;
|
||||
cd_values[1]=pixels_per_block;
|
||||
|
@ -30,6 +30,14 @@ typedef struct {
|
||||
unsigned *cd_values; /*client data values */
|
||||
} H5Z_filter_info_t;
|
||||
|
||||
/* Special parameters for szip compression */
|
||||
/* [These are aliases for the similar definitions in szlib.h, which we can't
|
||||
* include directly due to the duplication of various symbols with the zlib.h
|
||||
* header file] */
|
||||
#define H5_SZIP_LSB_OPTION_MASK 8
|
||||
#define H5_SZIP_MSB_OPTION_MASK 16
|
||||
#define H5_SZIP_RAW_OPTION_MASK 128
|
||||
|
||||
struct H5O_pline_t; /*forward decl*/
|
||||
|
||||
/* Internal API routines */
|
||||
|
@ -51,8 +51,10 @@ typedef int H5Z_filter_t;
|
||||
/* [These are aliases for the similar definitions in szlib.h, which we can't
|
||||
* include directly due to the duplication of various symbols with the zlib.h
|
||||
* header file] */
|
||||
#define H5_SZIP_RAW_OPTION_MASK 128
|
||||
#define H5_SZIP_NN_OPTION_MASK 32
|
||||
#define H5_SZIP_ALLOW_K13_OPTION_MASK 1
|
||||
#define H5_SZIP_CHIP_OPTION_MASK 2
|
||||
#define H5_SZIP_EC_OPTION_MASK 4
|
||||
#define H5_SZIP_NN_OPTION_MASK 32
|
||||
#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32
|
||||
|
||||
/* Values to decide if EDC is enabled for reading data */
|
||||
|
@ -250,8 +250,13 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
|
||||
|
||||
/* Sanity check to make certain that we haven't drifted out of date with
|
||||
* the mask options from the szlib.h header */
|
||||
assert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK);
|
||||
assert(H5_SZIP_ALLOW_K13_OPTION_MASK==SZ_ALLOW_K13_OPTION_MASK);
|
||||
assert(H5_SZIP_CHIP_OPTION_MASK==SZ_CHIP_OPTION_MASK);
|
||||
assert(H5_SZIP_EC_OPTION_MASK==SZ_EC_OPTION_MASK);
|
||||
assert(H5_SZIP_LSB_OPTION_MASK==SZ_LSB_OPTION_MASK);
|
||||
assert(H5_SZIP_MSB_OPTION_MASK==SZ_MSB_OPTION_MASK);
|
||||
assert(H5_SZIP_NN_OPTION_MASK==SZ_NN_OPTION_MASK);
|
||||
assert(H5_SZIP_RAW_OPTION_MASK==SZ_RAW_OPTION_MASK);
|
||||
|
||||
/* Check arguments */
|
||||
if (cd_nelmts!=4)
|
||||
|
@ -1637,7 +1637,7 @@ test_filters(hid_t file)
|
||||
|
||||
#ifdef H5_HAVE_FILTER_SZIP
|
||||
hsize_t szip_size; /* Size of dataset with szip filter */
|
||||
unsigned szip_options_mask=H5_SZIP_RAW_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
|
||||
unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK;
|
||||
unsigned szip_pixels_per_block=4;
|
||||
#endif /* H5_HAVE_FILTER_SZIP */
|
||||
|
||||
@ -2587,7 +2587,7 @@ file)
|
||||
hid_t dsid; /* Dataset ID */
|
||||
hid_t sid; /* Dataspace ID */
|
||||
hid_t dcpl; /* Dataspace creation property list ID */
|
||||
unsigned szip_options_mask=H5_SZIP_RAW_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
|
||||
unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK;
|
||||
unsigned szip_pixels_per_block;
|
||||
const hsize_t dims[2] = {500, 4096}; /* Dataspace dimensions */
|
||||
const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */
|
||||
|
Loading…
Reference in New Issue
Block a user