Add some bit utils and initial l77 encoder.
This commit is contained in:
parent
ff962a6b16
commit
318b481ccc
12 changed files with 508 additions and 117 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "HuffmanEncoder.h"
|
||||
#include "RunLengthEncoder.h"
|
||||
#include "Lz77Encoder.h"
|
||||
|
||||
void test_run_length_encoder()
|
||||
{
|
||||
|
@ -34,13 +35,30 @@ void test_huffman_encoder()
|
|||
|
||||
HuffmanEncoder encoder;
|
||||
encoder.encode(counts);
|
||||
|
||||
}
|
||||
|
||||
void test_lz77_encoder()
|
||||
{
|
||||
std::string test_data = "sir sid eastman easily teases sea sick seals";
|
||||
//std::string test_data = "sir sid eastman";
|
||||
|
||||
Lz77Encoder encoder;
|
||||
auto encoded = encoder.encode(test_data);
|
||||
|
||||
std::cout << "Encoded: " << encoded << std::endl;
|
||||
|
||||
//auto decoded = encoder.decode(encoded);
|
||||
|
||||
//std::cout << "Decoded: " << decoded << std::endl;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
test_huffman_encoder();
|
||||
//test_huffman_encoder();
|
||||
|
||||
//test_run_length_encoder();
|
||||
|
||||
test_lz77_encoder();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue