• Home
  • Raw
  • Download

Lines Matching +full:diff +full:- +full:sequences

5  * This source code is licensed under both the BSD-style license (found in the
8 * You may select, at your option, one of the above-listed licenses.
14 /*-*******************************************************
50 /*-*************************************************************
56 …size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSI… in ZSTD_blockSizeMax()
70 bpPtr->lastBlock = cBlockHeader & 1; in ZSTD_getcBlockSize()
71 bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3); in ZSTD_getcBlockSize()
72 bpPtr->origSize = cSize; /* only useful for RLE */ in ZSTD_getcBlockSize()
73 if (bpPtr->blockType == bt_rle) return 1; in ZSTD_getcBlockSize()
74 RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, ""); in ZSTD_getcBlockSize()
85 assert(dctx->isFrameDecompression || streaming == not_streaming); in ZSTD_allocateLiteralsBuffer()
93 dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH; in ZSTD_allocateLiteralsBuffer()
94 dctx->litBufferEnd = dctx->litBuffer + litSize; in ZSTD_allocateLiteralsBuffer()
95 dctx->litBufferLocation = ZSTD_in_dst; in ZSTD_allocateLiteralsBuffer()
100 dctx->litBuffer = dctx->litExtraBuffer; in ZSTD_allocateLiteralsBuffer()
101 dctx->litBufferEnd = dctx->litBuffer + litSize; in ZSTD_allocateLiteralsBuffer()
102 dctx->litBufferLocation = ZSTD_not_in_dst; in ZSTD_allocateLiteralsBuffer()
114 …dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OV… in ZSTD_allocateLiteralsBuffer()
115 dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE; in ZSTD_allocateLiteralsBuffer()
118 dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize; in ZSTD_allocateLiteralsBuffer()
119 dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize; in ZSTD_allocateLiteralsBuffer()
121 dctx->litBufferLocation = ZSTD_split; in ZSTD_allocateLiteralsBuffer()
122 assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize); in ZSTD_allocateLiteralsBuffer()
130 * stored in dctx->litExtraBuffer to help keep it "ahead" of the current output write.
148 DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block"); in ZSTD_decodeLiteralsBlock()
149 RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, ""); in ZSTD_decodeLiteralsBlock()
162 | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0); in ZSTD_decodeLiteralsBlock()
166 /* 2 - 2 - 10 - 10 */ in ZSTD_decodeLiteralsBlock()
173 /* 2 - 2 - 14 - 14 */ in ZSTD_decodeLiteralsBlock()
179 /* 2 - 2 - 18 - 18 */ in ZSTD_decodeLiteralsBlock()
189 "Not enough literals (%zu) for the 4-streams mode (min %u)", in ZSTD_decodeLiteralsBlock()
196 if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) { in ZSTD_decodeLiteralsBlock()
197 PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable)); in ZSTD_decodeLiteralsBlock()
203 dctx->litBuffer, litSize, istart+lhSize, litCSize, in ZSTD_decodeLiteralsBlock()
204 dctx->HUFptr, flags); in ZSTD_decodeLiteralsBlock()
208 dctx->litBuffer, litSize, istart+lhSize, litCSize, in ZSTD_decodeLiteralsBlock()
209 dctx->HUFptr, flags); in ZSTD_decodeLiteralsBlock()
215 dctx->entropy.hufTable, dctx->litBuffer, litSize, in ZSTD_decodeLiteralsBlock()
216 istart+lhSize, litCSize, dctx->workspace, in ZSTD_decodeLiteralsBlock()
217 sizeof(dctx->workspace), flags); in ZSTD_decodeLiteralsBlock()
220 dctx->entropy.hufTable, dctx->litBuffer, litSize, in ZSTD_decodeLiteralsBlock()
221 istart+lhSize, litCSize, dctx->workspace, in ZSTD_decodeLiteralsBlock()
222 sizeof(dctx->workspace), flags); in ZSTD_decodeLiteralsBlock()
226 dctx->entropy.hufTable, dctx->litBuffer, litSize, in ZSTD_decodeLiteralsBlock()
227 istart+lhSize, litCSize, dctx->workspace, in ZSTD_decodeLiteralsBlock()
228 sizeof(dctx->workspace), flags); in ZSTD_decodeLiteralsBlock()
231 if (dctx->litBufferLocation == ZSTD_split) in ZSTD_decodeLiteralsBlock()
234 …ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTR… in ZSTD_decodeLiteralsBlock()
235 …ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, lit… in ZSTD_decodeLiteralsBlock()
236 dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH; in ZSTD_decodeLiteralsBlock()
237 dctx->litBufferEnd -= WILDCOPY_OVERLENGTH; in ZSTD_decodeLiteralsBlock()
238 assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax); in ZSTD_decodeLiteralsBlock()
243 dctx->litPtr = dctx->litBuffer; in ZSTD_decodeLiteralsBlock()
244 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
245 dctx->litEntropy = 1; in ZSTD_decodeLiteralsBlock()
246 if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable; in ZSTD_decodeLiteralsBlock()
277 if (dctx->litBufferLocation == ZSTD_split) in ZSTD_decodeLiteralsBlock()
279 … ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize - ZSTD_LITBUFFEREXTRASIZE); in ZSTD_decodeLiteralsBlock()
280 …ZSTD_memcpy(dctx->litExtraBuffer, istart + lhSize + litSize - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUF… in ZSTD_decodeLiteralsBlock()
284 ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize); in ZSTD_decodeLiteralsBlock()
286 dctx->litPtr = dctx->litBuffer; in ZSTD_decodeLiteralsBlock()
287 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
291 dctx->litPtr = istart+lhSize; in ZSTD_decodeLiteralsBlock()
292 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
293 dctx->litBufferEnd = dctx->litPtr + litSize; in ZSTD_decodeLiteralsBlock()
294 dctx->litBufferLocation = ZSTD_not_in_dst; in ZSTD_decodeLiteralsBlock()
323 if (dctx->litBufferLocation == ZSTD_split) in ZSTD_decodeLiteralsBlock()
325 ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE); in ZSTD_decodeLiteralsBlock()
326 ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE); in ZSTD_decodeLiteralsBlock()
330 ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize); in ZSTD_decodeLiteralsBlock()
332 dctx->litPtr = dctx->litBuffer; in ZSTD_decodeLiteralsBlock()
333 dctx->litSize = litSize; in ZSTD_decodeLiteralsBlock()
350 dctx->isFrameDecompression = 0; in ZSTD_decodeLiteralsBlock_wrapper()
355 …* These are pre-calculated FSE decoding tables using default distributions as defined in specifica…
356 …* https://github.com/facebook/zstd/blob/release/doc/zstd_compression_format.md#default-distributio…
358 * - start from default distributions, present in /lib/common/zstd_internal.h
359 * - generate tables normally, using ZSTD_buildFSETable()
360 * - printout the content of tables
361 * - pretify output, report below, test with fuzzer to ensure it's correct */
469 DTableH->tableLog = 0; in ZSTD_buildSeqTable_rle()
470 DTableH->fastMode = 0; in ZSTD_buildSeqTable_rle()
472 cell->nbBits = 0; in ZSTD_buildSeqTable_rle()
473 cell->nextState = 0; in ZSTD_buildSeqTable_rle()
475 cell->nbAdditionalBits = nbAddBits; in ZSTD_buildSeqTable_rle()
476 cell->baseValue = baseValue; in ZSTD_buildSeqTable_rle()
496 U32 highThreshold = tableSize - 1; in ZSTD_buildFSETable_body()
508 { S16 const largeLimit= (S16)(1 << (tableLog-1)); in ZSTD_buildFSETable_body()
511 if (normalizedCounter[s]==-1) { in ZSTD_buildFSETable_body()
512 tableDecode[highThreshold--].baseValue = s; in ZSTD_buildFSETable_body()
525 * no low probability (-1 count) symbols. When compressing in ZSTD_buildFSETable_body()
529 if (highThreshold == tableSize - 1) { in ZSTD_buildFSETable_body()
530 size_t const tableMask = tableSize-1; in ZSTD_buildFSETable_body()
536 * our buffer to handle the over-write. in ZSTD_buildFSETable_body()
576 U32 const tableMask = tableSize-1; in ZSTD_buildFSETable_body()
596 tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) ); in ZSTD_buildFSETable_body()
597 tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); in ZSTD_buildFSETable_body()
716 nbSeq = ((nbSeq-0x80)<<8) + *ip++; in ZSTD_decodeSeqHeaders()
724 "extraneous data present in the Sequences section"); in ZSTD_decodeSeqHeaders()
725 return (size_t)(ip - istart); in ZSTD_decodeSeqHeaders()
730 …RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes… in ZSTD_decodeSeqHeaders()
737 { size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr, in ZSTD_decodeSeqHeaders()
739 ip, iend-ip, in ZSTD_decodeSeqHeaders()
741 LL_defaultDTable, dctx->fseEntropy, in ZSTD_decodeSeqHeaders()
742 dctx->ddictIsCold, nbSeq, in ZSTD_decodeSeqHeaders()
743 dctx->workspace, sizeof(dctx->workspace), in ZSTD_decodeSeqHeaders()
749 { size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr, in ZSTD_decodeSeqHeaders()
751 ip, iend-ip, in ZSTD_decodeSeqHeaders()
753 OF_defaultDTable, dctx->fseEntropy, in ZSTD_decodeSeqHeaders()
754 dctx->ddictIsCold, nbSeq, in ZSTD_decodeSeqHeaders()
755 dctx->workspace, sizeof(dctx->workspace), in ZSTD_decodeSeqHeaders()
761 { size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr, in ZSTD_decodeSeqHeaders()
763 ip, iend-ip, in ZSTD_decodeSeqHeaders()
765 ML_defaultDTable, dctx->fseEntropy, in ZSTD_decodeSeqHeaders()
766 dctx->ddictIsCold, nbSeq, in ZSTD_decodeSeqHeaders()
767 dctx->workspace, sizeof(dctx->workspace), in ZSTD_decodeSeqHeaders()
774 return ip-istart; in ZSTD_decodeSeqHeaders()
802 * Postcondition: *op - *op >= 8
817 *ip -= sub2; in ZSTD_overlapCopy8()
823 assert(*op - *ip >= 8); in ZSTD_overlapCopy8()
830 * should be fast for a single long sequence, but can be slow for several short sequences.
833 …* - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VEC…
834 * - ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart.
838 ptrdiff_t const diff = op - ip; in ZSTD_safecopy() local
841 assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) || in ZSTD_safecopy()
842 (ovtype == ZSTD_overlap_src_before_dst && diff >= 0)); in ZSTD_safecopy()
852 ZSTD_overlapCopy8(&op, &ip, diff); in ZSTD_safecopy()
853 length -= 8; in ZSTD_safecopy()
854 assert(op - ip >= 8); in ZSTD_safecopy()
866 ZSTD_wildcopy(op, ip, oend_w - op, ovtype); in ZSTD_safecopy()
867 ip += oend_w - op; in ZSTD_safecopy()
868 op += oend_w - op; in ZSTD_safecopy()
875 …* This version allows overlap with dst before src, or handles the non-overlap case with dst after …
878 ptrdiff_t const diff = op - ip; in ZSTD_safecopyDstBeforeSrc() local
881 if (length < 8 || diff > -8) { in ZSTD_safecopyDstBeforeSrc()
887 if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) { in ZSTD_safecopyDstBeforeSrc()
888 ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap); in ZSTD_safecopyDstBeforeSrc()
889 ip += oend - WILDCOPY_OVERLENGTH - op; in ZSTD_safecopyDstBeforeSrc()
890 op += oend - WILDCOPY_OVERLENGTH - op; in ZSTD_safecopyDstBeforeSrc()
903 * to be optimized for many small sequences, since those fall into ZSTD_execSequence().
915 const BYTE* match = oLitEnd - sequence.offset; in ZSTD_execSequenceEnd()
916 BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH; in ZSTD_execSequenceEnd()
918 /* bounds checks : careful of address space overflow in 32-bit mode */ in ZSTD_execSequenceEnd()
919 …RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit withi… in ZSTD_execSequenceEnd()
920 …RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to re… in ZSTD_execSequenceEnd()
930 if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { in ZSTD_execSequenceEnd()
932 … RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, ""); in ZSTD_execSequenceEnd()
933 match = dictEnd - (prefixStart - match); in ZSTD_execSequenceEnd()
939 { size_t const length1 = dictEnd - match; in ZSTD_execSequenceEnd()
942 sequence.matchLength -= length1; in ZSTD_execSequenceEnd()
963 const BYTE* match = oLitEnd - sequence.offset; in ZSTD_execSequenceEndSplitLitBuffer()
966 /* bounds checks : careful of address space overflow in 32-bit mode */ in ZSTD_execSequenceEndSplitLitBuffer()
967 …RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit withi… in ZSTD_execSequenceEndSplitLitBuffer()
968 …RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to re… in ZSTD_execSequenceEndSplitLitBuffer()
979 if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { in ZSTD_execSequenceEndSplitLitBuffer()
981 … RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, ""); in ZSTD_execSequenceEndSplitLitBuffer()
982 match = dictEnd - (prefixStart - match); in ZSTD_execSequenceEndSplitLitBuffer()
988 { size_t const length1 = dictEnd - match; in ZSTD_execSequenceEndSplitLitBuffer()
991 sequence.matchLength -= length1; in ZSTD_execSequenceEndSplitLitBuffer()
1008 BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */ in ZSTD_execSequence()
1009 …BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH; /* risk : address space underflow on oend=NULL … in ZSTD_execSequence()
1011 const BYTE* match = oLitEnd - sequence.offset; in ZSTD_execSequence()
1021 * - Read beyond end of literals in ZSTD_execSequence()
1022 * - Match end is within WILDCOPY_OVERLIMIT of oend in ZSTD_execSequence()
1023 * - 32-bit mode and the match length overflows in ZSTD_execSequence()
1028 (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH))) in ZSTD_execSequence()
1033 assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */); in ZSTD_execSequence()
1040 * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9. in ZSTD_execSequence()
1041 * We likely don't need the full 32-byte wildcopy. in ZSTD_execSequence()
1046 ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap); in ZSTD_execSequence()
1052 if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { in ZSTD_execSequence()
1053 /* offset beyond prefix -> go into extDict */ in ZSTD_execSequence()
1054 …RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected,… in ZSTD_execSequence()
1055 match = dictEnd + (match - prefixStart); in ZSTD_execSequence()
1061 { size_t const length1 = dictEnd - match; in ZSTD_execSequence()
1064 sequence.matchLength -= length1; in ZSTD_execSequence()
1093 ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst); in ZSTD_execSequence()
1107 BYTE* const oMatchEnd = op + sequenceLength; /* risk : address space overflow (32-bits) */ in ZSTD_execSequenceSplitLitBuffer()
1109 const BYTE* match = oLitEnd - sequence.offset; in ZSTD_execSequenceSplitLitBuffer()
1114 * - Read beyond end of literals in ZSTD_execSequenceSplitLitBuffer()
1115 * - Match end is within WILDCOPY_OVERLIMIT of oend in ZSTD_execSequenceSplitLitBuffer()
1116 * - 32-bit mode and the match length overflows in ZSTD_execSequenceSplitLitBuffer()
1121 (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH))) in ZSTD_execSequenceSplitLitBuffer()
1126 assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */); in ZSTD_execSequenceSplitLitBuffer()
1133 * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9. in ZSTD_execSequenceSplitLitBuffer()
1134 * We likely don't need the full 32-byte wildcopy. in ZSTD_execSequenceSplitLitBuffer()
1139 ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap); in ZSTD_execSequenceSplitLitBuffer()
1145 if (sequence.offset > (size_t)(oLitEnd - prefixStart)) { in ZSTD_execSequenceSplitLitBuffer()
1146 /* offset beyond prefix -> go into extDict */ in ZSTD_execSequenceSplitLitBuffer()
1147 …RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected,… in ZSTD_execSequenceSplitLitBuffer()
1148 match = dictEnd + (match - prefixStart); in ZSTD_execSequenceSplitLitBuffer()
1154 { size_t const length1 = dictEnd - match; in ZSTD_execSequenceSplitLitBuffer()
1157 sequence.matchLength -= length1; in ZSTD_execSequenceSplitLitBuffer()
1185 ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst); in ZSTD_execSequenceSplitLitBuffer()
1196 DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); in ZSTD_initFseState()
1198 (U32)DStatePtr->state, DTableH->tableLog); in ZSTD_initFseState()
1200 DStatePtr->table = dt + 1; in ZSTD_initFseState()
1207 DStatePtr->state = nextState + lowBits; in ZSTD_updateFseStateWithDInfo()
1210 /* We need to add at most (ZSTD_WINDOWLOG_MAX_32 - 1) bits to read the maximum
1217 ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32 \
1225 * only used in 32-bit mode
1235 * and its fields extracted by simply shifting or bit-extracting on aarch64. in ZSTD_decodeSequence()
1245 ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol)); in ZSTD_decodeSequence()
1246 ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol)); in ZSTD_decodeSequence()
1247 …ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol)… in ZSTD_decodeSequence()
1249 const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state; in ZSTD_decodeSequence()
1250 const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state; in ZSTD_decodeSequence()
1251 const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state; in ZSTD_decodeSequence()
1253 seq.matchLength = mlDInfo->baseValue; in ZSTD_decodeSequence()
1254 seq.litLength = llDInfo->baseValue; in ZSTD_decodeSequence()
1255 { U32 const ofBase = ofDInfo->baseValue; in ZSTD_decodeSequence()
1256 BYTE const llBits = llDInfo->nbAdditionalBits; in ZSTD_decodeSequence()
1257 BYTE const mlBits = mlDInfo->nbAdditionalBits; in ZSTD_decodeSequence()
1258 BYTE const ofBits = ofDInfo->nbAdditionalBits; in ZSTD_decodeSequence()
1261 U16 const llNext = llDInfo->nextState; in ZSTD_decodeSequence()
1262 U16 const mlNext = mlDInfo->nextState; in ZSTD_decodeSequence()
1263 U16 const ofNext = ofDInfo->nextState; in ZSTD_decodeSequence()
1264 U32 const llnbBits = llDInfo->nbBits; in ZSTD_decodeSequence()
1265 U32 const mlnbBits = mlDInfo->nbBits; in ZSTD_decodeSequence()
1266 U32 const ofnbBits = ofDInfo->nbBits; in ZSTD_decodeSequence()
1273 * valuable to mark likeliness for clang, it gives around 3-4% of in ZSTD_decodeSequence()
1283 … ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits); in ZSTD_decodeSequence()
1289 … offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits); in ZSTD_decodeSequence()
1290 BIT_reloadDStream(&seqState->DStream); in ZSTD_decodeSequence()
1291 offset += BIT_readBitsFast(&seqState->DStream, extraBits); in ZSTD_decodeSequence()
1293 …offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/); /* <= (ZSTD_WINDOWLOG_MAX in ZSTD_decodeSequence()
1294 if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); in ZSTD_decodeSequence()
1296 seqState->prevOffset[2] = seqState->prevOffset[1]; in ZSTD_decodeSequence()
1297 seqState->prevOffset[1] = seqState->prevOffset[0]; in ZSTD_decodeSequence()
1298 seqState->prevOffset[0] = offset; in ZSTD_decodeSequence()
1300 U32 const ll0 = (llDInfo->baseValue == 0); in ZSTD_decodeSequence()
1302 offset = seqState->prevOffset[ll0]; in ZSTD_decodeSequence()
1303 seqState->prevOffset[1] = seqState->prevOffset[!ll0]; in ZSTD_decodeSequence()
1304 seqState->prevOffset[0] = offset; in ZSTD_decodeSequence()
1306 offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1); in ZSTD_decodeSequence()
1307 … { size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset]; in ZSTD_decodeSequence()
1308 …temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at … in ZSTD_decodeSequence()
1309 if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1]; in ZSTD_decodeSequence()
1310 seqState->prevOffset[1] = seqState->prevOffset[0]; in ZSTD_decodeSequence()
1311 seqState->prevOffset[0] = offset = temp; in ZSTD_decodeSequence()
1317 seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/); in ZSTD_decodeSequence()
1319 … if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32)) in ZSTD_decodeSequence()
1320 BIT_reloadDStream(&seqState->DStream); in ZSTD_decodeSequence()
1321 …if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog))) in ZSTD_decodeSequence()
1322 BIT_reloadDStream(&seqState->DStream); in ZSTD_decodeSequence()
1323 /* Ensure there are enough bits to read the rest of data in 64-bit mode. */ in ZSTD_decodeSequence()
1327 seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/); in ZSTD_decodeSequence()
1330 BIT_reloadDStream(&seqState->DStream); in ZSTD_decodeSequence()
1337 …ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits); /* <= … in ZSTD_decodeSequence()
1338 …ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits); /* <= … in ZSTD_decodeSequence()
1339 if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */ in ZSTD_decodeSequence()
1340 …ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits); /* <= … in ZSTD_decodeSequence()
1341 BIT_reloadDStream(&seqState->DStream); in ZSTD_decodeSequence()
1352 size_t const windowSize = dctx->fParams.windowSize; in ZSTD_dictionaryIsActive()
1354 if (dctx->dictContentEndForFuzzing == NULL) return 0; in ZSTD_dictionaryIsActive()
1356 if (prefixStart == dctx->dictContentBeginForFuzzing) return 1; in ZSTD_dictionaryIsActive()
1357 /* Dictionary is not our ext-dict. */ in ZSTD_dictionaryIsActive()
1358 if (dctx->dictEnd != dctx->dictContentEndForFuzzing) return 0; in ZSTD_dictionaryIsActive()
1360 if ((size_t)(oLitEnd - prefixStart) >= windowSize) return 0; in ZSTD_dictionaryIsActive()
1373 if (dctx->isFrameDecompression) { in ZSTD_assertValidSequence()
1374 size_t const windowSize = dctx->fParams.windowSize; in ZSTD_assertValidSequence()
1380 assert((size_t)(oend - op) >= sequenceSize); in ZSTD_assertValidSequence()
1383 …size_t const dictSize = (size_t)((char const*)dctx->dictContentEndForFuzzing - (char const*)dctx->… in ZSTD_assertValidSequence()
1385 assert(seq.offset <= (size_t)(oLitEnd - virtualStart)); in ZSTD_assertValidSequence()
1413 const BYTE* litPtr = dctx->litPtr; in ZSTD_decompressSequences_bodySplitLitBuffer()
1414 const BYTE* litBufferEnd = dctx->litBufferEnd; in ZSTD_decompressSequences_bodySplitLitBuffer()
1415 const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart); in ZSTD_decompressSequences_bodySplitLitBuffer()
1416 const BYTE* const vBase = (const BYTE*) (dctx->virtualStart); in ZSTD_decompressSequences_bodySplitLitBuffer()
1417 const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); in ZSTD_decompressSequences_bodySplitLitBuffer()
1423 dctx->fseEntropy = 1; in ZSTD_decompressSequences_bodySplitLitBuffer()
1424 { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; } in ZSTD_decompressSequences_bodySplitLitBuffer()
1426 ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)), in ZSTD_decompressSequences_bodySplitLitBuffer()
1428 ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr); in ZSTD_decompressSequences_bodySplitLitBuffer()
1429 ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); in ZSTD_decompressSequences_bodySplitLitBuffer()
1430 ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); in ZSTD_decompressSequences_bodySplitLitBuffer()
1442 * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression in ZSTD_decompressSequences_bodySplitLitBuffer()
1450 * perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \ in ZSTD_decompressSequences_bodySplitLitBuffer()
1451 * -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst in ZSTD_decompressSequences_bodySplitLitBuffer()
1458 * - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9 in ZSTD_decompressSequences_bodySplitLitBuffer()
1459 * Use Instruments->Counters to get DSB/MITE cycles. in ZSTD_decompressSequences_bodySplitLitBuffer()
1463 * - Coffeelake: Intel i9-9900k in ZSTD_decompressSequences_bodySplitLitBuffer()
1464 * - Coffeelake: Intel i7-9700k in ZSTD_decompressSequences_bodySplitLitBuffer()
1468 * - Haswell in ZSTD_decompressSequences_bodySplitLitBuffer()
1469 * - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH in ZSTD_decompressSequences_bodySplitLitBuffer()
1470 * - Skylake in ZSTD_decompressSequences_bodySplitLitBuffer()
1473 … * - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer in ZSTD_decompressSequences_bodySplitLitBuffer()
1474 … * - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer in ZSTD_decompressSequences_bodySplitLitBuffer()
1475 * - ZSTD_decompressSequences_body in ZSTD_decompressSequences_bodySplitLitBuffer()
1487 /* good for gcc-7, gcc-9, and gcc-11 */ in ZSTD_decompressSequences_bodySplitLitBuffer()
1493 /* good for gcc-8 and gcc-10 */ in ZSTD_decompressSequences_bodySplitLitBuffer()
1501 for ( ; nbSeq; nbSeq--) { in ZSTD_decompressSequences_bodySplitLitBuffer()
1503 if (litPtr + sequence.litLength > dctx->litBufferEnd) break; in ZSTD_decompressSequences_bodySplitLitBuffer()
1504 …ize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH,… in ZSTD_decompressSequences_bodySplitLitBuffer()
1514 DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)"); in ZSTD_decompressSequences_bodySplitLitBuffer()
1516 …/* If there are more sequences, they will need to read literals from litExtraBuffer; copy over the… in ZSTD_decompressSequences_bodySplitLitBuffer()
1518 const size_t leftoverLit = dctx->litBufferEnd - litPtr; in ZSTD_decompressSequences_bodySplitLitBuffer()
1519 …DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit… in ZSTD_decompressSequences_bodySplitLitBuffer()
1521 …RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit withi… in ZSTD_decompressSequences_bodySplitLitBuffer()
1523 sequence.litLength -= leftoverLit; in ZSTD_decompressSequences_bodySplitLitBuffer()
1526 litPtr = dctx->litExtraBuffer; in ZSTD_decompressSequences_bodySplitLitBuffer()
1527 litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; in ZSTD_decompressSequences_bodySplitLitBuffer()
1528 dctx->litBufferLocation = ZSTD_not_in_dst; in ZSTD_decompressSequences_bodySplitLitBuffer()
1539 nbSeq--; in ZSTD_decompressSequences_bodySplitLitBuffer()
1550 /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */ in ZSTD_decompressSequences_bodySplitLitBuffer()
1563 for ( ; nbSeq ; nbSeq--) { in ZSTD_decompressSequences_bodySplitLitBuffer()
1583 … { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } in ZSTD_decompressSequences_bodySplitLitBuffer()
1587 if (dctx->litBufferLocation == ZSTD_split) { in ZSTD_decompressSequences_bodySplitLitBuffer()
1589 size_t const lastLLSize = (size_t)(litBufferEnd - litPtr); in ZSTD_decompressSequences_bodySplitLitBuffer()
1591 RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, ""); in ZSTD_decompressSequences_bodySplitLitBuffer()
1596 litPtr = dctx->litExtraBuffer; in ZSTD_decompressSequences_bodySplitLitBuffer()
1597 litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; in ZSTD_decompressSequences_bodySplitLitBuffer()
1598 dctx->litBufferLocation = ZSTD_not_in_dst; in ZSTD_decompressSequences_bodySplitLitBuffer()
1601 { size_t const lastLLSize = (size_t)(litBufferEnd - litPtr); in ZSTD_decompressSequences_bodySplitLitBuffer()
1603 RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); in ZSTD_decompressSequences_bodySplitLitBuffer()
1609 DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart)); in ZSTD_decompressSequences_bodySplitLitBuffer()
1610 return (size_t)(op - ostart); in ZSTD_decompressSequences_bodySplitLitBuffer()
1623 …BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDs… in ZSTD_decompressSequences_body()
1625 const BYTE* litPtr = dctx->litPtr; in ZSTD_decompressSequences_body()
1626 const BYTE* const litEnd = litPtr + dctx->litSize; in ZSTD_decompressSequences_body()
1627 const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart); in ZSTD_decompressSequences_body()
1628 const BYTE* const vBase = (const BYTE*)(dctx->virtualStart); in ZSTD_decompressSequences_body()
1629 const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd); in ZSTD_decompressSequences_body()
1632 /* Regen sequences */ in ZSTD_decompressSequences_body()
1635 dctx->fseEntropy = 1; in ZSTD_decompressSequences_body()
1636 { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; } in ZSTD_decompressSequences_body()
1638 ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)), in ZSTD_decompressSequences_body()
1640 ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr); in ZSTD_decompressSequences_body()
1641 ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); in ZSTD_decompressSequences_body()
1642 ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); in ZSTD_decompressSequences_body()
1659 for ( ; nbSeq ; nbSeq--) { in ZSTD_decompressSequences_body()
1676 … { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } in ZSTD_decompressSequences_body()
1680 { size_t const lastLLSize = (size_t)(litEnd - litPtr); in ZSTD_decompressSequences_body()
1682 RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); in ZSTD_decompressSequences_body()
1688 DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart)); in ZSTD_decompressSequences_body()
1689 return (size_t)(op - ostart); in ZSTD_decompressSequences_body()
1730 * It's generally employed when block contains a significant portion of long-distance matches
1742 …BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd… in ZSTD_decompressSequencesLong_body()
1744 const BYTE* litPtr = dctx->litPtr; in ZSTD_decompressSequencesLong_body()
1745 const BYTE* litBufferEnd = dctx->litBufferEnd; in ZSTD_decompressSequencesLong_body()
1746 const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart); in ZSTD_decompressSequencesLong_body()
1747 const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart); in ZSTD_decompressSequencesLong_body()
1748 const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); in ZSTD_decompressSequencesLong_body()
1750 /* Regen sequences */ in ZSTD_decompressSequencesLong_body()
1753 #define STORED_SEQS_MASK (STORED_SEQS-1) in ZSTD_decompressSequencesLong_body()
1755 seq_t sequences[STORED_SEQS]; in ZSTD_decompressSequencesLong_body() local
1759 size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */ in ZSTD_decompressSequencesLong_body()
1761 dctx->fseEntropy = 1; in ZSTD_decompressSequencesLong_body()
1762 { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; } in ZSTD_decompressSequencesLong_body()
1766 ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)), in ZSTD_decompressSequencesLong_body()
1768 ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr); in ZSTD_decompressSequencesLong_body()
1769 ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr); in ZSTD_decompressSequencesLong_body()
1770 ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr); in ZSTD_decompressSequencesLong_body()
1774 seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1); in ZSTD_decompressSequencesLong_body()
1776 sequences[seqNb] = sequence; in ZSTD_decompressSequencesLong_body()
1781 seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1); in ZSTD_decompressSequencesLong_body()
1783 …if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_S… in ZSTD_decompressSequencesLong_body()
1785 const size_t leftoverLit = dctx->litBufferEnd - litPtr; in ZSTD_decompressSequencesLong_body()
1788 …RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit withi… in ZSTD_decompressSequencesLong_body()
1790 sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit; in ZSTD_decompressSequencesLong_body()
1793 litPtr = dctx->litExtraBuffer; in ZSTD_decompressSequencesLong_body()
1794 litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; in ZSTD_decompressSequencesLong_body()
1795 dctx->litBufferLocation = ZSTD_not_in_dst; in ZSTD_decompressSequencesLong_body()
1796 …{ size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STOR… in ZSTD_decompressSequencesLong_body()
1799 …ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], pr… in ZSTD_decompressSequencesLong_body()
1804 sequences[seqNb & STORED_SEQS_MASK] = sequence; in ZSTD_decompressSequencesLong_body()
1810 size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ? in ZSTD_decompressSequencesLong_body()
1811 …ffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY… in ZSTD_decompressSequencesLong_body()
1812 …ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBuf… in ZSTD_decompressSequencesLong_body()
1815 …ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], pr… in ZSTD_decompressSequencesLong_body()
1820 sequences[seqNb & STORED_SEQS_MASK] = sequence; in ZSTD_decompressSequencesLong_body()
1827 seqNb -= seqAdvance; in ZSTD_decompressSequencesLong_body()
1829 seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]); in ZSTD_decompressSequencesLong_body()
1830 … if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) { in ZSTD_decompressSequencesLong_body()
1831 const size_t leftoverLit = dctx->litBufferEnd - litPtr; in ZSTD_decompressSequencesLong_body()
1833 …RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit withi… in ZSTD_decompressSequencesLong_body()
1835 sequence->litLength -= leftoverLit; in ZSTD_decompressSequencesLong_body()
1838 litPtr = dctx->litExtraBuffer; in ZSTD_decompressSequencesLong_body()
1839 litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; in ZSTD_decompressSequencesLong_body()
1840 dctx->litBufferLocation = ZSTD_not_in_dst; in ZSTD_decompressSequencesLong_body()
1844 …ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart… in ZSTD_decompressSequencesLong_body()
1852 size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ? in ZSTD_decompressSequencesLong_body()
1853 …ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *seq… in ZSTD_decompressSequencesLong_body()
1857 …ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart… in ZSTD_decompressSequencesLong_body()
1865 … { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); } in ZSTD_decompressSequencesLong_body()
1869 …if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy lit… in ZSTD_decompressSequencesLong_body()
1870 size_t const lastLLSize = litBufferEnd - litPtr; in ZSTD_decompressSequencesLong_body()
1871 RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, ""); in ZSTD_decompressSequencesLong_body()
1876 litPtr = dctx->litExtraBuffer; in ZSTD_decompressSequencesLong_body()
1877 litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE; in ZSTD_decompressSequencesLong_body()
1879 { size_t const lastLLSize = litBufferEnd - litPtr; in ZSTD_decompressSequencesLong_body()
1880 RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, ""); in ZSTD_decompressSequencesLong_body()
1887 return (size_t)(op - ostart); in ZSTD_decompressSequencesLong_body()
2004 return (size_t)(op - virtualStart); in ZSTD_totalHistorySize()
2023 * no sequences, so both values should be 0. in ZSTD_getOffsetInfo()
2040 info.longOffsetShare <<= (OffFSELog - tableLog); /* scale to OffFSELog */ in ZSTD_getOffsetInfo()
2058 return (size_t)-1; in ZSTD_maxShortOffset()
2060 /* The maximum offBase is (1 << (STREAM_ACCUMULATOR_MIN + 1)) - 1. in ZSTD_maxShortOffset()
2064 size_t const maxOffbase = ((size_t)1 << (STREAM_ACCUMULATOR_MIN + 1)) - 1; in ZSTD_maxShortOffset()
2065 size_t const maxOffset = maxOffbase - ZSTD_REP_NUM; in ZSTD_maxShortOffset()
2091 … DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
2094 srcSize -= litCSize;
2103 …_totalHistorySize(ZSTD_maybeNullPtrAdd((BYTE*)dst, blockSizeMax), (BYTE const*)dctx->virtualStart);
2106 * We don't expect that to be the case in 64-bit mode.
2116 /* These macros control at build-time which decompressor implementation
2122 int usePrefetchDecoder = dctx->ddictIsCold;
2133 srcSize -= seqHSize;
2136 …RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (s…
2144 ZSTD_OffsetInfo const info = ZSTD_getOffsetInfo(dctx->OFTptr, nbSeq);
2158 dctx->ddictIsCold = 0;
2174 if (dctx->litBufferLocation == ZSTD_split)
2186 if (dst != dctx->previousDstEnd && dstSize > 0) { /* not contiguous */
2187 dctx->dictEnd = dctx->previousDstEnd;
2188 …dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx-
2189 dctx->prefixStart = dst;
2190 dctx->previousDstEnd = dst;
2200 dctx->isFrameDecompression = 0;
2204 dctx->previousDstEnd = (char*)dst + dSize;