Mark Repeated Offset Table as Needing Check
This commit is contained in:
parent
db4c8d05b3
commit
37f17ee237
@ -2235,13 +2235,6 @@ MEM_STATIC size_t ZSTD_compressSequences(seqStore_t* seqStorePtr,
|
|||||||
if (cSize >= maxCSize) return 0; /* block not compressed */
|
if (cSize >= maxCSize) return 0; /* block not compressed */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We check that dictionaries have offset codes available for the first
|
|
||||||
* block. After the first block, the offcode table might not have large
|
|
||||||
* enough codes to represent the offsets in the data.
|
|
||||||
*/
|
|
||||||
if (nextEntropy->fse.offcode_repeatMode == FSE_repeat_valid)
|
|
||||||
nextEntropy->fse.offcode_repeatMode = FSE_repeat_check;
|
|
||||||
|
|
||||||
return cSize;
|
return cSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2380,12 +2373,20 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
|
|||||||
&zc->appliedParams,
|
&zc->appliedParams,
|
||||||
dst, dstCapacity,
|
dst, dstCapacity,
|
||||||
srcSize, zc->entropyWorkspace, zc->bmi2);
|
srcSize, zc->entropyWorkspace, zc->bmi2);
|
||||||
if (ZSTD_isError(cSize) || cSize == 0) return cSize;
|
if (!ZSTD_isError(cSize) && cSize != 0) {
|
||||||
/* confirm repcodes and entropy tables */
|
/* confirm repcodes and entropy tables */
|
||||||
{ ZSTD_compressedBlockState_t* const tmp = zc->blockState.prevCBlock;
|
ZSTD_compressedBlockState_t* const tmp = zc->blockState.prevCBlock;
|
||||||
zc->blockState.prevCBlock = zc->blockState.nextCBlock;
|
zc->blockState.prevCBlock = zc->blockState.nextCBlock;
|
||||||
zc->blockState.nextCBlock = tmp;
|
zc->blockState.nextCBlock = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We check that dictionaries have offset codes available for the first
|
||||||
|
* block. After the first block, the offcode table might not have large
|
||||||
|
* enough codes to represent the offsets in the data.
|
||||||
|
*/
|
||||||
|
if (zc->blockState.prevCBlock->entropy.fse.offcode_repeatMode == FSE_repeat_valid)
|
||||||
|
zc->blockState.prevCBlock->entropy.fse.offcode_repeatMode = FSE_repeat_check;
|
||||||
|
|
||||||
return cSize;
|
return cSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user