Sets deflate (GNU gzip) compression method and compression level


H5P_SET_DEFLATE ( plist_id, level )


<pre><code class="language-c">herr_t H5Pset_deflate(
        hid_t plist_id,
        uint level

<pre><code class="language-fortran">Fortran90 Interface: h5pset_deflate_f
SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) 
  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

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


H5P_SET_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 property 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 levelGzip action
0No compression
1Best compression speed; least compression
2 through 8Compression improves; speed degrades
9Best 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.


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

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