Changeset 38418
- Timestamp:
- Jun 6, 2015, 8:40:19 PM (11 years ago)
- Location:
- branches/eam_branches/ohana.20150429/src/libfits
- Files:
-
- 10 edited
-
Makefile (modified) (1 diff)
-
matrix/F_compress_M.c (modified) (1 diff)
-
matrix/F_compress_data.c (modified) (1 diff)
-
matrix/F_uncompress_M.c (modified) (1 diff)
-
matrix/F_uncompress_data.c (modified) (1 diff)
-
table/F_compress_T.c (modified) (2 diffs)
-
table/F_uncompress_T.c (modified) (2 diffs)
-
test/compress.sh (modified) (4 diffs)
-
test/imagecomp.c (modified) (1 diff)
-
test/tablecomp.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/Makefile
r38404 r38418 32 32 for i in $(TESTPROG); do $(TESTBIN)/$$i 2>&1 | $(TESTHARNESS); done 33 33 test.verbose: $(TESTPROG) 34 for i in $(TESTPROG); do $(TESTBIN)/$$i 2>&1 | &$(TESTHARNESS) -v; done34 for i in $(TESTPROG); do $(TESTBIN)/$$i 2>&1 | $(TESTHARNESS) -v; done 35 35 36 36 install: $(DESTLIB)/libFITS.a $(DESTLIB)/libFITS.$(DLLTYPE) $(DESTMAN)/fits.1 -
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_M.c
r38399 r38418 514 514 } 515 515 *rawptr = *srcptr; 516 myAssert (srcptr - matrix->buffer < Npix*size, "memory overrun");517 myAssert (rawptr - raw < Nraw*size, "memory overrun");516 // myAssert (srcptr - matrix->buffer < Npix*size, "memory overrun"); 517 // myAssert (rawptr - raw < Nraw*size, "memory overrun"); 518 518 } 519 519 -
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_data.c
r38366 r38418 42 42 43 43 // do not actually compress : this is used for testing 44 if (!strcasecmp(cmptype, "NONE") || !strcasecmp(cmptype, "NONE_ 2")) {44 if (!strcasecmp(cmptype, "NONE") || !strcasecmp(cmptype, "NONE_1") || !strcasecmp(cmptype, "NONE_2")) { 45 45 unsigned long Nbytes = Nrawpix * rawpix_size; 46 46 -
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_M.c
r38399 r38418 569 569 } 570 570 *srcptr = *rawptr; 571 myAssert (srcptr - matrix->buffer < Npix*size, "memory overrun");572 myAssert (rawptr - raw < Nraw*size, "memory overrun");571 // myAssert (srcptr - matrix->buffer < Npix*size, "memory overrun"); 572 // myAssert (rawptr - raw < Nraw*size, "memory overrun"); 573 573 } 574 574 -
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_data.c
r38366 r38418 33 33 34 34 // do not actually uncompress : this is used for testing 35 if (!strcasecmp(cmptype, "NONE") || !strcasecmp(cmptype, "NONE_ 2")) {35 if (!strcasecmp(cmptype, "NONE") || !strcasecmp(cmptype, "NONE_1") || !strcasecmp(cmptype, "NONE_2")) { 36 36 memcpy (outdata, zdata, Nzdata); 37 37 myAssert (*Nout == Nzdata, "invalid size"); -
branches/eam_branches/ohana.20150429/src/libfits/table/F_compress_T.c
r38415 r38418 289 289 off_t i; 290 290 291 // we are copying NN rows into the column which starts at XX and has MM bytes per row 292 293 off_t Nx = table->header->Naxis[0]; 294 295 char *tblbuffer = &table->buffer[Nx*row_start + field->offset]; 296 297 int rowsize = field->rowsize; 298 299 if (VERBOSE) fprintf (stderr, "distribute: "); 300 for (i = 0; i < Nrows; i++, tblbuffer += Nx) { 301 memcpy (&raw[i*rowsize], tblbuffer, rowsize); 302 # if (VERBOSE) 303 int j; for (j = 0; j < field->rowsize; j++) fprintf (stderr, "0x%02hhx ", table->buffer[Nx*row + field->offset + j]); 304 # endif 305 } 306 if (VERBOSE) fprintf (stderr, "\n"); 307 308 return (TRUE); 309 } 310 311 int gfits_collect_table_data_alt (FTable *table, TableField *field, char *raw, int row_start, int Nrows) { 312 313 off_t i; 314 291 315 // we are copying NN rows of the column which starts at XX and has MM bytes per row 292 316 … … 307 331 308 332 int gfits_collect_table_gzp2 (FTable *table, TableField *field, char *raw, int row_start, int Nrows) { 333 334 off_t i, j, k; 335 336 // we are copying NN rows into the column which starts at XX and has MM bytes per row 337 338 off_t Nx = table->header->Naxis[0]; 339 int Nvalues = field->Nvalues; 340 int pixsize = field->pixsize; 341 int offset = field->offset; 342 343 char *rawptr = raw; 344 345 for (k = 0; k < field->pixsize; k++) { 346 # ifdef BYTE_SWAP 347 char *tblptr_start = &table->buffer[Nx*row_start + offset + (pixsize - k - 1)]; 348 # else 349 char *tblptr_start = &table->buffer[Nx*row_start + offset + k]; 350 # endif 351 for (i = 0; i < Nrows; i++, tblptr_start += Nx) { 352 char *tblptr = tblptr_start; 353 for (j = 0; j < Nvalues; j++, tblptr += pixsize, rawptr++) { 354 *rawptr = *tblptr; 355 } 356 } 357 } 358 return (TRUE); 359 } 360 361 int gfits_collect_table_gzp2_alt (FTable *table, TableField *field, char *raw, int row_start, int Nrows) { 309 362 310 363 off_t i, j, k; -
branches/eam_branches/ohana.20150429/src/libfits/table/F_uncompress_T.c
r38415 r38418 60 60 fprintf (stderr, "times: %f %f %f\n", timeSum1, timeSum2, timeSum3); 61 61 fprintf (stderr, "times: %f %f %f %f %f %f\n", timeSum2a, timeSum2b, timeSum2c, timeSum2d, timeSum2e, timeSum2f); 62 63 timeSum1 = 0.0; 64 timeSum2 = 0.0; 65 timeSum2a = 0.0; 66 timeSum2b = 0.0; 67 timeSum2c = 0.0; 68 timeSum2d = 0.0; 69 timeSum2e = 0.0; 70 timeSum2f = 0.0; 71 timeSum3 = 0.0; 62 72 } 63 73 … … 346 356 char *tblbuffer = &table->buffer[Nx*row_start + field->offset]; 347 357 358 int rowsize = field->rowsize; 359 348 360 if (VERBOSE) fprintf (stderr, "distribute: "); 349 361 for (i = 0; i < Nrows; i++, tblbuffer += Nx) { 350 // int row = row_start + i; 351 memcpy (tblbuffer, &raw[i*field->rowsize], field->rowsize); 362 memcpy (tblbuffer, &raw[i*rowsize], rowsize); 352 363 # if (VERBOSE) 353 364 int j; for (j = 0; j < field->rowsize; j++) fprintf (stderr, "0x%02hhx ", table->buffer[Nx*row + field->offset + j]); -
branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh
r38408 r38418 5 5 tapPLAN 88 6 6 7 foreach mode NONE GZIP_1 GZIP_2 RICE_1 RICE_ONE7 foreach mode NONE NONE_1 NONE_2 GZIP_1 GZIP_2 RICE_1 RICE_ONE 8 8 # foreach mode GZIP_1 9 9 # foreach mode GZIP_2 … … 44 44 45 45 if ($cmpmode == NONE) return 46 if ($cmpmode == NONE_1) return 47 if ($cmpmode == NONE_2) return 46 48 47 49 if ($cmpmode == GZIP_1) … … 311 313 local format cmpmode 312 314 313 foreach cmpmode NONE GZIP_1 GZIP_2 RICE_1 RICE_ONE315 foreach cmpmode NONE NONE_1 NONE_2 GZIP_1 GZIP_2 RICE_1 RICE_ONE 314 316 test_table_rnd $cmpmode 315 317 end … … 417 419 418 420 if ($cmpmode == NONE) return; # funpack will not recognize NONE 421 if ($cmpmode == NONE_1) return; # funpack will not recognize NONE 422 if ($cmpmode == NONE_2) return; # funpack will not recognize NONE 419 423 if ($cmpmode == RICE_ONE) return; # funpack will not recognize RICE_ONE for tables 420 424 -
branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c
r38399 r38418 8 8 9 9 // char *cmptype[] = {"NONE", "NONE_2", "GZIP_1", "GZIP_2", "PLIO_1", "RICE_1", "RICE_ONE", "HCOMPRESS_1", NULL}; 10 char *cmptype[] = {"NONE", "NONE_ 2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", NULL};10 char *cmptype[] = {"NONE", "NONE_1", "NONE_2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", NULL}; 11 11 int bitpix[] = {8, 16, 32, -32, -64, 0}; 12 12 -
branches/eam_branches/ohana.20150429/src/libfits/test/tablecomp.c
r38415 r38418 8 8 int test_compress_single_full (char *zcmptype); 9 9 10 char *cmptype[] = {"NONE", "NONE_ 2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", "AUTO", NULL};10 char *cmptype[] = {"NONE", "NONE_1", "NONE_2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", "AUTO", NULL}; 11 11 12 12 int main (int argc, char **argv) {
Note:
See TracChangeset
for help on using the changeset viewer.
