Implement custom LZMA dictionary size for NE

This commit is contained in:
vit9696 2019-01-03 22:53:31 +03:00
parent f074dfc5ca
commit be2cdc7dfe
8 changed files with 124 additions and 104 deletions

View file

@ -64,7 +64,8 @@ LzmaCompress (
CONST UINT8 *Source,
UINT32 SourceSize,
UINT8 *Destination,
UINT32 *DestinationSize
UINT32 *DestinationSize,
UINT32 DictionarySize
)
{
SRes LzmaResult;
@ -79,8 +80,7 @@ LzmaCompress (
}
LzmaEncProps_Init(&props);
// TODO: need to detect this instead of hardcoding
props.dictSize = LZMA_DICTIONARY_SIZE;
props.dictSize = DictionarySize;
props.level = 9;
props.fb = 273;

View file

@ -21,7 +21,7 @@
extern "C" {
#endif
#define LZMA_DICTIONARY_SIZE 0x800000
#define DEFAULT_LZMA_DICTIONARY_SIZE 0x800000
#define _LZMA_SIZE_OPT
USTATUS
@ -30,7 +30,8 @@ extern "C" {
const UINT8 *Source,
UINT32 SourceSize,
UINT8 *Destination,
UINT32 *DestinationSize
UINT32 *DestinationSize,
UINT32 DictionarySize
);
#ifdef __cplusplus