Replace Huffman boolean args with flags bit set
This commit is contained in:
committed by
Nick Terrell
parent
0cc1b0cb22
commit
329169189c
@@ -141,6 +141,7 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
|
||||
U32 const lhc = MEM_readLE32(istart);
|
||||
size_t hufSuccess;
|
||||
size_t expectedWriteSize = MIN(ZSTD_BLOCKSIZE_MAX, dstCapacity);
|
||||
int const flags = ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0;
|
||||
switch(lhlCode)
|
||||
{
|
||||
case 0: case 1: default: /* note : default is impossible, since lhlCode into [0..3] */
|
||||
@@ -180,33 +181,33 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
|
||||
|
||||
if (litEncType==set_repeat) {
|
||||
if (singleStream) {
|
||||
hufSuccess = HUF_decompress1X_usingDTable_bmi2(
|
||||
hufSuccess = HUF_decompress1X_usingDTable(
|
||||
dctx->litBuffer, litSize, istart+lhSize, litCSize,
|
||||
dctx->HUFptr, ZSTD_DCtx_get_bmi2(dctx));
|
||||
dctx->HUFptr, flags);
|
||||
} else {
|
||||
assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
|
||||
hufSuccess = HUF_decompress4X_usingDTable_bmi2(
|
||||
hufSuccess = HUF_decompress4X_usingDTable(
|
||||
dctx->litBuffer, litSize, istart+lhSize, litCSize,
|
||||
dctx->HUFptr, ZSTD_DCtx_get_bmi2(dctx));
|
||||
dctx->HUFptr, flags);
|
||||
}
|
||||
} else {
|
||||
if (singleStream) {
|
||||
#if defined(HUF_FORCE_DECOMPRESS_X2)
|
||||
hufSuccess = HUF_decompress1X_DCtx_wksp_bmi2(
|
||||
hufSuccess = HUF_decompress1X_DCtx_wksp(
|
||||
dctx->entropy.hufTable, dctx->litBuffer, litSize,
|
||||
istart+lhSize, litCSize, dctx->workspace,
|
||||
sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx));
|
||||
sizeof(dctx->workspace), flags);
|
||||
#else
|
||||
hufSuccess = HUF_decompress1X1_DCtx_wksp_bmi2(
|
||||
hufSuccess = HUF_decompress1X1_DCtx_wksp(
|
||||
dctx->entropy.hufTable, dctx->litBuffer, litSize,
|
||||
istart+lhSize, litCSize, dctx->workspace,
|
||||
sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx));
|
||||
sizeof(dctx->workspace), flags);
|
||||
#endif
|
||||
} else {
|
||||
hufSuccess = HUF_decompress4X_hufOnly_wksp_bmi2(
|
||||
hufSuccess = HUF_decompress4X_hufOnly_wksp(
|
||||
dctx->entropy.hufTable, dctx->litBuffer, litSize,
|
||||
istart+lhSize, litCSize, dctx->workspace,
|
||||
sizeof(dctx->workspace), ZSTD_DCtx_get_bmi2(dctx));
|
||||
sizeof(dctx->workspace), flags);
|
||||
}
|
||||
}
|
||||
if (dctx->litBufferLocation == ZSTD_split)
|
||||
|
||||
Reference in New Issue
Block a user