Changeset 16820 for trunk/Mars/mcore/zfits.h
- Timestamp:
- 06/13/13 08:55:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/zfits.h
r16814 r16820 168 168 vector<char> fTransposedBuffer; ///<intermediate buffer to transpose the rows 169 169 vector<char> fCompressedBuffer; ///<compressed rows 170 vector<char> fColumnOrdering; ///< ordering of the column's rows170 vector<char> fColumnOrdering; ///< ordering of the column's rows. Can change from tile to tile. 171 171 172 172 size_t fNumTiles; ///< Total number of tiles … … 180 180 vector<vector<size_t> > fTileOffsets; ///< offset from start of tile of a given compressed column 181 181 182 // Get buffer space 182 183 void AllocateBuffers() 183 184 { … … 255 256 clear(rdstate()|ios::badbit); 256 257 } 258 257 259 //overrides fits.h method with empty one 258 260 //work is done in ReadBinaryRow because it requires volatile data from ReadBinaryRow … … 261 263 262 264 } 263 // Compressed versin of the read row 265 266 // Compressed version of the read row 264 267 bool ReadBinaryRow(const size_t &rowNum, char *bufferToRead) 265 268 { … … 386 389 } 387 390 391 // Apply the inverse transform of the integer smoothing 388 392 uint32_t UnApplySMOOTHING(int16_t* data, 389 uint32_t numElems)393 uint32_t numElems) 390 394 { 391 395 //un-do the integer smoothing … … 395 399 return numElems*sizeof(uint16_t); 396 400 } 401 397 402 // Data has been read from disk. Uncompress it ! 398 void UncompressBuffer(const uint32_t &catalogCurrentRow, const uint32_t &thisRoundNumRows) 403 void UncompressBuffer(const uint32_t &catalogCurrentRow, 404 const uint32_t &thisRoundNumRows) 399 405 { 400 406 char *dest = fTransposedBuffer.data(); … … 419 425 const char *src = fCompressedBuffer.data()+compressedOffset+sizeof(BlockHeader)+sizeof(uint16_t)*head->numProcs; 420 426 421 for ( uint32_t j=head->numProcs;j != 0; j--)427 for (int32_t j=head->numProcs-1;j >= 0; j--) 422 428 { 423 429 uint32_t sizeWritten=0; 424 430 425 switch (head->processings[j -1])431 switch (head->processings[j]) 426 432 { 427 433 case FACT_RAW: 428 if (head->numProcs == 1) 429 sizeWritten = UncompressUNCOMPRESSED(dest, src, numRows*numCols, col.size); 434 sizeWritten = UncompressUNCOMPRESSED(dest, src, numRows*numCols, col.size); 430 435 break; 431 436 case FACT_SMOOTHING: … … 445 450 } 446 451 //increment destination counter only when processing done. 447 if (j== 1) dest+= sizeWritten;452 if (j==0) dest+= sizeWritten; 448 453 } 449 454 }
Note:
See TracChangeset
for help on using the changeset viewer.