47 uint16_t bytesToRead = blockdesc & 0x7fff;
49 if (blockdesc & 0x8000) {
55 std::vector<uint8_t> indata(bytesToRead + 2);
56 input->
readInto(&indata[0], bytesToRead);
65 const int64_t c_nRingBufferSize = 4096;
66 const int64_t c_nMatchLengthUpperLimit = 18;
67 const int64_t c_nThreshold = 2;
69 char buffer[c_nRingBufferSize + c_nMatchLengthUpperLimit - 1];
80 for (i = 0; i < c_nRingBufferSize - c_nMatchLengthUpperLimit; i++) {
84 r = c_nRingBufferSize - c_nMatchLengthUpperLimit;
86 while ( ibuf < len ) {
87 if (((flags >>= 1) & 256) == 0) {
97 r &= (c_nRingBufferSize - 1);
102 i |= ((j & 0xf0) << 4);
103 j = (j & 0x0f) + c_nThreshold;
105 for (k = 0; k <= j; k++) {
106 c = buffer[(i + k) & (c_nRingBufferSize - 1)];
111 r &= (c_nRingBufferSize - 1);
uint16_t read16Big()
reads a uint16_t bigEndian and converts them to the host-byteorder
void LZSSDecode(uint8_t *in, int64_t len, uint8_t *out)
~LZSSDecoder()
Destructor.
void readInto(uint8_t *buffer, size_t len)
read len bytes into buffer
void decode(RawData *input, uint8_t *output, const uint32_t outputsize)
Decodes from a file into a pointer.
LZSSDecoder()
Constructor.
Used to access diffrent kinds of data.