WPC - routines for compress a 2D seismic section using wavelet packets wpcCompress compress a 2D section wpcUncompress uncompress and generate a 2D section wpcN1 obtain the # of samples in the fast dimension wpcN2 obtain the # of samples in the slow dimension wpcSize length of the compressed bit stream wpcFree free up the space for the compressed data wpcWrite write the compressed data to a file wpcRead read compressed data from a file Function Prototypes: void *wpcCompress(float *f, int n1, int n2, float error, int *nbytes); int wpcUncompress(void *w, float *f); int wpcN1(void *wpc); int wpcN2(void *wpc); int wpcSize(void *wpc); void wpcFree(void *wpc); wpcCompress: Input: f pointer to the 2D section n1 # of samples in the fast dimension n2 # of samples in the slow dimension error relative RMS error tolerable during compression Output: nbytes # of bytes after compression Return: pointer to the compressed data wpcUncompress: Input: w pointer to the compressed data Output: f pointer to the uncompress 2D section Return: consistency flag, 1 if wpcCompressed data, 0 otherwise wpcN1: Input: wpc pointer to the compressed data Return: # of samples in the fast dimension wpcN2: Input: wpc pointer to the compressed data Return: # of samples in the slow dimension wpcSize: Input: wpc pointer to the compressed data Return: # of bytes after compression wpcFree: Input: wpc pointer to the compressed data wpcWrite: Input: wpc pointer to the compressed data fp file pointer to which to write wpcRead: Input: fp file pointer to which to write Return: pointer to the compressed data wpcCompress: Notes: The compression is done block by block, so the data is tiled first. The size of the tiling is set in the routine wpcInitConfig. Those numbers are obtained empirically. To support upgrading, the numbers and the filter parameters are stored as the header. Since we cannot determine the size of the output before compression, memory is allocated within this routine, and adjusted after the compression. Author: Tong Chen, 07/27/94