This commit is contained in:
Andrey Gumirov
2024-01-11 13:48:10 +07:00
parent a2b5c8117d
commit b9b0ab5edb
4 changed files with 54 additions and 60 deletions

View File

@ -6,11 +6,6 @@
// i.e when stream is 0b12345678 0bABCDEFGH and command is
// to read 12 bits:
// out = 00000000 00000000 0000EFGH 12345678 -- wrong
// to read 2 bits:
// out = 00000000 00000000 00000000 00000078
// TODO:
// to read 12 bits:
// out = 00000000 00000000 00008765 4321HGFE
// to read 2 bits:
// out = 00000000 00000000 00000000 00000087
@ -55,7 +50,7 @@ int ibitstream::getbits(size_t n) {
// " inv " << std::bitset<8>(inv) << " out " << std::bitset<32>(out) << std::endl;
this->count += to_read;
read += to_read;
// read += to_read;
n -= to_read;
if (this->count == 8){