Lines Matching refs:zcs

202 size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs)  in ZSTD_sizeof_CStream()  argument
204 return ZSTD_sizeof_CCtx(zcs); /* same object */ in ZSTD_sizeof_CStream()
5053 size_t ZSTD_freeCStream(ZSTD_CStream* zcs) in ZSTD_freeCStream() argument
5055 return ZSTD_freeCCtx(zcs); /* same object */ in ZSTD_freeCStream()
5079 size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pss) in ZSTD_resetCStream() argument
5087 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_resetCStream()
5088 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_resetCStream()
5096 size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, in ZSTD_initCStream_internal() argument
5102 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_internal()
5103 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_internal()
5105 zcs->requestedParams = *params; in ZSTD_initCStream_internal()
5108 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_internal()
5111 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_internal()
5118 size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_usingCDict_advanced() argument
5124 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict_advanced()
5125 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_usingCDict_advanced()
5126 zcs->requestedParams.fParams = fParams; in ZSTD_initCStream_usingCDict_advanced()
5127 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict_advanced()
5132 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict) in ZSTD_initCStream_usingCDict() argument
5135 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict()
5136 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict()
5145 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_advanced() argument
5155 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_advanced()
5156 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_advanced()
5158 ZSTD_CCtxParams_setZstdParams(&zcs->requestedParams, &params); in ZSTD_initCStream_advanced()
5159 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_advanced()
5163 size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compres… in ZSTD_initCStream_usingDict() argument
5166 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingDict()
5167 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_usingDict()
5168 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_usingDict()
5172 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pss) in ZSTD_initCStream_srcSize() argument
5180 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_srcSize()
5181 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream_srcSize()
5182 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_srcSize()
5183 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_srcSize()
5187 size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel) in ZSTD_initCStream() argument
5190 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream()
5191 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream()
5192 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream()
5209 static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, in ZSTD_compressStream_generic() argument
5224 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5225 assert(zcs->inBuff != NULL); in ZSTD_compressStream_generic()
5226 assert(zcs->inBuffSize > 0); in ZSTD_compressStream_generic()
5228 if (zcs->appliedParams.outBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5229 assert(zcs->outBuff != NULL); in ZSTD_compressStream_generic()
5230 assert(zcs->outBuffSize > 0); in ZSTD_compressStream_generic()
5237 switch(zcs->streamStage) in ZSTD_compressStream_generic()
5245 …|| zcs->appliedParams.outBufferMode == ZSTD_bm_stable) /* OR we are allowed to return dstSizeTooS… in ZSTD_compressStream_generic()
5246 && (zcs->inBuffPos == 0) ) { in ZSTD_compressStream_generic()
5248 size_t const cSize = ZSTD_compressEnd(zcs, in ZSTD_compressStream_generic()
5254 zcs->frameEnded = 1; in ZSTD_compressStream_generic()
5255 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5259 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5260 size_t const toLoad = zcs->inBuffTarget - zcs->inBuffPos; in ZSTD_compressStream_generic()
5262 zcs->inBuff + zcs->inBuffPos, toLoad, in ZSTD_compressStream_generic()
5264 zcs->inBuffPos += loaded; in ZSTD_compressStream_generic()
5268 && (zcs->inBuffPos < zcs->inBuffTarget) ) { in ZSTD_compressStream_generic()
5273 && (zcs->inBuffPos == zcs->inToCompress) ) { in ZSTD_compressStream_generic()
5280 { int const inputBuffered = (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
5285 ? zcs->inBuffPos - zcs->inToCompress in ZSTD_compressStream_generic()
5286 : MIN((size_t)(iend - ip), zcs->blockSize); in ZSTD_compressStream_generic()
5287 … if (oSize >= ZSTD_compressBound(iSize) || zcs->appliedParams.outBufferMode == ZSTD_bm_stable) in ZSTD_compressStream_generic()
5290 cDst = zcs->outBuff, oSize = zcs->outBuffSize; in ZSTD_compressStream_generic()
5294 ZSTD_compressEnd(zcs, cDst, oSize, in ZSTD_compressStream_generic()
5295 zcs->inBuff + zcs->inToCompress, iSize) : in ZSTD_compressStream_generic()
5296 ZSTD_compressContinue(zcs, cDst, oSize, in ZSTD_compressStream_generic()
5297 zcs->inBuff + zcs->inToCompress, iSize); in ZSTD_compressStream_generic()
5299 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
5301 zcs->inBuffTarget = zcs->inBuffPos + zcs->blockSize; in ZSTD_compressStream_generic()
5302 if (zcs->inBuffTarget > zcs->inBuffSize) in ZSTD_compressStream_generic()
5303 zcs->inBuffPos = 0, zcs->inBuffTarget = zcs->blockSize; in ZSTD_compressStream_generic()
5305 (unsigned)zcs->inBuffTarget, (unsigned)zcs->inBuffSize); in ZSTD_compressStream_generic()
5307 assert(zcs->inBuffTarget <= zcs->inBuffSize); in ZSTD_compressStream_generic()
5308 zcs->inToCompress = zcs->inBuffPos; in ZSTD_compressStream_generic()
5313 ZSTD_compressEnd(zcs, cDst, oSize, ip, iSize) : in ZSTD_compressStream_generic()
5314 ZSTD_compressContinue(zcs, cDst, oSize, ip, iSize); in ZSTD_compressStream_generic()
5319 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
5325 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
5328 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5332 zcs->outBuffContentSize = cSize; in ZSTD_compressStream_generic()
5333 zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
5334 zcs->streamStage = zcss_flush; /* pass-through to flush stage */ in ZSTD_compressStream_generic()
5339 assert(zcs->appliedParams.outBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
5340 { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; in ZSTD_compressStream_generic()
5342 zcs->outBuff + zcs->outBuffFlushedSize, toFlush); in ZSTD_compressStream_generic()
5347 zcs->outBuffFlushedSize += flushed; in ZSTD_compressStream_generic()
5354 zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
5355 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
5358 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5361 zcs->streamStage = zcss_load; in ZSTD_compressStream_generic()
5372 if (zcs->frameEnded) return 0; in ZSTD_compressStream_generic()
5373 return ZSTD_nextInputSizeHint(zcs); in ZSTD_compressStream_generic()
5382 size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input) in ZSTD_compressStream() argument
5384 FORWARD_IF_ERROR( ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue) , ""); in ZSTD_compressStream()
5385 return ZSTD_nextInputSizeHint_MTorST(zcs); in ZSTD_compressStream()
5960 size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_flushStream() argument
5963 return ZSTD_compressStream2(zcs, output, &input, ZSTD_e_flush); in ZSTD_flushStream()
5967 size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_endStream() argument
5970 size_t const remainingToFlush = ZSTD_compressStream2(zcs, output, &input, ZSTD_e_end); in ZSTD_endStream()
5972 if (zcs->appliedParams.nbWorkers > 0) return remainingToFlush; /* minimal estimation */ in ZSTD_endStream()
5974 { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE; in ZSTD_endStream()
5975 …size_t const checksumSize = (size_t)(zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag… in ZSTD_endStream()