902 std::string huffmanOutput;
903 uint32_t previousHuffmanSize = 0;
907 return numRows*sizeOfElems*numRowElems + 1000;
909 if (sizeOfElems < 2 )
912 throw std::runtime_error(
"HUFMANN16 can only encode columns with 16-bit or longer types");
914 gLog <<
___err___ <<
"ERROR - HUFMANN16 can only encode columns with 16-bit or longer types" << std::endl;
919 uint32_t huffmanOffset = 0;
920 for (uint32_t j=0;j<numRowElems;j++)
923 reinterpret_cast<const uint16_t*>(&src[j*sizeOfElems*
numRows]),
924 numRows*(sizeOfElems/2));
925 reinterpret_cast<uint32_t*
>(&dest[huffmanOffset])[0] = huffmanOutput.size() - previousHuffmanSize;
926 huffmanOffset +=
sizeof(uint32_t);
927 previousHuffmanSize = huffmanOutput.size();
930 const size_t totalSize = huffmanOutput.size() + huffmanOffset;
933 if (totalSize < numRows*sizeOfElems*numRowElems)
934 memcpy(&dest[huffmanOffset], huffmanOutput.data(), huffmanOutput.size());
bool Encode(std::string &bufout, const uint16_t *bufin, size_t bufinlen)