MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / decode

Function decode

arch/victor9k/decoder.cc:33–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static Bytes decode(const std::vector<bool>& bits)
34{
35 Bytes output;
36 ByteWriter bw(output);
37 BitWriter bitw(bw);
38
39 auto ii = bits.begin();
40 while (ii != bits.end())
41 {
42 uint8_t inputfifo = 0;
43 for (size_t i = 0; i < 5; i++)
44 {
45 if (ii == bits.end())
46 break;
47 inputfifo = (inputfifo << 1) | *ii++;
48 }
49
50 uint8_t decoded = decode_data_gcr(inputfifo);
51 bitw.push(decoded, 4);
52 }
53 bitw.flush();
54
55 return output;
56}
57
58class Victor9kDecoder : public Decoder
59{

Callers 2

decodeSectorRecordMethod · 0.70
decodeDataRecordMethod · 0.70

Calls 5

flushMethod · 0.80
decode_data_gcrFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected