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

Method Encode

libs/coding/elias_coder.hpp:48–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46public:
47 template <typename TWriter>
48 static bool Encode(BitWriter<TWriter> & writer, uint64_t value)
49 {
50 if (value == 0)
51 return false;
52
53 uint8_t const n = bits::FloorLog(value);
54 ASSERT_LESS_OR_EQUAL(n, 63, ());
55 if (!GammaCoder::Encode(writer, n + 1))
56 return false;
57
58 writer.WriteAtMost64Bits(value, n);
59 return true;
60 }
61
62 template <typename TReader>
63 static uint64_t Decode(BitReader<TReader> & reader)

Callers

nothing calls this directly

Calls 3

FloorLogFunction · 0.85
WriteAtMost64BitsMethod · 0.80
EncodeFunction · 0.70

Tested by

no test coverage detected