mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-09 08:07:19 -06:00
merge multi threading to master branch
- updated zstd to latest devel release - lz4, lz5 and zstd is included now - all three support threading
This commit is contained in:
63
CPP/7zip/Compress/Lz4Encoder.h
Normal file
63
CPP/7zip/Compress/Lz4Encoder.h
Normal file
@@ -0,0 +1,63 @@
|
||||
// (C) 2016 Tino Reichardt
|
||||
|
||||
#define LZ4_STATIC_LINKING_ONLY
|
||||
#include "../../../C/Alloc.h"
|
||||
#include "../../../C/Threads.h"
|
||||
#include "../../../C/lz4/lz4.h"
|
||||
#include "../../../C/zstdmt/lz4mt.h"
|
||||
|
||||
#include "../../Common/Common.h"
|
||||
#include "../../Common/MyCom.h"
|
||||
#include "../ICoder.h"
|
||||
#include "../Common/StreamUtils.h"
|
||||
|
||||
#ifndef EXTRACT_ONLY
|
||||
namespace NCompress {
|
||||
namespace NLZ4 {
|
||||
|
||||
struct CProps
|
||||
{
|
||||
CProps() { clear (); }
|
||||
void clear ()
|
||||
{
|
||||
memset(this, 0, sizeof (*this));
|
||||
_ver_major = LZ4_VERSION_MAJOR;
|
||||
_ver_minor = LZ4_VERSION_MINOR;
|
||||
_level = 3;
|
||||
}
|
||||
|
||||
Byte _ver_major;
|
||||
Byte _ver_minor;
|
||||
Byte _level;
|
||||
Byte _reserved[2];
|
||||
};
|
||||
|
||||
class CEncoder:
|
||||
public ICompressCoder,
|
||||
public ICompressSetCoderProperties,
|
||||
public ICompressWriteCoderProperties,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
CProps _props;
|
||||
|
||||
UInt64 _processedIn;
|
||||
UInt64 _processedOut;
|
||||
UInt32 _inputSize;
|
||||
UInt32 _numThreads;
|
||||
|
||||
LZ4MT_CCtx *_ctx;
|
||||
HRESULT CEncoder::ErrorOut(size_t code);
|
||||
|
||||
public:
|
||||
MY_UNKNOWN_IMP2 (ICompressSetCoderProperties, ICompressWriteCoderProperties)
|
||||
STDMETHOD (Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
|
||||
STDMETHOD (SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
|
||||
STDMETHOD (WriteCoderProperties)(ISequentialOutStream *outStream);
|
||||
STDMETHODIMP CEncoder::SetNumberOfThreads(UInt32 numThreads);
|
||||
|
||||
CEncoder();
|
||||
virtual ~CEncoder();
|
||||
};
|
||||
|
||||
}}
|
||||
#endif
|
||||
Reference in New Issue
Block a user