int QccWAVPerceptualWeightsInitialize(QccWAVPerceptualWeights
*perceptual_weights);
int QccWAVPerceptualWeightsAlloc(QccWAVPerceptualWeights
*perceptual_weights);
void QccWAVPerceptualWeightsFree(QccWAVPerceptualWeights
*perceptual_weights);
int QccWAVPerceptualWeightsRead(QccWAVPerceptualWeights
*perceptual_weights);
int QccWAVPerceptualWeightsWrite(const QccWAVPerceptualWeights
*perceptual_weights);
int QccWAVPerceptualWeightsPrint(const QccWAVPerceptualWeights
*perceptual_weights);
int QccWAVPerceptualWeightsApply(QccWAVSubbandPyramid
*subband_pyramid, const QccWAVPerceptualWeights *perceptual_weights);
int QccWAVPerceptualWeightsRemove(QccWAVSubbandPyramid *subband_pyramid,
const QccWAVPerceptualWeights *perceptual_weights);
typedef struct
{
QccString filename;
QccString magic_num;
int major_version;
int minor_version;
int num_subbands;
QccVector perceptual_weights;
} QccWAVPerceptualWeights;
The fields of QccWAVPerceptualWeights are as follows:
The PCP file format consists of the following information:
where N is the number of perceptual weights contained in the file (which is equal to the number of subbands in the subband pyramid for which the file is to be used). The perceptual weights follow, each stored as a double in ASCII, separated by blanks and/or CRs.PCPX.X
<white space>
N
w1 w2...
filename: NULL string
magic_num: QCCPERCEPTUALWEIGHTS_MAGICNUM
major_version, minor_version: initialized to output of QccGetQccPackVersion(3)
num_subbands: 0
perceptual_weights: NULL
QccWAVPerceptualWeightsAlloc() allocates storage space for the perceptual_weights->perceptual_weights array. If perceptual_weights->perceptual_weights is not NULL, QccWAVPerceptualWeightsAlloc() returns immediately without changing the state of any memory allocation. Otherwise, the perceptual_weights->perceptual_weights array is allocated. The value for num_subbands must be set prior to calling QccWAVPerceptualWeightsAlloc().
QccWAVPerceptualWeightsFree() frees the perceptual_weights->perceptual_weights array previously allocated by QccWAVPerceptualWeightsAlloc().
QccWAVPerceptualWeightsRead() reads perceptual weights from the PCP-format file given by perceptual_weights->filename, which must be set before calling QccWAVPerceptualWeightsRead(). QccWAVPerceptualWeightsRead() searches the path given by the environment variable QCCPACK_WAVELET_PATH for a file whose name matches perceptual_weights->filename. The contents of the first such file found are read into perceptual_weight->perceptual_weights. If perceptual_weights->perceptual_weights is NULL, perceptual_weights->perceptual_weights is allocated via a call to QccWAVPerceptualWeightsAlloc() prior to reading; otherwise, it is assumed that sufficient space has already been allocated.
QccWAVPerceptualWeightsWrite() writes the PCP-format file whose filename is given by perceptual_weights->filename. perceptual_weights->perceptual_weights is assumed to be allocated and to contain all perceptual_weights->num_subbands weight values.
QccWAVPerceptualWeightsPrint() prints a format output list of perceptual_weights->perceptual_weights to stdout.
QccWAVPerceptualWeightsApply() applies the perceptual weights given in perceptual_weights to subband_pyramid by multiplying each wavelet coefficient in subband_pyramid->matrix with the appropriate weight value (as determined by the subband in which the coefficient resides) from perceptual_weights->perceptual_weights. The number of subbands specified by perceptual_weights must match that specified by subband_pyramid.
QccWAVPerceptualWeightsRemove() performs the reverse operation of QccWAVPerceptualWeightsApply(); namely, each coefficient in subband_pyramid->matrix is divided by the appropriate weight in perceptual_weights->perceptual_weights.
I. Hontsch, L. J. Karam, and R, J. Safranek, "A Perceptually Tuned Embedded Zerotree Image Coder," in Proceedings of the International Conference on Image Processing , vol. 1, pp. 41-44, Oct. 1997.
N. Jayant, J. Johnston, and R. Safranek, "Signal Compression Based on Models of Human Perception," Proceedings of the IEEE, vol. 81, no. 10, pp. 1385-1422, Oct. 1993.