update lz4, lz5 and some fixes in zstdmt

This commit is contained in:
Tino Reichardt
2016-11-20 16:30:46 +01:00
parent fe3a65bfbd
commit 94b2bf5dec
13 changed files with 2313 additions and 2189 deletions

View File

@@ -15,6 +15,7 @@
#include <stdlib.h>
#define ZSTD_STATIC_LINKING_ONLY
//#define DEBUGME
#include "zstd.h"
#include "mem.h"
@@ -114,12 +115,20 @@ ZSTDMT_CCtx *ZSTDMT_createCCtx(int threads, int level, int inputsize)
if (inputsize)
ctx->inputsize = inputsize;
else {
/* XXX - windowlog */ const int mb[] = {
2, 2, 4, 4, 6, 6, 6, /* 1 - 7 */
8, 8, 8, 8, 8, 8, 8, /* 8 - 14 */
16, 16, 16, 16, 16, 16, 16, 16 /* 15 - 22 */
#ifndef DEBUGME
const int windowLog[] = {
0, 19, 19, 20, 20, 20, 21, 21,
21, 21, 21, 22, 22, 22, 22, 22,
23, 23, 23, 23, 23, 25, 26, 27
};
ctx->inputsize = 1024 * 1024 * mb[level - 1];
ctx->inputsize = 1 << (windowLog[level] + 1);
#else
const int mb[] = { 0, 1, 1, 1, 2, 2, 2,
3, 3, 3, 4, 4, 4, 5,
5, 5, 5, 5, 5, 5, 5
};
ctx->inputsize = 1024 * 1024 * mb[level];
#endif
}
/* setup ctx */