Further compression and png work.
This commit is contained in:
parent
318b481ccc
commit
9c8faa534b
34 changed files with 1164 additions and 203 deletions
30
test/core/TestBitStream.cpp
Normal file
30
test/core/TestBitStream.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include "ByteUtils.h"
|
||||
#include "BufferBitStream.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::vector<std::string> bytes{"11100101", "00110101", "00010001"};
|
||||
|
||||
BufferBitStream stream;
|
||||
for(const auto& byte : bytes)
|
||||
{
|
||||
stream.writeByte(ByteUtils::getFromString(byte));
|
||||
}
|
||||
|
||||
unsigned char buffer{0} ;
|
||||
auto valid = stream.readNextNBits(3, buffer);
|
||||
std::cout << "Slice0 is " << ByteUtils::toString(buffer) << std::endl;
|
||||
|
||||
valid = stream.readNextNBits(3, buffer);
|
||||
std::cout << "Slice1 is " << ByteUtils::toString(buffer) << std::endl;
|
||||
|
||||
valid = stream.readNextNBits(5, buffer);
|
||||
std::cout << "Slice2 is " << ByteUtils::toString(buffer) << std::endl;
|
||||
|
||||
valid = stream.readNextNBits(7, buffer);
|
||||
std::cout << "Slice3 is " << ByteUtils::toString(buffer) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue