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. |
#define wv_VERNUM 0x0340 |
Version number as integer.
#define wv_VERSION "3.4.0" |
Version number as string.
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.
[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. |
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.
[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). |
int wv_query_header | ( | const int | NumChannels, | |
t_wv_channel * | Channel[] | |||
) |
Returns the size of the header in bits (for the given channels).
[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. |
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.
[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. |
t_wv_header* wv_read_header | ( | t_wv_header * | Header, | |
t_bit_file * | BF | |||
) |
Reads the header written by wv_encode().
[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. |