From 70db25c5614b515edac40bff118fb6462e6e0415 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 30 Jun 2003 14:47:40 -0500 Subject: [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 --- src/H5Pdcpl.c | 7 +++++++ src/H5Zprivate.h | 8 ++++++++ src/H5Zpublic.h | 6 ++++-- src/H5Zszip.c | 7 ++++++- test/dsets.c | 4 ++-- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 7da0afc..e43e916 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -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; diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 84b2eeb..103aeff 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -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 */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index c455700..1463598 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -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 */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index aa83469..bf3bcda 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -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) diff --git a/test/dsets.c b/test/dsets.c index 12883b9..dbe215b 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -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 */ -- cgit v0.12