diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2004-07-22 23:38:45 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2004-07-22 23:38:45 (GMT) |
commit | 12ee450f700800de37600494353e39e8be59e928 (patch) | |
tree | 6322357ae75b8e6bfee153606c51888a0ddba583 | |
parent | 77ac102e43b14e397cbbcf4d36973c79b1c0d21d (diff) | |
download | hdf5-12ee450f700800de37600494353e39e8be59e928.zip hdf5-12ee450f700800de37600494353e39e8be59e928.tar.gz hdf5-12ee450f700800de37600494353e39e8be59e928.tar.bz2 |
[svn-r8935]
Purpose: Bug fix
Description: While working on the SZIP documentation with Frank, I realized
that when scanline was less than 4k and bigger than pixels_per_block,
it was not adjusted if number_of_blocks_per_scanline was bigger
than max_number_of_blocks_per_scanline.
Solution: Fixed the code. Unfortunately it didn't help with the problem
I had using h5repack with DOQGROD.he5 file.
Platforms tested: copper
Misc. update:
-rw-r--r-- | src/H5Zszip.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5Zszip.c b/src/H5Zszip.c index df73932..68fcc29 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -134,7 +134,8 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) scanline=dims[ndims-1]; /* Adjust 'scanline' size if it is smaller than number of pixels per block or - if it is bigger than maximum pixels per scanline */ + if it is bigger than maximum pixels per scanline, or number blocks per scanline + is bigger than maximum value */ /* Check the pixels per block against the 'scanline' size */ if(scanline<cd_values[H5Z_SZIP_PARM_PPB]) { @@ -146,13 +147,12 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) if(npoints<cd_values[H5Z_SZIP_PARM_PPB]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "pixels per block greater than total number of elements in the chunk") scanline = MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), npoints); - goto done; + HGOTO_DONE(TRUE); } - - /* Check the scanline's size against the maximum value and adjust 'scanline' - size if necessary */ - if(scanline > SZ_MAX_PIXELS_PER_SCANLINE) + if(scanline <= SZ_MAX_PIXELS_PER_SCANLINE) + scanline = MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), scanline); + else scanline = cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE; done: |