HDF5 supports gzip (deflate), Szip, n-bit, scale-offset, and shuffling (with deflate) compression filters. See section 5.4.2 and 5.6 in the Datasets chapter of the HDF5 User's Guide for more information on Data Pipeline Filters. See the HDF5 Software Documentation page for more information.
Examples of using filters can be found under the examples By API, accessible from the HDF5 Examples page. (See the Datasets section on the C Examples by API page.)
Users can also register their own compression filters with HDF5. For information see: Contributions
See Using Compression in HDF5 for a variety of links and information on compression.