| 1 |
=============================== |
| 2 |
LZF filter for HDF5, revision 3 |
| 3 |
=============================== |
| 4 |
|
| 5 |
The LZF filter provides high-speed compression with acceptable compression |
| 6 |
performance, resulting in much faster performance than DEFLATE, at the |
| 7 |
cost of a slightly lower compression ratio. It's appropriate for large |
| 8 |
datasets of low to moderate complexity, for which some compression is |
| 9 |
much better than none, but for which the speed of DEFLATE is unacceptable. |
| 10 |
|
| 11 |
This filter has been tested against HDF5 versions 1.6.5 through 1.8.3. It |
| 12 |
is released under the BSD license (see LICENSE.txt for details). |
| 13 |
|
| 14 |
|
| 15 |
Using the filter from HDF5 |
| 16 |
-------------------------- |
| 17 |
|
| 18 |
There is exactly one new public function declared in lzf_filter.h, with |
| 19 |
the following signature: |
| 20 |
|
| 21 |
int register_lzf(void) |
| 22 |
|
| 23 |
Calling this will register the filter with the HDF5 library. A non-negative |
| 24 |
return value indicates success. If the registration fails, an error is pushed |
| 25 |
onto the current error stack and a negative value is returned. |
| 26 |
|
| 27 |
It's strongly recommended to use the SHUFFLE filter with LZF, as it's |
| 28 |
cheap, supported by all current versions of HDF5, and can significantly |
| 29 |
improve the compression ratio. An example C program ("example.c") is included |
| 30 |
which demonstrates the proper use of the filter. |
| 31 |
|
| 32 |
|
| 33 |
Compiling |
| 34 |
--------- |
| 35 |
|
| 36 |
The filter consists of a single .c file and header, along with an embedded |
| 37 |
version of the LZF compression library. Since the filter is stateless, it's |
| 38 |
recommended to statically link the entire thing into your program; for |
| 39 |
example: |
| 40 |
|
| 41 |
$ gcc -O2 -lhdf5 lzf/*.c lzf_filter.c myprog.c -o myprog |
| 42 |
|
| 43 |
It can also be built as a shared library, although you will have to install |
| 44 |
the resulting library somewhere the runtime linker can find it: |
| 45 |
|
| 46 |
$ gcc -O2 -lhdf5 -fPIC -shared lzf/*.c lzf_filter.c -o liblzf_filter.so |
| 47 |
|
| 48 |
A similar procedure should be used for building C++ code. As in these |
| 49 |
examples, using option -O1 or higher is strongly recommended for increased |
| 50 |
performance. |
| 51 |
|
| 52 |
|
| 53 |
Contact |
| 54 |
------- |
| 55 |
|
| 56 |
This filter is maintained as part of the HDF5 for Python (h5py) project. The |
| 57 |
goal of h5py is to provide access to the majority of the HDF5 C API and feature |
| 58 |
set from Python. The most recent version of h5py (1.1) includes the LZF |
| 59 |
filter by default. |
| 60 |
|
| 61 |
* Downloads and bug tracker: http://h5py.googlecode.com |
| 62 |
|
| 63 |
* Main web site and documentation: http://h5py.alfven.org |
| 64 |
|
| 65 |
* Contact email: h5py at alfven dot org |
| 66 |
|
| 67 |
|
| 68 |
History of changes |
| 69 |
------------------ |
| 70 |
|
| 71 |
Revision 3 (6/25/09) |
| 72 |
Fix issue with changed filter struct definition under HDF5 1.8.3. |
| 73 |
|
| 74 |
Revision 2 |
| 75 |
Minor speed enhancement. |
| 76 |
|
| 77 |
Revision 1 |
| 78 |
Initial release. |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|