int QccWAVbisk3DEncode(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 QccWAVbisk3DEncode2(QccWAVSubbandPyramid3D *image_subband_pyramid, QccWAVSubbandPyramid3D *mask_subband_pyramid, double image_mean, QccBitBuffer *output_buffer, int target_bit_cnt);
int QccWAVbisk3DDecodeHeader(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 QccWAVbisk3DDecode(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);
int QccWAVbisk3DDecode2(QccBitBuffer *input_buffer, QccWAVSubbandPyramid3D *image_subband_pyramid, QccWAVSubbandPyramid3D *mask_subband_pyramid, int max_coefficient_bits, int target_bit_cnt);
QccWAVbisk3DEncode() encodes an image cube, image_cube, using a 3D generalization of the BISK algorithm. The original BISK algorithm was developed for 2D images by Fowler; it was latter extended to 3D by Rucker and Fowler. In essence, the 3D-BISK algorithm involves a 3D DWT followed by a progressive "bitplane" coding of the wavelet coefficients using a cube-splitting quantization structure based on k-d trees. 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) .
QccWAVbisk3DEncode() 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-BISK encoder is embedded, meaning that any prefix of the bitstream can be decoded to give a valid representation of the image. The 3D-BISK 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).
QccWAVbisk3DEncode() optionally supports the use of a shape-adaptive DWT (SA-DWT) rather than the usual DWT. That is, QccWAVbisk3DEncode() 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-BISK algorithm handles shape-adaptive coding.
The routine QccWAVbisk3DEncode2() provides an alternative interface to 3D-BISK encoding. Specifically, QccWAVbisk3DEncode2() functions indentically to QccWAVbisk3DEncode() described above, except that both the image cube and optional mask are assumed to have had a 3D DWT applied to them prior to calling QccWAVbisk3DEncode2(). As a consequence, the image cube and mask are passed to QccWAVbisk3DEncode2() in the wavelet domain as image_subband_pyramid and mask_subband_pyramid. We note that most applications should opt for QccWAVbisk3DEncode() rather than QccWAVbisk3DEncode2(); however, QccWAVbisk3DEncode() is implemented essentially as a call to an appropriate 3D DWT followed by a call to QccWAVbisk3DEncode2(). If QccWAVbisk3DEncode2() is used, it is the responsibility of the calling routine to perform the appropriate 3D DWT prior to calling QccWAVbisk3DEncode2().
QccWAVbisk3DDecodeHeader() decodes the header information in a bitstream previously produced by QccWAVbisk3DEncode(). 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).
QccWAVbisk3DDecode() 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 QccWAVbisk3DDecodeHeader() (i.e., you call QccWAVbisk3DDecodeHeader() first and then QccWAVbisk3DDecode()). 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-BISK encoding, then the original transparency mask should be passed to QccWAVbisk3DDecode() as mask. That is, mask should be the same transparency mask (untransformed) that was passed to QccWAVbisk3DEncode(). Note that QccWAVbisk3DDecode() 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.
QccWAVbisk3DDecode2() provides the appropriate alternative interface to 3D-BISK decoding required if encoding was done via QccWAVbisk3DEncode2(). Essentially, QccWAVbisk3DDecode() is implemented by a call to QccWAVbisk3DDecode2() followed by an appropriate inverse 3D DWT. If QccWAVbisk3DDecode2() is used, it is the responsibility of the calling to routine to perform the appropriate inverse 3D DWT subsequent to the call to QccWAVbisk3DDecode2(). As noted above, most applications should use QccWAVbisk3DDecode() rather than QccWAVbisk3DDecode2().
The unique aspect of the 3D-BISK algorithm is in the significance pass. In many ways, the 3D-BISK algorithm can be considered to be a variant of 3D-SPECK (Tang et al. 2003) designed specifically for improved shape-adaptive coding, and it is a generalization to 3D of the original 2D BISK algorithm developed by Fowler. The 3D-BISK coder employs two tactics to improve shape-adaptive coding---aggressive discarding of transparent regions from sets after partitioning, and a spatial-partitioning structure more flexible than the octtrees used by 3D-SPECK. In octtree partitioning, 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. On the other hand, when processing a given set, the 3D-BISK coder employs a different partitioning scheme, k-d trees (Bentley 1975) rather than octtrees, to recursively code the significance map. Like octtrees, k-d trees are a recursive spatial partitioning data structure. Unlike octtrees, which subdivide a cube into eight equally sized subcubes, k-d trees effectuate a binary partitioning; that is, cubes are divided in two. Although there are several approaches for selecting the location and orientation of the split, the 3D-BISK algorithm uses a simple approach in which cubes are divided into approximately equally sized halves, and we alternate between splitting horizontally, vertically, and temporally.
Additionally, to improve shape-adaptive coding, the 3D-BISK coder "shrinks" each set to the bounding box surrounding the opaque coefficients before subdividing the set into smaller blocks.
J. T. Rucker and J. E. Fowler, "Coding of Ocean-Temperature Volumes Using Binary Set Splitting with k-d Trees," in Proceedings of the International Geoscience and Remote Sensing Symposium, Anchorage, AK, September 2004, to appear.
J. E. Fowler, "Shape-Adaptive Coding Using Binary Set Splitting with k-d Trees," in Proceedings of the International Conference on Image Processing, Singapore, October 2004, to appear.
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.
J. L. Bentley, "Multidimensional Binary Search Trees Used for Associative Searching," Communications of the ACM, vol. 18, no. 9, pp. 509-517, September 1975.