summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2018-05-05 20:46:45 (GMT)
committerYann Collet <cyan@fb.com>2018-05-05 20:46:45 (GMT)
commitd097bf93f853ddefdd05321d65cf7b90e3171c14 (patch)
tree0d929bf9eb1342dfa9c9541d9e5dbe813049dbb5
parentfa89a9e18b93741c65fa84c293d15298169d1ecb (diff)
downloadlz4-d097bf93f853ddefdd05321d65cf7b90e3171c14.zip
lz4-d097bf93f853ddefdd05321d65cf7b90e3171c14.tar.gz
lz4-d097bf93f853ddefdd05321d65cf7b90e3171c14.tar.bz2
fixed SC.opt integration with regular HC parser
Only enabled when searching forward. note : it slighly improves compression ratio, but measurably decreases speed. Trade-off to analyse.
-rw-r--r--lib/lz4hc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index 7e2fcb3..0f37f42 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -280,9 +280,9 @@ LZ4HC_InsertAndGetWiderMatch (
*startpos = ip + back;
} } }
- if (mlt == longest) { /* better match => select a better chain */
- assert(longest >= MINMATCH);
- if (1 && matchIndex + longest <= ipIndex) {
+ if ( lookBackLength==0 /* search forward only */
+ && mlt==longest) { /* better match => select a better chain */
+ if (matchIndex + longest <= ipIndex) {
U32 distanceToNextMatch = 1;
int pos;
for (pos = 0; pos <= longest - MINMATCH; pos++) {
@@ -301,7 +301,7 @@ LZ4HC_InsertAndGetWiderMatch (
}
{ U32 const distNextMatch = DELTANEXTU16(chainTable, matchIndex);
- if (1 && patternAnalysis && distNextMatch==1 && matchChainPos==0) {
+ if (patternAnalysis && distNextMatch==1 && matchChainPos==0) {
U32 const matchCandidateIdx = matchIndex-1;
/* may be a repeated pattern */
if (repeat == rep_untested) {