summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-05-05 21:32:57 (GMT)
committerYann Collet <cyan@fb.com>2018-05-05 21:32:57 (GMT)
commitcdb0275b7f7513e13a05c27adea658614c0174d9 (patch)
tree81cebe4dc20ae02c7692135267d9cc5f069427e8 /lib/lz4hc.c
parenta4e918d7a6e85f825f4cb1ac1c08a2cf2fc22194 (diff)
downloadlz4-cdb0275b7f7513e13a05c27adea658614c0174d9.zip
lz4-cdb0275b7f7513e13a05c27adea658614c0174d9.tar.gz
lz4-cdb0275b7f7513e13a05c27adea658614c0174d9.tar.bz2
lz4hc: fixed PA / SC parameter order
also : reserved PA for levels 9+ (instead of 8+). In most cases, speed is lower, and compression benefit is not worth.
Diffstat (limited to 'lib/lz4hc.c')
-rw-r--r--lib/lz4hc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index d29a989..1b3596f 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -382,7 +382,7 @@ int LZ4HC_InsertAndFindBestMatch(LZ4HC_CCtx_internal* const hc4, /* Index tabl
/* note : LZ4HC_InsertAndGetWiderMatch() is able to modify the starting position of a match (*startpos),
* but this won't be the case here, as we define iLowLimit==ip,
* so LZ4HC_InsertAndGetWiderMatch() won't be allowed to search past ip */
- return LZ4HC_InsertAndGetWiderMatch(hc4, ip, ip, iLimit, MINMATCH-1, matchpos, &uselessPtr, maxNbAttempts, 0 /* chainSwap */, patternAnalysis, dict, favorCompressionRatio);
+ return LZ4HC_InsertAndGetWiderMatch(hc4, ip, ip, iLimit, MINMATCH-1, matchpos, &uselessPtr, maxNbAttempts, patternAnalysis, 0 /*chainSwap*/, dict, favorCompressionRatio);
}
@@ -477,7 +477,7 @@ LZ4_FORCE_INLINE int LZ4HC_compress_hashChain (
)
{
const int inputSize = *srcSizePtr;
- const int patternAnalysis = (maxNbAttempts > 64); /* levels 8+ */
+ const int patternAnalysis = (maxNbAttempts > 128); /* levels 9+ */
const BYTE* ip = (const BYTE*) source;
const BYTE* anchor = ip;
@@ -515,7 +515,7 @@ _Search2:
if (ip+ml <= mflimit) {
ml2 = LZ4HC_InsertAndGetWiderMatch(ctx,
ip + ml - 2, ip + 0, matchlimit, ml, &ref2, &start2,
- maxNbAttempts, 0, patternAnalysis, dict, favorCompressionRatio);
+ maxNbAttempts, patternAnalysis, 0, dict, favorCompressionRatio);
} else {
ml2 = ml;
}
@@ -560,7 +560,7 @@ _Search3:
if (start2 + ml2 <= mflimit) {
ml3 = LZ4HC_InsertAndGetWiderMatch(ctx,
start2 + ml2 - 3, start2, matchlimit, ml2, &ref3, &start3,
- maxNbAttempts, 0, patternAnalysis, dict, favorCompressionRatio);
+ maxNbAttempts, patternAnalysis, 0, dict, favorCompressionRatio);
} else {
ml3 = ml2;
}
@@ -1128,7 +1128,7 @@ LZ4HC_FindLongerMatch(LZ4HC_CCtx_internal* const ctx,
/* note : LZ4HC_InsertAndGetWiderMatch() is able to modify the starting position of a match (*startpos),
* but this won't be the case here, as we define iLowLimit==ip,
* so LZ4HC_InsertAndGetWiderMatch() won't be allowed to search past ip */
- int matchLength = LZ4HC_InsertAndGetWiderMatch(ctx, ip, ip, iHighLimit, minLen, &matchPtr, &ip, nbSearches, 1 /*chainSwap*/, 1 /*patternAnalysis*/, dict, favorDecSpeed);
+ int matchLength = LZ4HC_InsertAndGetWiderMatch(ctx, ip, ip, iHighLimit, minLen, &matchPtr, &ip, nbSearches, 1 /*patternAnalysis*/, 1 /*chainSwap*/, dict, favorDecSpeed);
if (matchLength <= minLen) return match;
if (favorDecSpeed) {
if ((matchLength>18) & (matchLength<=36)) matchLength=18; /* favor shortcut */