Table of Contents

NAME

QccWAVsrEncode, QccWAVsrDecode - encode/decode an image using the SR algorithm

SYNOPSIS

#include "libQccPack.h"

int QccWAVsrEncode(QccIMGImageComponent *image, QccBitBuffer *buffer, QccSQScalarQuantizer *quantizer, int num_levels, QccWAVWavelet *wavelet, QccWAVPerceptualWeights *perceptual_weights);

int QccWAVsrDecodeHeader(QccBitBuffer *buffer, int *num_levels, int *num_rows, int *num_cols, QccSQScalarQuantizer *quantizer, double *image_mean);

int QccWAVsrDecode(QccBitBuffer *buffer, QccIMGImageComponent *image, QccSQScalarQuantizer *quantizer, int num_levels, QccWAVWavelet *wavelet, QccWAVPerceptualWeights *perceptual_weights, double image_mean);

DESCRIPTION

QccWAVsrEncode() encodes an image component, image, using the stack-run (SR) algorithm by Tsai et al. The SR algorithm involves a 2D DWT followed by uniform scalar quantization of the wavelet coefficients. Runs of the zero index are identified and are run-length encoded. The SR algorithm then uses a 4-symbol alphabet to code the binary digits of the runs and the quantizer indices of the nonzero coefficients (the "stacks"). The stream of symbols from this 4-symbol alphabet is then coded with arithmetic entropy coding.

image is the image component to be coded, buffer is the output bitstream following arithmetic coding (must be of QCCBITBUFFER_OUTPUT type and opened via a prior call to QccBitBufferStart(3) ), quantizer is the scalar quantizer (see below), num_levels gives the number of levels of dyadic wavelet decomposition to perform, wavelet is the wavelet to use for decomposition, and perceptual_weights is the optional perceptual weights to employ (use NULL for no perceptual weighting).

The rate-distortion performance of the SR algorithm is determined by the stepsize of the uniform scalar quantizer, quantizer. quantizer may be of either QCCSQSCALARQUANTZIER_UNIFORM or QCCSQSCALARQUANTIZER_DEADZONE type. That is, quantizer may be either uniform or uniform with a dead zone (see squniform(1) for more details). Using a dead zone may allow longer runs of zeros and may increase compression performance in some cases.

Note: QccWAVsrEncode() currently achieves rate-distortion performance slightly below that reported by Tsai et al. For instance, when coding the "Barbara" image at 0.5 bits/pixel, srencode achieves a PSNR about 0.5dB below the reported figure. The reasons for this performance gap are currently being investigated.

QccWAVsrDecodeHeader() decodes the header information in the bitstream in the 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), quantizer (scalar quantizer, including stepsize and any deadzone stored in header), and image_mean (the mean value of the original image).

QccWAVsrDecode() decodes the bitstream buffer, producing the reconstructed image component, image. The bitstream must already have had its header read by a prior call to QccWAVsrDecodeHeader() (i.e., you call QccWAVsrDecodeHeader() first and then QccWAVsrDecode()).

SEE ALSO

srencode(1) , srdecode(1) , imgdwt(1) , squniform(1) , QccBitBuffer(3) , QccWAVPerceptualWeights(3) , QccWAVSubbandPyramid(3) , QccPackWAV(3) , QccPackIMG(3) , QccPack(3)

M.-J. Tsai, J. D. Villasenor, and F. Chen, "Stack-Run Image Coding," IEEE Transactions on Circuits and Systems for Video Technology, vol. 6, no. 5, pp. 519-521, October 1996.

M.-J. Tsai, J. D. Villasenor, and F. Chen, "Stack-Run Coding for Low Bit Rate Image Communication," Proceedings IEEE International Conference on Image Processing, pp. 681-684, September 1996.

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



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