Table of Contents

NAME

QccWAVspeck3DEncode, QccWAVspeck3DDecode - encode/decode an image cube using the 3D-SPECK algorithm

SYNOPSIS

#include "libQccPack.h"

int QccWAVspeck3DEncode(const QccIMGImageCube *image_cube, const QccIMGImageCube *mask, int transform_type, int temporal_num_levels, int spatial_num_levels, const QccWAVWavelet *wavelet, QccBitBuffer *output_buffer, int target_bit_cnt);

int QccWAVspeck3DDecodeHeader(QccBitBuffer *input_buffer, int *transform_type, int *temporal_num_levels, int *spatial_num_levels, int *num_frames, int *num_rows, int *num_cols, double *image_mean, int *max_coefficient_bits);

int QccWAVspeck3DDecode(QccBitBuffer *input_buffer, QccIMGImageCube *image_cube, const QccIMGImageCube *mask, int transform_type, int temporal_num_levels, int spatial_num_levels, const QccWAVWavelet *wavelet, double image_mean, int max_coefficient_bits, int target_bit_bit);

DESCRIPTION

Encoding

QccWAVspeck3DEncode() encodes an image cube, image_cube, using a 3D generalization of the SPECK algorithm. The original SPECK algorithm was developed for 2D images by Pearlman et al.; it was latter extended to 3D by Tang et al. In essence, the 3D-SPECK algorithm involves a 3D DWT followed by a progressive "bitplane" coding of the wavelet coefficients using a cube-splitting quantization structure based on octtrees. See "ALGORITHM" below for more detail.

image_cube is the image cube 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) .

QccWAVspeck3DEncode() supports the use of both wavelet-packet and dyadic wavelet-transform decompositions. If transform_type is QCCWAVSUBBANDPYRAMID3D_DYADIC, a dyadic DWT is used; if transform_type is QCCWAVSUBBANDPYRAMID3D_PACKET, a wavelet-packet DWT is used. temporal_num_levels and spatial_num_levels give the number of levels of wavelet decomposition to perform for both transform types; for a dyadic transform, temporal_num_levels should equal spatial_num_levels. wavelet is the wavelet to use for decomposition.

The bitstream output from the 3D-SPECK encoder is embedded, meaning that any prefix of the bitstream can be decoded to give a valid representation of the image. The 3D-SPECK encoder essentially produces output bits until the number of bits output reaches target_bit_cnt, the desired (target) total length of the output bitstream in bits, and then it stops. Note that this is the bitstream length in bits, not the rate of the bitstream (which would be expressed in bits per voxel).

QccWAVspeck3DEncode() optionally supports the use of a shape-adaptive DWT (SA-DWT) rather than the usual DWT. That is, QccWAVspeck3DEncode() can call QccWAVSubbandPyramid3DShapeAdaptiveDWT(3) as the wavelet transform rather than the usual QccWAVSubbandPyramid3DDWT(3) . The use of a SA-DWT is indicated by a non-NULL mask; if mask is NULL, then the usual DWT is used. In the case of a SA-DWT, mask gives the transparency mask which indicates which voxels of the image are non-transparent and thus have data that is to be transformed. Refer to QccWAVSubbandPyramid3DShapeAdaptiveDWT(3) for more details on the calculation of this SA-DWT. See "ALGORITHM" below for details on how the 3D-SPECK algorithm handles shape-adaptive coding.

Decoding

QccWAVspeck3DDecodeHeader() decodes the header information in a bitstream previously produced by QccWAVspeck3DEncode(). The input bitstream is input_buffer which must be of QCCBITBUFFER_INPUT type and opened via a prior call to QccBitBufferStart(3) .

The header information is returned in transform_type (either QCCWAVSUBBANDPYRAMID3D_DYADIC or QCCWAVSUBBANDPYRAMID3D_PACKET to indicate a dyadic or wavelet-packet transform decomposition, respectively), temporal_num_levels (number of levels of wavelet decomposition in the temporal direction), spatial_num_levels (number of levels of wavelet decomposition in the spatial directions), num_frames (size of the image cube in the temporal direction), num_rows (vertical size of image cube), num_cols (horizontal size of image cube), image_mean (the mean value of the original image cube), and max_coefficient_bits (indicates the precision, in number of bits, of the wavelet coefficient with the largest magnitude).

QccWAVspeck3DDecode() decodes the bitstream input_buffer, producing the reconstructed image cube, image_cube. The bitstream must already have had its header read by a prior call to QccWAVspeck3DDecodeHeader() (i.e., you call QccWAVspeck3DDecodeHeader() first and then QccWAVspeck3DDecode()). If target_bit_cnt is QCCENT_ANYNUMBITS, then decoding stops when the end of the input bitstream is reached; otherwise, decoding stops when target_num_bits from the input bitstream have been decoded.

If a SA-DWT was used in 3D-SPECK encoding, then the original transparency mask should be passed to QccWAVspeck3DDecode() as mask. That is, mask should be the same transparency mask (untransformed) that was passed to QccWAVspeck3DEncode(). Note that QccWAVspeck3DDecode() will transform this mask via a Lazy wavelet transform, and then pass the transformed mask to QccWAVSubbandPyramid3DInverseShapeAdaptiveDWT(3) . If the usual, full-volume DWT was used in encoding, then mask should be a NULL pointer.

ALGORITHM

The 3D-SPECK algorithm involves a 3D DWT followed by a progressive encoding of the bitplanes of wavelet coefficients. As is common with bitplane-based embedded coders, the encoder of the 3D-SPECK algorithm codes significance information in a significance pass followed by refinement-bit information in a refinement pass. The significance pass determines the significance of a wavelet coefficient against a given threshold, while the refinement pass codes the bits of those coefficients previously determined to be significant. The 3D-SPECK algoorithm uses octtree partitioning in which the significance state of an entire cube of coefficients is tested and coded, the cube is subdivided into eight subcubes of approximately equal size, and the significance-coding process is repeated recursively on each of the subcubes. Unlike the original 2D SPECK algorithm, the 3D-SPECK algorithm uses only one type of set, rather than having S and I sets as in 2D SPECK. Consequently, each subband in the DWT decomposition is added to an LIS at the start of the 3D-SPECK algorithm, whereas the 2D algorithm initializes with only the baseband subband in an LIS.

The QccPack implementation of 3D-SPECK supports shape-adaptive coding by generalizing the 2D OB-SPECK approach described by Lu and Pearlman to 3D (see QccWAVspeckEncode(3) ).

SEE ALSO

speckencode3d(1) , speckdecode3d(1) , QccBitBuffer(3) , QccWAVSubbandPyramid3D(3) , QccWAVSubbandPyramid3DDWT(3) , QccWAVSubbandPyramid3DShapeAdaptiveDWT(3) , QccWAVspeckEncode(3) , QccPackWAV(3) , QccPackIMG(3) , QccPack(3)

X. Tang, W. A. Pearlman, and J. W. Modestino, "Hyperspectral Image Compression Using Three-Dimensional Wavelet Coding," in Image and Video Communications and Processing, Santa Clara, CA, January 2003, Proc. SPIE 5022, pp. 1037-1047.

W. A. Pearlman, A. Islam, N. Nagaraj, and A. Said, "Efficient, Low-Complexity Image Coding with a Set-Partitioning Embedded Block Coder," IEEE Transactions on Circuits and Systems for Video Technology, to appear, 2003.

A. Islam and W. A. Pearlman, "An Embedded and Efficient Low-Complexity Hierarchical Image Coder," in Visual Communications and Image Processing, K. Aizawa, R. L. Stevenson, and Y.-Q. Zhang, Eds., San Jose, CA, January 1999, Proc. SPIE 3653, pp. 294-305.

Z. Lu and W. A. Pearlman, "Wavelet Video Coding of Video Object by Object-Based SPECK Algorithm," in Proceedings of the Picture Coding Symposium, Seoul, Korea, April 2001, pp. 413-416.

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



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