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

Method EncodeAndWriteBlock

libs/coding/bwt_coder.hpp:27–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26 template <typename Sink>
27 static void EncodeAndWriteBlock(Sink & sink, size_t n, uint8_t const * s, BufferT & bwtBuffer)
28 {
29 bwtBuffer.resize(n);
30 auto const start = BWT(n, s, bwtBuffer.data());
31
32 MoveToFront mtf;
33 for (auto & b : bwtBuffer)
34 b = mtf.Transform(b);
35
36 WriteVarUint(sink, start);
37
38 HuffmanCoder huffman;
39 huffman.Init(bwtBuffer.begin(), bwtBuffer.end());
40 huffman.WriteEncoding(sink);
41 huffman.EncodeAndWrite(sink, bwtBuffer.begin(), bwtBuffer.end());
42 }
43
44 template <typename Sink>
45 static void EncodeAndWriteBlock(Sink & sink, size_t n, uint8_t const * s)

Callers

nothing calls this directly

Calls 11

BWTFunction · 0.85
WriteVarUintFunction · 0.85
WriteEncodingMethod · 0.80
resizeMethod · 0.45
dataMethod · 0.45
TransformMethod · 0.45
InitMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
EncodeAndWriteMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected