| 53 | } |
| 54 | |
| 55 | void encodeFm(std::vector<bool>& bits, unsigned& cursor, const Bytes& input) |
| 56 | { |
| 57 | if (bits.size() == 0) |
| 58 | return; |
| 59 | unsigned len = bits.size() - 1; |
| 60 | |
| 61 | for (uint8_t b : input) |
| 62 | { |
| 63 | for (int i = 0; i < 8; i++) |
| 64 | { |
| 65 | bool bit = b & 0x80; |
| 66 | b <<= 1; |
| 67 | |
| 68 | if (cursor >= len) |
| 69 | return; |
| 70 | |
| 71 | bits[cursor++] = true; |
| 72 | bits[cursor++] = bit; |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | void encodeMfm(std::vector<bool>& bits, |
| 78 | unsigned& cursor, |
no test coverage detected