io.h File Reference

Input/output of compressed wavelet coefficients. More...


Defines

#define wv_VERSION   "3.4.0"
 Version number as string.
#define wv_VERNUM   0x0340
 Version number as integer.

Functions

int wv_query_header (const int NumChannels, t_wv_channel *Channel[])
 Returns the size of the header in bits (for the given channels).
int wv_query_scheduler (const int NumChannels, t_wv_channel *Channel[], const double TargetMSE[], const int MaxBits, const int MinBits[], double EstimatedMSE[], int EstimatedBits[])
 Queries the scheduler what sort of mean-square error would be achieved.
int wv_encode (const int NumChannels, t_wv_channel *Channel[], const double TargetMSE[], const int MaxBits, const int MinBits[], t_bit_file *BF)
 Encodes a number of channels progressively interleaved into a given file which can later be read by wv_decode().
t_wv_header * wv_read_header (t_wv_header *Header, t_bit_file *BF)
 Reads the header written by wv_encode().
int wv_decode (const t_wv_header *Header, int Reduction, t_wv_channel *Channel[wv_MAX_CHANNELS+1], t_bit_file *BF)
 Decodes channels written by wv_encode() to a file back to a t_wv_channel.


Detailed Description

Input/output of compressed wavelet coefficients.


Define Documentation

#define wv_VERNUM   0x0340

Version number as integer.

#define wv_VERSION   "3.4.0"

Version number as string.


Function Documentation

int wv_decode ( const t_wv_header *  Header,
int  Reduction,
t_wv_channel Channel[wv_MAX_CHANNELS+1],
t_bit_file BF 
)

Decodes channels written by wv_encode() to a file back to a t_wv_channel.

The channels returned by this function can be written again by wv_encode(), but the bit-estimate will be incorrect and actual output will differ. Also, no estimated errors are available. Thus using wv_channel_set_max_mse() or the relative equivalent on these channels is not recommended.

Parameters:
[in] Header If the header was already read manually, a pointer to it, if NULL, the header is read from the file BF.
[in] Reduction Indicates how often to halve the dimensions of the stored channels (until the smaller of width and height is 2). Although this is a very natural thing to do with wavelet coding, the completely embedded structure of the files does not allow this to be of the highest quality in the file as we have to stop as soon as the first bitplane of a higher-resolution block is encountered.
[out] Channel Array receiving the returned number of t_wv_channel* pointers.
[in] BF Bit-file handle to read from. If Header != NULL, it has to be aligned directly after the header, otherwise on the header.
Returns:
Number of channels decoded, 0 on failure.

int wv_encode ( const int  NumChannels,
t_wv_channel Channel[],
const double  TargetMSE[],
const int  MaxBits,
const int  MinBits[],
t_bit_file BF 
)

Encodes a number of channels progressively interleaved into a given file which can later be read by wv_decode().

As each channel has to have the same dimensions, they also have the same amount of blocks. The blocks are ordered by the scheduler to always give the best quality improvement per bit spent.

Parameters:
[in] NumChannels # of channels in Channel.
[in] Channel NumChannels pointers to t_wv_channel, which actually treated as const (so they are used read-only). Not declared as const due http://c-faq.com/ansi/constmismatch.html. Need identical dimensions.
[in] TargetMSE NumChannels doubles that prescribe the target mean- square for each given channel. If the value is non-negative then it is an absolute value which is strictly required (i.e. the method will return with an error-code if it cannot be achieved), if it is negative then it is a relative value that is resolved (if possible) with its closest absolute neighbour, first checked on the right, then on the left side.
[in] MaxBits Bits allocated for data (including the header!), 0 ^= infinite bits.
[in] MinBits Minimum number of bits spent on each channel. These is interpreted as a hard constraint, and failure to satisfy them results in failure, unless the channel had fewer bits to start with. This number will be rounded up depending on the granularity of the blocks.
[in] BF Bit-file handle to be written to, must have been opened with the correct number of bits (otherwise the file will be too big).
Returns:
Number of bits written (or -1 on failure to satisfy constraints).

int wv_query_header ( const int  NumChannels,
t_wv_channel Channel[] 
)

Returns the size of the header in bits (for the given channels).

Parameters:
[in] NumChannels # of channels in Channel.
[in] Channel NumChannels pointers to t_wv_channel, which actually treated as const (so they are used read-only). Not declared as const due http://c-faq.com/ansi/constmismatch.html. Need identical dimensions.
Returns:
Number of bits used for the header (or -1 on failure).

int wv_query_scheduler ( const int  NumChannels,
t_wv_channel Channel[],
const double  TargetMSE[],
const int  MaxBits,
const int  MinBits[],
double  EstimatedMSE[],
int  EstimatedBits[] 
)

Queries the scheduler what sort of mean-square error would be achieved.

Parameters:
[in] NumChannels # of channels in Channel.
[in] Channel NumChannels pointers to t_wv_channel, which actually treated as const (so they are used read-only). Not declared as const due http://c-faq.com/ansi/constmismatch.html. Need identical dimensions.
[in] TargetMSE NumChannels doubles that prescribe the target mean- square for each given channel. If the value is non-negative then it is an absolute value which is strictly required (i.e. the method will return with an error-code if it cannot be achieved), if it is negative then it is a relative value that is resolved (if possible) with its closest absolute neighbour, first checked on the right, then on the left side.
[in] MaxBits Bits allocated to compressed data, 0 ^= infinite bits.
[in] MinBits Minimum number of bits spent on each channel. These is interpreted as a hard constraint, and failure to satisfy them results in failure, unless the channel had fewer bits to start with. This number will be rounded up depending on the granularity of the blocks.
[out] EstimatedMSE Estimated Mean-square error achieved for each channel.
[out] EstimatedBits Estimated bits used for each channel.
Returns:
Number of bits used (or -1 on failure to satisfy constraints).

t_wv_header* wv_read_header ( t_wv_header *  Header,
t_bit_file BF 
)

Reads the header written by wv_encode().

Parameters:
[in] Header Store the header information here (only valid if non-NULL was returned).
[in] BF Bit-file handle to try to read header from.
Returns:
Header on success or NULL on failure to find a valid header.


Generated on Tue Jul 10 20:44:34 2007 for wavelet by  doxygen 1.5.2