compression
Mark Koennecke
Mark.Koennecke at psi.ch
Wed Nov 24 07:55:14 GMT 1999
High together,
The compression topic has come up recently again in the NeXus mailing
lists. In order to solve this I propose the following additions to the
NAPI:
- three additional defines:
NX_LZW, NX_RLE and NX_HUFF
which indicate the compression type to use when storing data.
- an additional API function with the signature:
int NXcompress(NXhandle hfil, int compr_type);
hfil is the usual NeXus file handle, compr_type is one of the three
defines for the compression type.
There is no need to bother about compression when reading data. (This is
the way HDF deals with it) At the writing end the usage sequence would
be:
NXopendata(......)
NXcompres(.......)
NXputdata(....)
which means that NXcompress only acts upon an open SDS.
I implemented and tested this for the C API. I noticed that you need
release 3 of HDF4 in order to make it work. HDF4 release 1 failed me!
The last time I looked HDF 5 did not support compression. Both RLE (
run length encoding) and LZW (the deflate algorithm as used in gzip and
available as library) could be implemented within a reasonable amount
of time without help from the HDF library. I therefore recommend
restricting ourselves to these two schemes.
If I do not receive screams of pain and terror about this I will submit
these changes to the NeXus repository on Friday, thereby incrementing
the version number to 1.2.2.
Any comments?
Mark
More information about the NeXus-developers
mailing list