Changeset 16898
- Timestamp:
- 06/24/13 16:04:52 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fitsCompressor.cc
r16897 r16898 38 38 unsigned char numProcs; 39 39 BlockHeader(uint64_t s=0, 40 char o= FACT_ROW_MAJOR,40 char o=zfits::kOrderByRow, 41 41 unsigned char n=1) : size(s), 42 42 ordering(o), … … 1175 1175 switch (_columns[i].getColumnOrdering())//getCompression()) 1176 1176 { 1177 case FACT_ROW_MAJOR:1177 case zfits::kOrderByRow: 1178 1178 for (uint32_t k=0;k<thisRoundNumRows;k++) 1179 1179 {//regular, "semi-transposed" copy … … 1183 1183 break; 1184 1184 1185 case FACT_COL_MAJOR:1185 case zfits::kOrderByCol : 1186 1186 for (int j=0;j<_columns[i].numElems();j++) 1187 1187 for (uint32_t k=0;k<thisRoundNumRows;k++) … … 1323 1323 switch (sequence[j]) 1324 1324 { 1325 case FACT_RAW:1325 case zfits::kFactRaw: 1326 1326 // if (head.numProcs == 1) 1327 1327 compressedOffset += compressUNCOMPRESSED(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems()); 1328 1328 break; 1329 case FACT_SMOOTHING:1329 case zfits::kFactSmoothing: 1330 1330 applySMOOTHING(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems()); 1331 1331 break; 1332 case FACT_HUFFMAN16:1333 if (head.ordering == FACT_COL_MAJOR)1332 case zfits::kFactHuffman16: 1333 if (head.ordering == zfits::kOrderByCol) 1334 1334 compressedOffset += compressHUFFMAN(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems()); 1335 1335 else … … 1343 1343 1344 1344 //check if compressed size is larger than uncompressed 1345 if (sequence[0] != FACT_RAW&&1345 if (sequence[0] != zfits::kFactRaw && 1346 1346 compressedOffset - previousOffset > _columns[i].sizeOfElems()*_columns[i].numElems()*thisRoundNumRows+sizeof(BlockHeader)+sizeof(uint16_t)*sequence.size()) 1347 1347 {//if so set flag and redo it uncompressed … … 1352 1352 he.size = compressedOffset - previousOffset; 1353 1353 he.numProcs = 1; 1354 he.ordering = FACT_ROW_MAJOR;1354 he.ordering = zfits::kOrderByRow; 1355 1355 memcpy(&(_compressedBuffer[threadIndex][previousOffset]), (char*)(&he), sizeof(BlockHeader)); 1356 _compressedBuffer[threadIndex][previousOffset+sizeof(BlockHeader)] = FACT_RAW;1356 _compressedBuffer[threadIndex][previousOffset+sizeof(BlockHeader)] = zfits::kFactRaw; 1357 1357 offset += thisRoundNumRows*_columns[i].sizeOfElems()*_columns[i].numElems(); 1358 1358 _catalog[currentCatalogRow][i].first = compressedOffset - _catalog[currentCatalogRow][i].second; … … 1684 1684 //get header structures 1685 1685 BlockHeader rawHeader; 1686 BlockHeader smoothmanHeader(0, FACT_ROW_MAJOR, 2);1686 BlockHeader smoothmanHeader(0, zfits::kOrderByRow, 2); 1687 1687 vector<uint16_t> rawProcessings(1); 1688 rawProcessings[0] = FACT_RAW;1688 rawProcessings[0] = zfits::kFactRaw; 1689 1689 vector<uint16_t> smoothmanProcessings(2); 1690 smoothmanProcessings[0] = FACT_SMOOTHING;1691 smoothmanProcessings[1] = FACT_HUFFMAN16;1690 smoothmanProcessings[0] = zfits::kFactSmoothing; 1691 smoothmanProcessings[1] = zfits::kFactHuffman16; 1692 1692 // smoothmanProcessings[2] = FACT_RAW; 1693 1693 -
trunk/Mars/mcore/zfits.h
r16897 r16898 145 145 if (fTable.is_compressed) 146 146 for (auto it=fTable.sorted_cols.begin(); it!= fTable.sorted_cols.end(); it++) 147 if (it->comp != kCompFACT)148 147 { 149 148 if (it->comp == kCompFACT) … … 158 157 #endif 159 158 } 160 }161 159 162 160 fColumnOrdering.resize(fTable.sorted_cols.size());
Note:
See TracChangeset
for help on using the changeset viewer.