Lines Matching refs:zcs
212 size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs) in ZSTD_sizeof_CStream() argument
214 return ZSTD_sizeof_CCtx(zcs); /* same object */ in ZSTD_sizeof_CStream()
5172 size_t ZSTD_freeCStream(ZSTD_CStream* zcs) in ZSTD_freeCStream() argument
5174 return ZSTD_freeCCtx(zcs); /* same object */ in ZSTD_freeCStream()
5198 size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pss) in ZSTD_resetCStream() argument
5206 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_resetCStream()
5207 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_resetCStream()
5215 size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, in ZSTD_initCStream_internal() argument
5221 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_internal()
5222 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_internal()
5224 zcs->requestedParams = *params; in ZSTD_initCStream_internal()
5227 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_internal()
5230 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_internal()
5237 size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_usingCDict_advanced() argument
5243 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict_advanced()
5244 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_usingCDict_advanced()
5245 zcs->requestedParams.fParams = fParams; in ZSTD_initCStream_usingCDict_advanced()
5246 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict_advanced()
5251 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict) in ZSTD_initCStream_usingCDict() argument
5254 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict()
5255 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict()
5264 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_advanced() argument
5274 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_advanced()
5275 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_advanced()
5277 ZSTD_CCtxParams_setZstdParams(&zcs->requestedParams, ¶ms); in ZSTD_initCStream_advanced()
5278 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_advanced()
5282 size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compres… in ZSTD_initCStream_usingDict() argument
5285 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingDict()
5286 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_usingDict()
5287 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_usingDict()
5291 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pss) in ZSTD_initCStream_srcSize() argument
5299 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_srcSize()
5300 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream_srcSize()
5301 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_srcSize()
5302 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_srcSize()
5306 size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel) in ZSTD_initCStream() argument
5309 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream()
5310 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream()
5311 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream()
5328 static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, in ZSTD_compressStream_generic() argument
5343 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5344 assert(zcs->inBuff != NULL); in ZSTD_compressStream_generic()
5345 assert(zcs->inBuffSize > 0); in ZSTD_compressStream_generic()
5347 if (zcs->appliedParams.outBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5348 assert(zcs->outBuff != NULL); in ZSTD_compressStream_generic()
5349 assert(zcs->outBuffSize > 0); in ZSTD_compressStream_generic()
5356 switch(zcs->streamStage) in ZSTD_compressStream_generic()
5364 …|| zcs->appliedParams.outBufferMode == ZSTD_bm_stable) /* OR we are allowed to return dstSizeTooS… in ZSTD_compressStream_generic()
5365 && (zcs->inBuffPos == 0) ) { in ZSTD_compressStream_generic()
5367 size_t const cSize = ZSTD_compressEnd(zcs, in ZSTD_compressStream_generic()
5373 zcs->frameEnded = 1; in ZSTD_compressStream_generic()
5374 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5378 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5379 size_t const toLoad = zcs->inBuffTarget - zcs->inBuffPos; in ZSTD_compressStream_generic()
5381 zcs->inBuff + zcs->inBuffPos, toLoad, in ZSTD_compressStream_generic()
5383 zcs->inBuffPos += loaded; in ZSTD_compressStream_generic()
5387 && (zcs->inBuffPos < zcs->inBuffTarget) ) { in ZSTD_compressStream_generic()
5392 && (zcs->inBuffPos == zcs->inToCompress) ) { in ZSTD_compressStream_generic()
5399 { int const inputBuffered = (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
5404 ? zcs->inBuffPos - zcs->inToCompress in ZSTD_compressStream_generic()
5405 : MIN((size_t)(iend - ip), zcs->blockSize); in ZSTD_compressStream_generic()
5406 … if (oSize >= ZSTD_compressBound(iSize) || zcs->appliedParams.outBufferMode == ZSTD_bm_stable) in ZSTD_compressStream_generic()
5409 cDst = zcs->outBuff, oSize = zcs->outBuffSize; in ZSTD_compressStream_generic()
5413 ZSTD_compressEnd(zcs, cDst, oSize, in ZSTD_compressStream_generic()
5414 zcs->inBuff + zcs->inToCompress, iSize) : in ZSTD_compressStream_generic()
5415 ZSTD_compressContinue(zcs, cDst, oSize, in ZSTD_compressStream_generic()
5416 zcs->inBuff + zcs->inToCompress, iSize); in ZSTD_compressStream_generic()
5418 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
5420 zcs->inBuffTarget = zcs->inBuffPos + zcs->blockSize; in ZSTD_compressStream_generic()
5421 if (zcs->inBuffTarget > zcs->inBuffSize) in ZSTD_compressStream_generic()
5422 zcs->inBuffPos = 0, zcs->inBuffTarget = zcs->blockSize; in ZSTD_compressStream_generic()
5424 (unsigned)zcs->inBuffTarget, (unsigned)zcs->inBuffSize); in ZSTD_compressStream_generic()
5426 assert(zcs->inBuffTarget <= zcs->inBuffSize); in ZSTD_compressStream_generic()
5427 zcs->inToCompress = zcs->inBuffPos; in ZSTD_compressStream_generic()
5432 ZSTD_compressEnd(zcs, cDst, oSize, ip, iSize) : in ZSTD_compressStream_generic()
5433 ZSTD_compressContinue(zcs, cDst, oSize, ip, iSize); in ZSTD_compressStream_generic()
5438 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
5444 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
5447 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5451 zcs->outBuffContentSize = cSize; in ZSTD_compressStream_generic()
5452 zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
5453 zcs->streamStage = zcss_flush; /* pass-through to flush stage */ in ZSTD_compressStream_generic()
5458 assert(zcs->appliedParams.outBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
5459 { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; in ZSTD_compressStream_generic()
5461 zcs->outBuff + zcs->outBuffFlushedSize, toFlush); in ZSTD_compressStream_generic()
5466 zcs->outBuffFlushedSize += flushed; in ZSTD_compressStream_generic()
5473 zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
5474 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
5477 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5480 zcs->streamStage = zcss_load; in ZSTD_compressStream_generic()
5491 if (zcs->frameEnded) return 0; in ZSTD_compressStream_generic()
5492 return ZSTD_nextInputSizeHint(zcs); in ZSTD_compressStream_generic()
5507 size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input) in ZSTD_compressStream() argument
5509 FORWARD_IF_ERROR( ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue) , ""); in ZSTD_compressStream()
5510 return ZSTD_nextInputSizeHint_MTorST(zcs); in ZSTD_compressStream()
6160 size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_flushStream() argument
6163 return ZSTD_compressStream2(zcs, output, &input, ZSTD_e_flush); in ZSTD_flushStream()
6167 size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_endStream() argument
6170 size_t const remainingToFlush = ZSTD_compressStream2(zcs, output, &input, ZSTD_e_end); in ZSTD_endStream()
6172 if (zcs->appliedParams.nbWorkers > 0) return remainingToFlush; /* minimal estimation */ in ZSTD_endStream()
6174 { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE; in ZSTD_endStream()
6175 …size_t const checksumSize = (size_t)(zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag… in ZSTD_endStream()