diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2018-12-29 06:51:10 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2018-12-29 06:51:10 +0000 |
commit | af73257b093737838d6086890c91f6ec13291ea7 (patch) | |
tree | 2a77a57a2955d56119af575c220abba2c7e4fd30 /lib/compress/fse_compress.c | |
parent | 706cfae467a217cc786fd96a72cc2e33c61987e4 (diff) |
Diffstat (limited to 'lib/compress/fse_compress.c')
-rw-r--r-- | lib/compress/fse_compress.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compress/fse_compress.c b/lib/compress/fse_compress.c index 4408f0ed5b506..60f357bbd24e1 100644 --- a/lib/compress/fse_compress.c +++ b/lib/compress/fse_compress.c @@ -115,7 +115,7 @@ size_t FSE_buildCTable_wksp(FSE_CTable* ct, /* symbol start positions */ { U32 u; cumul[0] = 0; - for (u=1; u<=maxSymbolValue+1; u++) { + for (u=1; u <= maxSymbolValue+1; u++) { if (normalizedCounter[u-1]==-1) { /* Low proba symbol */ cumul[u] = cumul[u-1] + 1; tableSymbol[highThreshold--] = (FSE_FUNCTION_TYPE)(u-1); @@ -658,7 +658,7 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src BYTE* op = ostart; BYTE* const oend = ostart + dstSize; - U32 count[FSE_MAX_SYMBOL_VALUE+1]; + unsigned count[FSE_MAX_SYMBOL_VALUE+1]; S16 norm[FSE_MAX_SYMBOL_VALUE+1]; FSE_CTable* CTable = (FSE_CTable*)workSpace; size_t const CTableSize = FSE_CTABLE_SIZE_U32(tableLog, maxSymbolValue); @@ -672,7 +672,7 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src if (!tableLog) tableLog = FSE_DEFAULT_TABLELOG; /* Scan input and build symbol stats */ - { CHECK_V_F(maxCount, HIST_count_wksp(count, &maxSymbolValue, src, srcSize, (unsigned*)scratchBuffer) ); + { CHECK_V_F(maxCount, HIST_count_wksp(count, &maxSymbolValue, src, srcSize, scratchBuffer, scratchBufferSize) ); if (maxCount == srcSize) return 1; /* only a single symbol in src : rle */ if (maxCount == 1) return 0; /* each symbol present maximum once => not compressible */ if (maxCount < (srcSize >> 7)) return 0; /* Heuristic : not compressible enough */ |