MCPcopy Create free account
hub / github.com/comaps/comaps / ReadAndDecodeBlock

Method ReadAndDecodeBlock

libs/coding/bwt_coder.hpp:75–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74 template <typename Source>
75 static void ReadAndDecodeBlock(Source & source, BufferT & bwtBuffer, BufferT & revBuffer)
76 {
77 auto const start = ReadVarUint<uint64_t, Source>(source);
78
79 HuffmanCoder huffman;
80 huffman.ReadEncoding(source);
81
82 bwtBuffer.clear();
83 huffman.ReadAndDecode(source, std::back_inserter(bwtBuffer));
84
85 size_t const n = bwtBuffer.size();
86 MoveToFront mtf;
87 for (size_t i = 0; i < n; ++i)
88 {
89 auto const b = mtf[bwtBuffer[i]];
90 bwtBuffer[i] = b;
91 mtf.Transform(b);
92 }
93
94 if (n != 0)
95 CHECK_LESS(start, n, ());
96
97 revBuffer.resize(n);
98 RevBWT(n, static_cast<size_t>(start), bwtBuffer.data(), revBuffer.data());
99 }
100
101 template <typename Source>
102 static BufferT ReadAndDecodeBlock(Source & source)

Callers

nothing calls this directly

Calls 8

RevBWTFunction · 0.85
ReadEncodingMethod · 0.80
clearMethod · 0.45
ReadAndDecodeMethod · 0.45
sizeMethod · 0.45
TransformMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected