提交 8ed756fc 编写于 作者: N Nicolas Cadart 提交者: Kunal Tyagi

Fix entropy range encoding in octree pointcloud compression

Size of frequency table elements was wrongly computed when frequency was a power of 2.
This led to faulty frequency table encoding with 1 missing byte.
During decoding, the frequency was decoded to 0 as 1 byte is missing, leading to
division by 0 and thus error.

The frequencyTableByteSize is now correctly computed.
上级 95a884b6
......@@ -294,7 +294,7 @@ pcl::StaticRangeCoder::encodeIntVectorToStream (std::vector<unsigned int>& input
// calculate amount of bytes per frequency table entry
std::uint8_t frequencyTableByteSize = static_cast<std::uint8_t> (std::ceil (
std::log2 (static_cast<double> (cFreqTable_[static_cast<std::size_t> (frequencyTableSize - 1)])) / 8.0));
std::log2 (static_cast<double> (cFreqTable_[static_cast<std::size_t> (frequencyTableSize - 1)] + 1)) / 8.0));
// write size of frequency table to output stream
outputByteStream_arg.write (reinterpret_cast<const char*> (&frequencyTableSize), sizeof(frequencyTableSize));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册