* Fix LZO

This commit is contained in:
Phillip Stephens 2014-09-09 09:53:32 -07:00
parent 2fa715cbbf
commit 6187eb3f77
7 changed files with 18 additions and 18 deletions

View File

@ -35,8 +35,8 @@ atInt32 decompressLZO(const atUint8* source, atInt32 sourceSize, atUint8* dst, a
atUint32 yaz0Decode(const atUint8* src, atUint8*& dst, atUint32 uncompressedSize);
atUint32 yaz0Encode(const atUint8* src, atUint32 srcSize, atUint8* data);
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst);
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst, bool extended = false);
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst);
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst, bool extended = false);
}
}
}

View File

@ -10,8 +10,8 @@ public:
explicit LZBase(atInt32 minimumOffset=1,atInt32 slidingWindow=4096, atInt32 minimumMatch=3, atInt32 blockSize=8);
virtual ~LZBase() {}
virtual atUint32 compress(const atUint8* src, atUint8*& dest, atUint32 srcLength)=0;
virtual atUint32 decompress(const atUint8* src, atUint8*& dest, atUint32 srcLength)=0;
virtual atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength)=0;
virtual atUint32 decompress(const atUint8* src, atUint8** dest, atUint32 srcLength)=0;
void setSlidingWindow(atInt32 SlidingWindow);
atInt32 slidingWindow();

View File

@ -6,8 +6,8 @@
class LZType10 : public LZBase {
public:
explicit LZType10(atInt32 minimumOffset=1, atInt32 SlidingWindow=4096, atInt32 MinimumMatch=3, atInt32 BlockSize=8);
atUint32 compress(const atUint8* src, atUint8*& dest, atUint32 srcLength);
atUint32 decompress(const atUint8* src, atUint8*& dst, atUint32 srcLen);
atUint32 compress(const atUint8* src, atUint8** dest, atUint32 srcLength);
atUint32 decompress(const atUint8* src, atUint8** dst, atUint32 srcLen);
};
#endif // LZ77TYPE10_HPP

View File

@ -7,8 +7,8 @@
class LZType11 : public LZBase {
public:
explicit LZType11(atInt32 MinimumOffset=1, atInt32 SlidingWindow=4096, atInt32 MinimumMatch=3, atInt32 BlockSize=8);
atUint32 compress(const atUint8 *src, atUint8*& dest, atUint32 srcLength);
atUint32 decompress(const atUint8 *src, atUint8*& dest, atUint32 srcLength);
atUint32 compress(const atUint8 *src, atUint8** dest, atUint32 srcLength);
atUint32 decompress(const atUint8 *src, atUint8** dest, atUint32 srcLength);
};

View File

@ -326,7 +326,7 @@ atUint32 simpleEnc(const atUint8* src, atInt32 size, atInt32 pos, atUint32 *pMat
return numBytes;
}
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst)
atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst)
{
LZBase* lzCodec;
if (*(atUint8*)src == 0x11)
@ -340,7 +340,7 @@ atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst)
return retLength;
}
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8* dst, bool extended)
atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst, bool extended)
{
LZBase* lzCodec;
if (extended)

View File

@ -11,7 +11,7 @@ LZType10::LZType10(atInt32 MinimumOffset, atInt32 SlidingWindow, atInt32 Minimum
m_readAheadBuffer = m_minMatch + 0xF;
}
atUint32 LZType10::compress(const atUint8* src, atUint8*& dstBuf, atUint32 srcLength)
atUint32 LZType10::compress(const atUint8* src, atUint8** dstBuf, atUint32 srcLength)
{
atUint32 encodeSize=(srcLength<<8)|(0x10);
encodeSize = Athena::utility::LittleUint32(encodeSize); //File size needs to be written as little endian always
@ -65,12 +65,12 @@ atUint32 LZType10::compress(const atUint8* src, atUint8*& dstBuf, atUint32 srcLe
while ((outbuf.position()%4) !=0 )
outbuf.writeByte(0);
dstBuf = outbuf.data();
*dstBuf = outbuf.data();
outbuf.save();
return outbuf.length();
}
atUint32 LZType10::decompress(const atUint8* src, atUint8*& dst, atUint32 srcLength)
atUint32 LZType10::decompress(const atUint8* src, atUint8** dst, atUint32 srcLength)
{
if (*(atUint8*)(src) != 0x10)
return 0;
@ -128,7 +128,7 @@ atUint32 LZType10::decompress(const atUint8* src, atUint8*& dst, atUint32 srcLen
}
}
dst = uncompressedData;
*dst = uncompressedData;
return uncompressedSize;
}

View File

@ -11,7 +11,7 @@ LZType11::LZType11(atInt32 minimumOffset, atInt32 slidingWindow, atInt32 minimum
m_lookupTable.setLookAheadWindow(m_readAheadBuffer);
}
atUint32 LZType11::compress(const atUint8* src, atUint8*& dst, atUint32 srcLength)
atUint32 LZType11::compress(const atUint8* src, atUint8** dst, atUint32 srcLength)
{
Athena::io::BinaryWriter outbuff("tmp");
if (srcLength>0xFFFFFF){// If length is greater than 24 bits or 16 Megs
@ -113,11 +113,11 @@ atUint32 LZType11::compress(const atUint8* src, atUint8*& dst, atUint32 srcLengt
while((outbuff.position()%4) !=0 )
outbuff.writeByte(0);
dst = outbuff.data();
*dst = outbuff.data();
return outbuff.length();
}
atUint32 LZType11::decompress(const atUint8* src, atUint8*& dst, atUint32 srcLength)
atUint32 LZType11::decompress(const atUint8* src, atUint8** dst, atUint32 srcLength)
{
if(*(atUint8*)(src) != 0x11)
return 0;
@ -207,7 +207,7 @@ atUint32 LZType11::decompress(const atUint8* src, atUint8*& dst, atUint32 srcLen
}
}
dst = uncompressedData;
*dst = uncompressedData;
return uncompressedLen;
}