FACT++  1.0
uint32_t zfits::UncompressHUFFMAN16 ( char *  dest,
const char *  src,
uint32_t  numChunks 
)
inlineprivate

Definition at line 466 of file zfits.h.

References Huffman::Decode().

Referenced by UncompressBuffer().

469  {
470  std::vector<uint16_t> uncompressed;
471 
472  //read compressed sizes (one per row)
473  const uint32_t* compressedSizes = reinterpret_cast<const uint32_t*>(src);
474  src += sizeof(uint32_t)*numChunks;
475 
476  //uncompress the rows, one by one
477  uint32_t sizeWritten = 0;
478  for (uint32_t j=0;j<numChunks;j++)
479  {
480  Huffman::Decode(reinterpret_cast<const unsigned char*>(src), compressedSizes[j], uncompressed);
481 
482  memcpy(dest, uncompressed.data(), uncompressed.size()*sizeof(uint16_t));
483 
484  sizeWritten += uncompressed.size()*sizeof(uint16_t);
485  dest += uncompressed.size()*sizeof(uint16_t);
486  src += compressedSizes[j];
487  }
488  return sizeWritten;
489  }
int64_t Decode(const uint8_t *bufin, size_t bufinlen, std::vector< uint16_t > &pbufout)
Definition: huffman.h:401

+ Here is the call graph for this function:

+ Here is the caller graph for this function: