Table of Contents

NAME

QccHYPRawDist2D, QccHYPRawDist3D - distortion between two raw-format files

SYNOPSIS

#include "libQccPack.h"

int QccHYPRawDist2D(QccString filename1, QccString filename2, double *mse, double *mae, double *snr, int num_rows, int num_cols, int bpp, int signed_data, int endian);
int QccHYPRawDist3D(QccString filename1, QccString filename2, double *mse, double *mae, double *snr, int num_frames, int num_rows, int num_cols, int bpv, int signed_data, int format, int endian);

DESCRIPTION

QccHYPRawDist2D() and QccHYPRawDist3D() calculate the distortion between two raw binary files; QccHYPRawDist2D() is for 2D files while QccHYPRawDist3D() is for 3D files. The mean squared error (MSE), the maximum absolute error (MAE), and the signal-to-noise ratio (SNR) are calculated and returned in mse, mae, and snr, respectively. SNR is calculated with respect to the variance of filename1. If any of mse, mae, and snr are NULL, the respective value is calculated but not returned.

In all of these routines, the parameters bpp (2D files) or bpv (3D files) specify the number of bits that each pixel or voxel value contains, respectively; these values must be between 1 and 32. If bpp or bpv is <= 8, then each sample is stored as the least significant bits in a single byte; otherwise, if bpp or bpv is <= 16, then each sample is stored as the least significant bits of two consecutive bytes; otherwise, if bpp or bpv is <= 32, then each sample is stored as the least significant bits of four consecutive bytes. signed_data indicates whether the sample values are signed or not; likewise, endian, which is one of QCCHYP_RAWENDIAN_BIG or QCCHYP_RAWENDIAN_LITTLE, indicates the endianness of the values. For 3D reading and writing, format must be one of QCCHYP_RAWFORMAT_BSQ, QCCHYP_RAWFORMAT_BIL, or QCCHYP_RAWFORMAT_BIP to indicate the scan order of the 3D file.

RETURN VALUE

Both routines return 0 on success, 1 on error.

SEE ALSO

QccHYPRaw(3) , QccPackHYP(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



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