IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2015, 8:40:19 PM (11 years ago)
Author:
eugene
Message:

trying to improve the speed of the compression shuffle step; added NONE_1 for testing; added timing traces in uncompress to test speed improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/table/F_compress_T.c

    r38415 r38418  
    289289  off_t i;
    290290
     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
     311int gfits_collect_table_data_alt (FTable *table, TableField *field, char *raw, int row_start, int Nrows) {
     312
     313  off_t i;
     314
    291315  // we are copying NN rows of the column which starts at XX and has MM bytes per row
    292316
     
    307331
    308332int 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
     361int gfits_collect_table_gzp2_alt (FTable *table, TableField *field, char *raw, int row_start, int Nrows) {
    309362
    310363  off_t i, j, k;
Note: See TracChangeset for help on using the changeset viewer.