mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-01-14 02:32:28 +00:00
Tiny token reduction, ratio increase for some data
This commit is contained in:
parent
61fb2b881e
commit
79fadb350e
@ -361,13 +361,12 @@ static int lzsa_optimize_command_count_v1(lzsa_compressor *pCompressor, const un
|
||||
}
|
||||
}
|
||||
|
||||
if ((i + pMatch->length) <= nEndOffset && pMatch->offset > 0 && pMatch->length >= MIN_MATCH_SIZE_V1 &&
|
||||
if ((i + pMatch->length) < nEndOffset && pMatch->offset > 0 && pMatch->length >= MIN_MATCH_SIZE_V1 &&
|
||||
pBestMatch[i + pMatch->length].offset > 0 &&
|
||||
pBestMatch[i + pMatch->length].length >= MIN_MATCH_SIZE_V1 &&
|
||||
(pMatch->length + pBestMatch[i + pMatch->length].length) >= LEAVE_ALONE_MATCH_SIZE &&
|
||||
(pMatch->length + pBestMatch[i + pMatch->length].length) <= MAX_VARLEN &&
|
||||
(i + pMatch->length) > pMatch->offset &&
|
||||
(i + pMatch->length) > pBestMatch[i + pMatch->length].offset &&
|
||||
(i + pMatch->length) >= pMatch->offset &&
|
||||
(i + pMatch->length) >= pBestMatch[i + pMatch->length].offset &&
|
||||
(i + pMatch->length + pBestMatch[i + pMatch->length].length) <= nEndOffset &&
|
||||
!memcmp(pInWindow + i - pMatch->offset + pMatch->length,
|
||||
pInWindow + i + pMatch->length - pBestMatch[i + pMatch->length].offset,
|
||||
@ -386,6 +385,7 @@ static int lzsa_optimize_command_count_v1(lzsa_compressor *pCompressor, const un
|
||||
pMatch->length += pBestMatch[i + nMatchLen].length;
|
||||
pBestMatch[i + nMatchLen].offset = 0;
|
||||
pBestMatch[i + nMatchLen].length = -1;
|
||||
nDidReduce = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -857,13 +857,12 @@ static int lzsa_optimize_command_count_v2(lzsa_compressor *pCompressor, const un
|
||||
}
|
||||
}
|
||||
|
||||
if ((i + pMatch->length) <= nEndOffset && pMatch->offset > 0 && pMatch->length >= MIN_MATCH_SIZE_V2 &&
|
||||
if ((i + pMatch->length) < nEndOffset && pMatch->offset > 0 && pMatch->length >= MIN_MATCH_SIZE_V2 &&
|
||||
pBestMatch[i + pMatch->length].offset > 0 &&
|
||||
pBestMatch[i + pMatch->length].length >= MIN_MATCH_SIZE_V2 &&
|
||||
(pMatch->length + pBestMatch[i + pMatch->length].length) >= LEAVE_ALONE_MATCH_SIZE &&
|
||||
(pMatch->length + pBestMatch[i + pMatch->length].length) <= MAX_VARLEN &&
|
||||
(i + pMatch->length) > pMatch->offset &&
|
||||
(i + pMatch->length) > pBestMatch[i + pMatch->length].offset &&
|
||||
(i + pMatch->length) >= pMatch->offset &&
|
||||
(i + pMatch->length) >= pBestMatch[i + pMatch->length].offset &&
|
||||
(i + pMatch->length + pBestMatch[i + pMatch->length].length) <= nEndOffset &&
|
||||
!memcmp(pInWindow + i - pMatch->offset + pMatch->length,
|
||||
pInWindow + i + pMatch->length - pBestMatch[i + pMatch->length].offset,
|
||||
|
Loading…
x
Reference in New Issue
Block a user