wvBitstreamEncode returns a bitstream representation of the
(regular) basis.
wvBitstreamDecode returns the (regular) basis, represented by
bitstream, for a matrix of size. The size is not stored in
the bitstream, since often the application already knows the size.
When this is not the case, the application can store the size explicitly
in conjunction with the bitstream.
wvDestroyBitstream frees the memory used by bitstream. It is
the application programmer's responsibility to free this memory (by calling
this function).
A pair of utility functions are provided to read and write (regular) basis
directly to or from an open stream (file) in bitstream format:
wvFWriteBasisToBitstream() and wvFReadBasisFromBitstream().
The process of creating a bitstream from a basis and then reconstructing a
basis from that bitstream is completely lossless if the coefficients are
integers. This is normally accomplished by quantizing the basis, or
performing a similar operation. Representing the original basis (before
quantizing) isn't useful in any event, since most of the coefficients,
although small, may not be zero.
The bitstream structure is defined in <wv/enc_bitstream.h>
as follows:
typedef struct _WVbitstream {
WVcoefArray *coef;
WVbitArray *sign;
WVbitArray *spatial_hi;
WVbitArray *spatial_lo;
WVbitArray *freq;
} WVbitstream;