Lines Matching refs:dctx
332 ZSTDv06_DCtx* dctx, const ZSTDv06_DCtx* preparedDCtx,
342 ZSTDLIBv06_API size_t ZSTDv06_decompressBegin(ZSTDv06_DCtx* dctx);
401 ZSTDLIBv06_API size_t ZSTDv06_decompressBlock(ZSTDv06_DCtx* dctx, void* dst, size_t dstCapacity, co…
2829 size_t ZSTDv06_decompressBegin(ZSTDv06_DCtx* dctx) in ZSTDv06_decompressBegin() argument
2831 dctx->expected = ZSTDv06_frameHeaderSize_min; in ZSTDv06_decompressBegin()
2832 dctx->stage = ZSTDds_getFrameHeaderSize; in ZSTDv06_decompressBegin()
2833 dctx->previousDstEnd = NULL; in ZSTDv06_decompressBegin()
2834 dctx->base = NULL; in ZSTDv06_decompressBegin()
2835 dctx->vBase = NULL; in ZSTDv06_decompressBegin()
2836 dctx->dictEnd = NULL; in ZSTDv06_decompressBegin()
2837 dctx->hufTableX4[0] = HufLog; in ZSTDv06_decompressBegin()
2838 dctx->flagRepeatTable = 0; in ZSTDv06_decompressBegin()
2844 ZSTDv06_DCtx* dctx = (ZSTDv06_DCtx*)malloc(sizeof(ZSTDv06_DCtx)); in ZSTDv06_createDCtx() local
2845 if (dctx==NULL) return NULL; in ZSTDv06_createDCtx()
2846 ZSTDv06_decompressBegin(dctx); in ZSTDv06_createDCtx()
2847 return dctx; in ZSTDv06_createDCtx()
2850 size_t ZSTDv06_freeDCtx(ZSTDv06_DCtx* dctx) in ZSTDv06_freeDCtx() argument
2852 free(dctx); in ZSTDv06_freeDCtx()
3054 static size_t ZSTDv06_decodeLiteralsBlock(ZSTDv06_DCtx* dctx, in ZSTDv06_decodeLiteralsBlock() argument
3094 … HUFv06_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) : in ZSTDv06_decodeLiteralsBlock()
3095 … HUFv06_decompress (dctx->litBuffer, litSize, istart+lhSize, litCSize) )) in ZSTDv06_decodeLiteralsBlock()
3098 dctx->litPtr = dctx->litBuffer; in ZSTDv06_decodeLiteralsBlock()
3099 dctx->litSize = litSize; in ZSTDv06_decodeLiteralsBlock()
3100 memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); in ZSTDv06_decodeLiteralsBlock()
3108 if (!dctx->flagRepeatTable) in ZSTDv06_decodeLiteralsBlock()
3117 …nst errorCode = HUFv06_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize… in ZSTDv06_decodeLiteralsBlock()
3120 dctx->litPtr = dctx->litBuffer; in ZSTDv06_decodeLiteralsBlock()
3121 dctx->litSize = litSize; in ZSTDv06_decodeLiteralsBlock()
3122 memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); in ZSTDv06_decodeLiteralsBlock()
3144 memcpy(dctx->litBuffer, istart+lhSize, litSize); in ZSTDv06_decodeLiteralsBlock()
3145 dctx->litPtr = dctx->litBuffer; in ZSTDv06_decodeLiteralsBlock()
3146 dctx->litSize = litSize; in ZSTDv06_decodeLiteralsBlock()
3147 memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH); in ZSTDv06_decodeLiteralsBlock()
3151 dctx->litPtr = istart+lhSize; in ZSTDv06_decodeLiteralsBlock()
3152 dctx->litSize = litSize; in ZSTDv06_decodeLiteralsBlock()
3173 memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH); in ZSTDv06_decodeLiteralsBlock()
3174 dctx->litPtr = dctx->litBuffer; in ZSTDv06_decodeLiteralsBlock()
3175 dctx->litSize = litSize; in ZSTDv06_decodeLiteralsBlock()
3438 ZSTDv06_DCtx* dctx, in ZSTDv06_decompressSequences() argument
3447 const BYTE* litPtr = dctx->litPtr; in ZSTDv06_decompressSequences()
3448 const BYTE* const litEnd = litPtr + dctx->litSize; in ZSTDv06_decompressSequences()
3449 FSEv06_DTable* DTableLL = dctx->LLTable; in ZSTDv06_decompressSequences()
3450 FSEv06_DTable* DTableML = dctx->MLTable; in ZSTDv06_decompressSequences()
3451 FSEv06_DTable* DTableOffb = dctx->OffTable; in ZSTDv06_decompressSequences()
3452 const BYTE* const base = (const BYTE*) (dctx->base); in ZSTDv06_decompressSequences()
3453 const BYTE* const vBase = (const BYTE*) (dctx->vBase); in ZSTDv06_decompressSequences()
3454 const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd); in ZSTDv06_decompressSequences()
3458 …qHSize = ZSTDv06_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->flagRepeatTable, i… in ZSTDv06_decompressSequences()
3461 dctx->flagRepeatTable = 0; in ZSTDv06_decompressSequences()
3514 static void ZSTDv06_checkContinuity(ZSTDv06_DCtx* dctx, const void* dst) in ZSTDv06_checkContinuity() argument
3516 if (dst != dctx->previousDstEnd) { /* not contiguous */ in ZSTDv06_checkContinuity()
3517 dctx->dictEnd = dctx->previousDstEnd; in ZSTDv06_checkContinuity()
3518 …dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base)); in ZSTDv06_checkContinuity()
3519 dctx->base = dst; in ZSTDv06_checkContinuity()
3520 dctx->previousDstEnd = dst; in ZSTDv06_checkContinuity()
3525 static size_t ZSTDv06_decompressBlock_internal(ZSTDv06_DCtx* dctx, in ZSTDv06_decompressBlock_internal() argument
3534 { size_t const litCSize = ZSTDv06_decodeLiteralsBlock(dctx, src, srcSize); in ZSTDv06_decompressBlock_internal()
3539 return ZSTDv06_decompressSequences(dctx, dst, dstCapacity, ip, srcSize); in ZSTDv06_decompressBlock_internal()
3543 size_t ZSTDv06_decompressBlock(ZSTDv06_DCtx* dctx, in ZSTDv06_decompressBlock() argument
3547 ZSTDv06_checkContinuity(dctx, dst); in ZSTDv06_decompressBlock()
3548 return ZSTDv06_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize); in ZSTDv06_decompressBlock()
3554 static size_t ZSTDv06_decompressFrame(ZSTDv06_DCtx* dctx, in ZSTDv06_decompressFrame() argument
3573 … if (ZSTDv06_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected); in ZSTDv06_decompressFrame()
3590 decodedSize = ZSTDv06_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize); in ZSTDv06_decompressFrame()
3617 size_t ZSTDv06_decompress_usingPreparedDCtx(ZSTDv06_DCtx* dctx, const ZSTDv06_DCtx* refDCtx, in ZSTDv06_decompress_usingPreparedDCtx() argument
3621 ZSTDv06_copyDCtx(dctx, refDCtx); in ZSTDv06_decompress_usingPreparedDCtx()
3622 ZSTDv06_checkContinuity(dctx, dst); in ZSTDv06_decompress_usingPreparedDCtx()
3623 return ZSTDv06_decompressFrame(dctx, dst, dstCapacity, src, srcSize); in ZSTDv06_decompress_usingPreparedDCtx()
3627 size_t ZSTDv06_decompress_usingDict(ZSTDv06_DCtx* dctx, in ZSTDv06_decompress_usingDict() argument
3632 ZSTDv06_decompressBegin_usingDict(dctx, dict, dictSize); in ZSTDv06_decompress_usingDict()
3633 ZSTDv06_checkContinuity(dctx, dst); in ZSTDv06_decompress_usingDict()
3634 return ZSTDv06_decompressFrame(dctx, dst, dstCapacity, src, srcSize); in ZSTDv06_decompress_usingDict()
3638 size_t ZSTDv06_decompressDCtx(ZSTDv06_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, s… in ZSTDv06_decompressDCtx() argument
3640 return ZSTDv06_decompress_usingDict(dctx, dst, dstCapacity, src, srcSize, NULL, 0); in ZSTDv06_decompressDCtx()
3648 ZSTDv06_DCtx* dctx = ZSTDv06_createDCtx(); in ZSTDv06_decompress() local
3649 if (dctx==NULL) return ERROR(memory_allocation); in ZSTDv06_decompress()
3650 regenSize = ZSTDv06_decompressDCtx(dctx, dst, dstCapacity, src, srcSize); in ZSTDv06_decompress()
3651 ZSTDv06_freeDCtx(dctx); in ZSTDv06_decompress()
3654 ZSTDv06_DCtx dctx; in ZSTDv06_decompress()
3655 return ZSTDv06_decompressDCtx(&dctx, dst, dstCapacity, src, srcSize); in ZSTDv06_decompress()
3720 size_t ZSTDv06_nextSrcSizeToDecompress(ZSTDv06_DCtx* dctx) in ZSTDv06_nextSrcSizeToDecompress() argument
3722 return dctx->expected; in ZSTDv06_nextSrcSizeToDecompress()
3725 size_t ZSTDv06_decompressContinue(ZSTDv06_DCtx* dctx, void* dst, size_t dstCapacity, const void* sr… in ZSTDv06_decompressContinue() argument
3728 if (srcSize != dctx->expected) return ERROR(srcSize_wrong); in ZSTDv06_decompressContinue()
3729 if (dstCapacity) ZSTDv06_checkContinuity(dctx, dst); in ZSTDv06_decompressContinue()
3732 switch (dctx->stage) in ZSTDv06_decompressContinue()
3736 dctx->headerSize = ZSTDv06_frameHeaderSize(src, ZSTDv06_frameHeaderSize_min); in ZSTDv06_decompressContinue()
3737 if (ZSTDv06_isError(dctx->headerSize)) return dctx->headerSize; in ZSTDv06_decompressContinue()
3738 memcpy(dctx->headerBuffer, src, ZSTDv06_frameHeaderSize_min); in ZSTDv06_decompressContinue()
3739 if (dctx->headerSize > ZSTDv06_frameHeaderSize_min) { in ZSTDv06_decompressContinue()
3740 dctx->expected = dctx->headerSize - ZSTDv06_frameHeaderSize_min; in ZSTDv06_decompressContinue()
3741 dctx->stage = ZSTDds_decodeFrameHeader; in ZSTDv06_decompressContinue()
3744 dctx->expected = 0; /* not necessary to copy more */ in ZSTDv06_decompressContinue()
3748 memcpy(dctx->headerBuffer + ZSTDv06_frameHeaderSize_min, src, dctx->expected); in ZSTDv06_decompressContinue()
3749 result = ZSTDv06_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize); in ZSTDv06_decompressContinue()
3751 dctx->expected = ZSTDv06_blockHeaderSize; in ZSTDv06_decompressContinue()
3752 dctx->stage = ZSTDds_decodeBlockHeader; in ZSTDv06_decompressContinue()
3760 dctx->expected = 0; in ZSTDv06_decompressContinue()
3761 dctx->stage = ZSTDds_getFrameHeaderSize; in ZSTDv06_decompressContinue()
3763 dctx->expected = cBlockSize; in ZSTDv06_decompressContinue()
3764 dctx->bType = bp.blockType; in ZSTDv06_decompressContinue()
3765 dctx->stage = ZSTDds_decompressBlock; in ZSTDv06_decompressContinue()
3771 switch(dctx->bType) in ZSTDv06_decompressContinue()
3774 rSize = ZSTDv06_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize); in ZSTDv06_decompressContinue()
3788 dctx->stage = ZSTDds_decodeBlockHeader; in ZSTDv06_decompressContinue()
3789 dctx->expected = ZSTDv06_blockHeaderSize; in ZSTDv06_decompressContinue()
3790 dctx->previousDstEnd = (char*)dst + rSize; in ZSTDv06_decompressContinue()
3799 static void ZSTDv06_refDictContent(ZSTDv06_DCtx* dctx, const void* dict, size_t dictSize) in ZSTDv06_refDictContent() argument
3801 dctx->dictEnd = dctx->previousDstEnd; in ZSTDv06_refDictContent()
3802 …dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base)… in ZSTDv06_refDictContent()
3803 dctx->base = dict; in ZSTDv06_refDictContent()
3804 dctx->previousDstEnd = (const char*)dict + dictSize; in ZSTDv06_refDictContent()
3807 static size_t ZSTDv06_loadEntropy(ZSTDv06_DCtx* dctx, const void* dict, size_t dictSize) in ZSTDv06_loadEntropy() argument
3811 hSize = HUFv06_readDTableX4(dctx->hufTableX4, dict, dictSize); in ZSTDv06_loadEntropy()
3821 …{ size_t const errorCode = FSEv06_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offc… in ZSTDv06_loadEntropy()
3832 …{ size_t const errorCode = FSEv06_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValu… in ZSTDv06_loadEntropy()
3843 …{ size_t const errorCode = FSEv06_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, l… in ZSTDv06_loadEntropy()
3847 dctx->flagRepeatTable = 1; in ZSTDv06_loadEntropy()
3851 static size_t ZSTDv06_decompress_insertDictionary(ZSTDv06_DCtx* dctx, const void* dict, size_t dict… in ZSTDv06_decompress_insertDictionary() argument
3857 ZSTDv06_refDictContent(dctx, dict, dictSize); in ZSTDv06_decompress_insertDictionary()
3863 eSize = ZSTDv06_loadEntropy(dctx, dict, dictSize); in ZSTDv06_decompress_insertDictionary()
3869 ZSTDv06_refDictContent(dctx, dict, dictSize); in ZSTDv06_decompress_insertDictionary()
3875 size_t ZSTDv06_decompressBegin_usingDict(ZSTDv06_DCtx* dctx, const void* dict, size_t dictSize) in ZSTDv06_decompressBegin_usingDict() argument
3877 { size_t const errorCode = ZSTDv06_decompressBegin(dctx); in ZSTDv06_decompressBegin_usingDict()
3881 size_t const errorCode = ZSTDv06_decompress_insertDictionary(dctx, dict, dictSize); in ZSTDv06_decompressBegin_usingDict()