Table of Contents

NAME

QccWAVtceEncode, QccWAVtceDecode - encode/decode an image using the TCE algorithm

SYNOPSIS

#include "libQccPack.h"

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);

DESCRIPTION

Encoding

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.

Decoding

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()).

ALGORITHM

It is widely believed that, in the wavelet domain, coefficients in a local neighborhood capture essential context information, such as edges and patterns, and that this information can facilitate compression. Many image coders exploit such local information in the form of adaptive entropy coding. Alternatively, tarp filtering (see QccWAVtarpEncode(3) ) produces probability estimates through an IIR filtering technique on the bitplanes of the wavelet coefficients. While providing very good performance when used in a nonembedded manner, the original tarp coder performs less competitively when used in an embedded manner, in spite of its operation on bitplanes. The reason is that the underlying tarp filter is designed to follow a raster-scan encoding order; however, the use of fractional bitplanes (see Ordentlich et al.) provides better rate-distortion performance for embedding. Such fractional bitplanes require an encoding order more flexible than a simple raster scan. In the TCE algorithm, coefficients are classified according to statistical properties, and the tarp filter is run on only the single class on which it tends to generate accurate probability estimates.

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.

SEE ALSO

tceencode(1) , tcedecode(1) , imgdwt(1) , imgdist(1) , QccBitBuffer(3) , QccENTArithmeticEncode(3) , QccENTArithmeticDecode(3) , QccWAVSubbandPyramid(3) , QccPackWAV(3) , QccPackIMG(3) , QccPack(3)

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.

AUTHOR

Written by Chao Tian, Cornell University

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads