Changeset 18272 for trunk/Ohana
- Timestamp:
- Jun 22, 2008, 8:56:18 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/matrix/F_uncompress_data.c
r15657 r18272 6 6 int fits_rcomp(int a[], int nx, unsigned char *c, int clen, int nblock); 7 7 int fits_rdecomp (unsigned char *c, int clen, unsigned int array[], int nx, int nblock); 8 int fits_rdecomp_short (unsigned char *c, int clen, unsigned short array[], int nx, int nblock); 9 int fits_rdecomp_byte (unsigned char *c, int clen, unsigned char array[], int nx, int nblock); 8 10 9 11 /* functions defined in fits_hcompress.c */ … … 60 62 // fprintf (stderr, "%d comp bytes; %d uncomp 'pixels', totals: %d %d\n", Nzdata, Npix, Ninsum, Noutsum); 61 63 62 // rice decompression from the CFITSIO source tree : we need to tell it the expected number of pixels 63 // is also REQUIRES 4byte output, which is fairly stupid. 64 if (fits_rdecomp ((unsigned char *) zdata, Nzdata, (unsigned int *) outdata, Npix, blocksize)) { 65 fprintf (stderr, "error in rice decompression\n"); 66 return (FALSE); 64 switch (out_pixsize) { 65 case 4: 66 // rice decompression from the CFITSIO source tree : we need to tell it the expected number of pixels 67 // is also REQUIRES 4byte output, which is fairly stupid. 68 if (fits_rdecomp ((unsigned char *) zdata, Nzdata, (unsigned int *) outdata, Npix, blocksize)) { 69 fprintf (stderr, "error in rice decompression\n"); 70 return (FALSE); 71 } 72 return (TRUE); 73 74 case 2: 75 if (fits_rdecomp_short ((unsigned char *) zdata, Nzdata, (unsigned short *) outdata, Npix, blocksize)) { 76 fprintf (stderr, "error in rice decompression\n"); 77 return (FALSE); 78 } 79 return (TRUE); 80 81 case 1: 82 if (fits_rdecomp_byte ((unsigned char *) zdata, Nzdata, (unsigned char *) outdata, Npix, blocksize)) { 83 fprintf (stderr, "error in rice decompression\n"); 84 return (FALSE); 85 } 86 return (TRUE); 87 88 default: 89 fprintf (stderr, "invalid output pixel size %d\n", out_pixsize); 90 return (FALSE); 67 91 } 68 return (TRUE);92 69 93 } 70 94
Note:
See TracChangeset
for help on using the changeset viewer.
