Last modified: 20 June 2013
Name: H5Pset_deflate
Signature:
herr_t H5Pset_deflate( hid_t plist_id, uint level )

Purpose:
Sets deflate (GNU gzip) compression method and compression level.

Description:
H5Pset_deflate sets the deflate compression method and the compression level, level for a dataset or group creation property list, plist_id.

The filter identifier set in the propertly list is H5Z_FILTER_DEFLATE.

The compression level, level, is a value from zero to nine, inclusive. A compression level of 0 (zero) indicates no compression; compression improves but speed slows progressively from levels 1 through 9:

  Compression level          Gzip action
  0   No compression
  1   Best compression speed; least compression
  2 through 8   Compression improves; speed degrades
  9   Best compression ratio; slowest speed

Note that setting the compression level to 0 (zero) does not turn off use of the gzip filter; it simply sets the filter to perform no compression as it processes the data.

HDF5 relies on GNU gzip for this compression (see zlib).

Parameters:
hid_t plist_id     IN: Dataset or group creation property list identifier.
uint level IN: Compression level.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5pset_deflate_f
SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
  INTEGER, INTENT(IN)        :: level  ! Compression level 
  INTEGER, INTENT(OUT)       :: hdferr ! Error code
                                       ! 0 on success and -1 on failure
END SUBROUTINE h5pset_deflate_f
        

History:
Release     Change
1.8.5 Function extended to work with group creation property lists.