int QccWAVtceEncode(const
QccIMGImageComponent *image, int num_levels, int target_bit_cnt, double
stepsize, const QccWAVWavelet *wavelet, QccBitBuffer *output_buffer);
int QccWAVtceDecodeHeader(QccBitBuffer *input_buffer, int *num_levels,
int *num_rows, int *num_cols, double *image_mean, double *stepsize, int
*max_coefficient_bits);
int QccWAVtceDecode(QccBitBuffer *input_buffer,
QccIMGImageComponent *image, int num_levels, const QccWAVWavelet *wavelet,
double image_mean, double stepsize, int max_coefficient_bits, int target_bit_cnt);
QccWAVtceEncode() encodes an image component, image, using the TCE algorithm by Tian and Hemami. The TCE (tarp coding using classification to achieve embedding) algorithm is based on the tarp algorithm (see QccWAVTarpEncode(3) ), but is designed to provide better rate-distortion performance when used in an embedded fashion; i.e., when decoding is performed at a rate less than that at which the bitstream was produced. See "ALGORITHM" below for more detail.
image is the image component to be coded and output_buffer is the output bitstream. output_buffer must be of QCCBITBUFFER_OUTPUT type and opened via a prior call to QccBitBufferStart(3) .
num_levels gives the number of levels of dyadic wavelet decomposition to perform, and wavelet is the wavelet to use for decomposition.
Two encoding modes are supported. Mode 1 consists of first applying a scalar quantizer to all DWT coefficients and then encoding the coefficients, bitplane by bitplane, until all bitplanes are encoded. Mode 2 consists of direct bitplane encoding without any scalar quantization of coefficients; in this mode, encoding stops when the target bitrate is reached. Mode 1 is selected by specifying a quantization stepsize that is greater than zero. If stepsize is less than or equal to zero, then Mode 2 is selected. In this case, a target encoding bit count, target_bit_cnt must be specified.
QccWAVtceDecodeHeader() decodes the header information in the bitstream in the input input_buffer (which must be of QCCBITBUFFER_INPUT type and opened via a prior call to QccBitBufferStart(3) ). The header information is returned in num_levels (number of levels of wavelet decomposition), num_rows (vertical size of image), num_cols (horizontal size of image), image_mean (the mean value of the original image), stepsize (quantization stepsize), and max_coefficient_bits (the number of bits used to represent the magnitude of the coefficient with largest absolute value).
QccWAVtceDecode() decodes the bitstream input_buffer, producing the reconstructed image component, image. The bitstream must already have had its header read by a prior call to QccWAVtceDecodeHeader() (i.e., you call QccWAVtceDecodeHeader() first and then QccWAVtceDecode()).
In the TCE algorithm, nonzero-parent coefficients and run coefficients from the fractional-bitplane approach of Ordentlich et al. are combined to form a single class, the zero-run coefficients. For each bitplane, the TCE system then performs three passes: 1) adaptive arithmetic coding of bits of nonzero-neighbor coefficients; 2) tarp filtering and non-adaptive arithmetic coding of zero-run coefficients; and 3) encoding of refinement bits with an adaptive arithmetic coder. The sign bits of coefficients are coded when needed with a probability of 0.5. The encoding/decoding ends when the target rate is reached. Tian and Hemami describe several approaches to improving the probability estimate of the tarp filtering of the second pass.
C. Tian and S. S. Hemami, "An Embedded Image Coding System Based on Tarp Filter with Classification," in Proceedings of the International Conference on Acoustics, Speech, and Signal Processing, Montreal, Quebec, Canada, May 2004, vol. 3, pp. 49-52.
E. Ordentlich, M. Weinberger, and G. Seroussi, "A Low-Complexity Modeling Approach for Embedded Coding of Wavelet Coefficients," in Proceedings of the IEEE Data Compression Conference, Snowbird, UT, March 2002, pp. 23-32.
Copyright (C) 1997-2021 James E. Fowler