mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-02-16 17:30:44 +00:00
Fix calculation for promoting literal+match seqs
This commit is contained in:
parent
b1738b4003
commit
8e4e7c06c7
@ -505,12 +505,13 @@ static int lzsa_optimize_command_count_v2(lzsa_compressor *pCompressor, const un
|
|||||||
if (pMatch->length == 0 &&
|
if (pMatch->length == 0 &&
|
||||||
(i + 1) < (nEndOffset - LAST_LITERALS) &&
|
(i + 1) < (nEndOffset - LAST_LITERALS) &&
|
||||||
pBestMatch[i + 1].length >= MIN_MATCH_SIZE_V2 &&
|
pBestMatch[i + 1].length >= MIN_MATCH_SIZE_V2 &&
|
||||||
|
pBestMatch[i + 1].length < MAX_VARLEN &&
|
||||||
pBestMatch[i + 1].offset &&
|
pBestMatch[i + 1].offset &&
|
||||||
i >= pBestMatch[i + 1].offset &&
|
i >= pBestMatch[i + 1].offset &&
|
||||||
(i + pBestMatch[i + 1].length + 1) <= (nEndOffset - LAST_LITERALS) &&
|
(i + pBestMatch[i + 1].length + 1) <= (nEndOffset - LAST_LITERALS) &&
|
||||||
!memcmp(pInWindow + i - (pBestMatch[i + 1].offset), pInWindow + i, pBestMatch[i + 1].length + 1)) {
|
!memcmp(pInWindow + i - (pBestMatch[i + 1].offset), pInWindow + i, pBestMatch[i + 1].length + 1)) {
|
||||||
int nCurLenSize = lzsa_get_match_varlen_size_v2(pBestMatch[i + 1].length);
|
int nCurLenSize = lzsa_get_match_varlen_size_v2(pBestMatch[i + 1].length - MIN_MATCH_SIZE_V2);
|
||||||
int nReducedLenSize = lzsa_get_match_varlen_size_v2(pBestMatch[i + 1].length + 1);
|
int nReducedLenSize = lzsa_get_match_varlen_size_v2(pBestMatch[i + 1].length + 1 - MIN_MATCH_SIZE_V2);
|
||||||
|
|
||||||
if ((nReducedLenSize - nCurLenSize) <= 8) {
|
if ((nReducedLenSize - nCurLenSize) <= 8) {
|
||||||
/* Merge */
|
/* Merge */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user