Core lib building
This commit is contained in:
parent
3ed195d7dd
commit
94fcc42aed
73 changed files with 625 additions and 661 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "StringUtils.h"
|
||||
#include "BitStream.h"
|
||||
#include "ByteUtils.h"
|
||||
#include "Bits.h"
|
||||
#include "HuffmanEncoder.h"
|
||||
|
||||
#include <iostream>
|
||||
|
@ -234,7 +234,7 @@ void Lz77Encoder::flushHitBuffer()
|
|||
if (length == 0)
|
||||
{
|
||||
code = *mCodeGenerator->getLiteralValue(next_char);
|
||||
std::cout << "Writing symbol " << static_cast<int>(next_char) << " with code " << ByteUtils::toString(code.getData(), code.getLength()) << "\n";
|
||||
std::cout << "Writing symbol " << static_cast<int>(next_char) << " with code " << Bits::toString(code.getData(), code.getLength()) << "\n";
|
||||
|
||||
mOutputStream->writeNBits(code.getData(), code.getLength());
|
||||
}
|
||||
|
@ -243,16 +243,16 @@ void Lz77Encoder::flushHitBuffer()
|
|||
code = *mCodeGenerator->getLengthValue(length);
|
||||
const auto distance_code = mCodeGenerator->getDistanceValue(distance);
|
||||
|
||||
std::cout << "Writing length " << length << " with code " << ByteUtils::toString(code.getData(), code.getLength()) << "\n";
|
||||
std::cout << "Writing length " << length << " with code " << Bits::toString(code.getData(), code.getLength()) << "\n";
|
||||
mOutputStream->writeNBits(code.getData(), code.getLength());
|
||||
|
||||
std::cout << "Writing distance " << distance << " with code " << ByteUtils::toString(distance_code.getData(), distance_code.getLength()) << "\n";
|
||||
std::cout << "Writing distance " << distance << " with code " << Bits::toString(distance_code.getData(), distance_code.getLength()) << "\n";
|
||||
mOutputStream->writeNBits(distance_code.getData(), distance_code.getLength());
|
||||
}
|
||||
}
|
||||
|
||||
auto eos_code = mCodeGenerator->getEndOfStreamValue();
|
||||
std::cout << "Writing EOS value with code " << ByteUtils::toString(eos_code->getData(), eos_code->getLength()) << "\n";
|
||||
std::cout << "Writing EOS value with code " << Bits::toString(eos_code->getData(), eos_code->getLength()) << "\n";
|
||||
|
||||
mOutputStream->writeNBits(eos_code->getData(), eos_code->getLength());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue