Changeset 16820


Ignore:
Timestamp:
06/13/13 08:55:25 (11 years ago)
Author:
lyard
Message:
Modified block header's sequence scheme
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fitsCompressor.cc

    r16814 r16820  
    13001300            {
    13011301                case FACT_RAW:
    1302                     if (head.numProcs == 1)
     1302//                    if (head.numProcs == 1)
    13031303                        compressedOffset += compressUNCOMPRESSED(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems());
    13041304                break;
     
    16561656        //get header structures
    16571657        BlockHeader rawHeader;
    1658         BlockHeader smoothmanHeader(0, FACT_ROW_MAJOR, 3);
     1658        BlockHeader smoothmanHeader(0, FACT_ROW_MAJOR, 2);
    16591659        vector<uint16_t> rawProcessings(1);
    16601660        rawProcessings[0] = FACT_RAW;
    1661         vector<uint16_t> smoothmanProcessings(3);
     1661        vector<uint16_t> smoothmanProcessings(2);
    16621662        smoothmanProcessings[0] = FACT_SMOOTHING;
    16631663        smoothmanProcessings[1] = FACT_HUFFMAN16;
    1664         smoothmanProcessings[2] = FACT_RAW;
     1664//        smoothmanProcessings[2] = FACT_RAW;
    16651665
    16661666        //first lets see if we do have an explicit request
  • trunk/Mars/mcore/zfits.h

    r16814 r16820  
    168168    vector<char> fTransposedBuffer; ///<intermediate buffer to transpose the rows
    169169    vector<char> fCompressedBuffer; ///<compressed rows
    170     vector<char> fColumnOrdering; ///< ordering of the column's rows
     170    vector<char> fColumnOrdering;   ///< ordering of the column's rows. Can change from tile to tile.
    171171
    172172    size_t fNumTiles;       ///< Total number of tiles
     
    180180    vector<vector<size_t> >                  fTileOffsets; ///< offset from start of tile of a given compressed column
    181181
     182    // Get buffer space
    182183    void AllocateBuffers()
    183184    {
     
    255256            clear(rdstate()|ios::badbit);
    256257    }
     258
    257259    //overrides fits.h method with empty one
    258260    //work is done in ReadBinaryRow because it requires volatile data from ReadBinaryRow
     
    261263
    262264    }
    263     // Compressed versin of the read row
     265
     266    // Compressed version of the read row
    264267    bool ReadBinaryRow(const size_t &rowNum, char *bufferToRead)
    265268    {
     
    386389    }
    387390
     391    // Apply the inverse transform of the integer smoothing
    388392    uint32_t UnApplySMOOTHING(int16_t*   data,
    389                               uint32_t numElems)
     393                              uint32_t   numElems)
    390394    {
    391395        //un-do the integer smoothing
     
    395399        return numElems*sizeof(uint16_t);
    396400    }
     401
    397402    // 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)
    399405    {
    400406        char *dest = fTransposedBuffer.data();
     
    419425            const char *src = fCompressedBuffer.data()+compressedOffset+sizeof(BlockHeader)+sizeof(uint16_t)*head->numProcs;
    420426
    421             for (uint32_t j=head->numProcs;j != 0; j--)
     427            for (int32_t j=head->numProcs-1;j >= 0; j--)
    422428            {
    423429                uint32_t sizeWritten=0;
    424430
    425                 switch (head->processings[j-1])
     431                switch (head->processings[j])
    426432                {
    427433                    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);
    430435                    break;
    431436                    case FACT_SMOOTHING:
     
    445450                }
    446451                //increment destination counter only when processing done.
    447                 if (j==1) dest+= sizeWritten;
     452                if (j==0) dest+= sizeWritten;
    448453            }
    449454        }
Note: See TracChangeset for help on using the changeset viewer.