mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-13 22:11:37 -06:00
Update to Fast LZMA2 1.0.0
This commit is contained in:
@@ -24,13 +24,13 @@ class CEncoder:
|
||||
CLzma2EncHandle _encoder;
|
||||
public:
|
||||
MY_UNKNOWN_IMP4(
|
||||
ICompressCoder,
|
||||
ICompressSetCoderProperties,
|
||||
ICompressWriteCoderProperties,
|
||||
ICompressSetCoderPropertiesOpt)
|
||||
ICompressCoder,
|
||||
ICompressSetCoderProperties,
|
||||
ICompressWriteCoderProperties,
|
||||
ICompressSetCoderPropertiesOpt)
|
||||
|
||||
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
|
||||
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
|
||||
STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
|
||||
STDMETHOD(SetCoderPropertiesOpt)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
|
||||
@@ -45,10 +45,33 @@ class CFastEncoder :
|
||||
public ICompressWriteCoderProperties,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
FL2_CCtx* _encoder;
|
||||
CByteBuffer inBuffer;
|
||||
UInt64 reduceSize;
|
||||
UInt32 dictSize;
|
||||
class FastLzma2
|
||||
{
|
||||
public:
|
||||
FastLzma2();
|
||||
~FastLzma2();
|
||||
HRESULT SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
|
||||
size_t GetDictSize() const;
|
||||
HRESULT Begin();
|
||||
BYTE* GetAvailableBuffer(unsigned long& size);
|
||||
HRESULT AddByteCount(size_t count, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
|
||||
HRESULT End(ISequentialOutStream *outStream, ICompressProgressInfo *progress);
|
||||
void Cancel();
|
||||
|
||||
private:
|
||||
bool UpdateProgress(ICompressProgressInfo *progress);
|
||||
HRESULT WaitAndReport(size_t& res, ICompressProgressInfo *progress);
|
||||
HRESULT WriteBuffers(ISequentialOutStream *outStream);
|
||||
|
||||
FL2_CStream* fcs;
|
||||
FL2_dictBuffer dict;
|
||||
size_t dict_pos;
|
||||
|
||||
FastLzma2(const FastLzma2&) = delete;
|
||||
FastLzma2& operator=(const FastLzma2&) = delete;
|
||||
};
|
||||
|
||||
FastLzma2 _encoder;
|
||||
|
||||
public:
|
||||
MY_UNKNOWN_IMP3(
|
||||
@@ -57,7 +80,7 @@ public:
|
||||
ICompressWriteCoderProperties)
|
||||
|
||||
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
|
||||
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
|
||||
STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user