Lines Matching refs:zcs

207 size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs)  in ZSTD_sizeof_CStream()  argument
209 return ZSTD_sizeof_CCtx(zcs); /* same object */ in ZSTD_sizeof_CStream()
5829 size_t ZSTD_freeCStream(ZSTD_CStream* zcs) in ZSTD_freeCStream() argument
5831 return ZSTD_freeCCtx(zcs); /* same object */ in ZSTD_freeCStream()
5855 size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pss) in ZSTD_resetCStream() argument
5863 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_resetCStream()
5864 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_resetCStream()
5872 size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, in ZSTD_initCStream_internal() argument
5878 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_internal()
5879 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_internal()
5881 zcs->requestedParams = *params; in ZSTD_initCStream_internal()
5884 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_internal()
5887 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_internal()
5894 size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_usingCDict_advanced() argument
5900 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict_advanced()
5901 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_usingCDict_advanced()
5902 zcs->requestedParams.fParams = fParams; in ZSTD_initCStream_usingCDict_advanced()
5903 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict_advanced()
5908 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict) in ZSTD_initCStream_usingCDict() argument
5911 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict()
5912 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict()
5921 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_advanced() argument
5931 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_advanced()
5932 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_advanced()
5934 ZSTD_CCtxParams_setZstdParams(&zcs->requestedParams, &params); in ZSTD_initCStream_advanced()
5935 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_advanced()
5939 size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compres… in ZSTD_initCStream_usingDict() argument
5942 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingDict()
5943 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_usingDict()
5944 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_usingDict()
5948 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pss) in ZSTD_initCStream_srcSize() argument
5956 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_srcSize()
5957 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream_srcSize()
5958 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_srcSize()
5959 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_srcSize()
5963 size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel) in ZSTD_initCStream() argument
5966 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream()
5967 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream()
5968 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream()
5989 static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, in ZSTD_compressStream_generic() argument
6004 assert(zcs != NULL); in ZSTD_compressStream_generic()
6005 if (zcs->appliedParams.inBufferMode == ZSTD_bm_stable) { in ZSTD_compressStream_generic()
6006 assert(input->pos >= zcs->stableIn_notConsumed); in ZSTD_compressStream_generic()
6007 input->pos -= zcs->stableIn_notConsumed; in ZSTD_compressStream_generic()
6008 if (ip) ip -= zcs->stableIn_notConsumed; in ZSTD_compressStream_generic()
6009 zcs->stableIn_notConsumed = 0; in ZSTD_compressStream_generic()
6011 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
6012 assert(zcs->inBuff != NULL); in ZSTD_compressStream_generic()
6013 assert(zcs->inBuffSize > 0); in ZSTD_compressStream_generic()
6015 if (zcs->appliedParams.outBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
6016 assert(zcs->outBuff != NULL); in ZSTD_compressStream_generic()
6017 assert(zcs->outBuffSize > 0); in ZSTD_compressStream_generic()
6026 switch(zcs->streamStage) in ZSTD_compressStream_generic()
6034 …|| zcs->appliedParams.outBufferMode == ZSTD_bm_stable) /* OR we are allowed to return dstSizeTooS… in ZSTD_compressStream_generic()
6035 && (zcs->inBuffPos == 0) ) { in ZSTD_compressStream_generic()
6037 size_t const cSize = ZSTD_compressEnd_public(zcs, in ZSTD_compressStream_generic()
6044 zcs->frameEnded = 1; in ZSTD_compressStream_generic()
6045 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
6049 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
6050 size_t const toLoad = zcs->inBuffTarget - zcs->inBuffPos; in ZSTD_compressStream_generic()
6052 zcs->inBuff + zcs->inBuffPos, toLoad, in ZSTD_compressStream_generic()
6054 zcs->inBuffPos += loaded; in ZSTD_compressStream_generic()
6057 && (zcs->inBuffPos < zcs->inBuffTarget) ) { in ZSTD_compressStream_generic()
6062 && (zcs->inBuffPos == zcs->inToCompress) ) { in ZSTD_compressStream_generic()
6067 assert(zcs->appliedParams.inBufferMode == ZSTD_bm_stable); in ZSTD_compressStream_generic()
6069 && ( (size_t)(iend - ip) < zcs->blockSizeMax) ) { in ZSTD_compressStream_generic()
6071 zcs->stableIn_notConsumed = (size_t)(iend - ip); in ZSTD_compressStream_generic()
6083 { int const inputBuffered = (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
6087 size_t const iSize = inputBuffered ? zcs->inBuffPos - zcs->inToCompress in ZSTD_compressStream_generic()
6088 : MIN((size_t)(iend - ip), zcs->blockSizeMax); in ZSTD_compressStream_generic()
6089 … if (oSize >= ZSTD_compressBound(iSize) || zcs->appliedParams.outBufferMode == ZSTD_bm_stable) in ZSTD_compressStream_generic()
6092 cDst = zcs->outBuff, oSize = zcs->outBuffSize; in ZSTD_compressStream_generic()
6096 ZSTD_compressEnd_public(zcs, cDst, oSize, in ZSTD_compressStream_generic()
6097 zcs->inBuff + zcs->inToCompress, iSize) : in ZSTD_compressStream_generic()
6098 ZSTD_compressContinue_public(zcs, cDst, oSize, in ZSTD_compressStream_generic()
6099 zcs->inBuff + zcs->inToCompress, iSize); in ZSTD_compressStream_generic()
6101 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
6103 zcs->inBuffTarget = zcs->inBuffPos + zcs->blockSizeMax; in ZSTD_compressStream_generic()
6104 if (zcs->inBuffTarget > zcs->inBuffSize) in ZSTD_compressStream_generic()
6105 zcs->inBuffPos = 0, zcs->inBuffTarget = zcs->blockSizeMax; in ZSTD_compressStream_generic()
6107 (unsigned)zcs->inBuffTarget, (unsigned)zcs->inBuffSize); in ZSTD_compressStream_generic()
6109 assert(zcs->inBuffTarget <= zcs->inBuffSize); in ZSTD_compressStream_generic()
6110 zcs->inToCompress = zcs->inBuffPos; in ZSTD_compressStream_generic()
6114 ZSTD_compressEnd_public(zcs, cDst, oSize, ip, iSize) : in ZSTD_compressStream_generic()
6115 ZSTD_compressContinue_public(zcs, cDst, oSize, ip, iSize); in ZSTD_compressStream_generic()
6119 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
6124 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
6127 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
6131 zcs->outBuffContentSize = cSize; in ZSTD_compressStream_generic()
6132 zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
6133 zcs->streamStage = zcss_flush; /* pass-through to flush stage */ in ZSTD_compressStream_generic()
6138 assert(zcs->appliedParams.outBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
6139 { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; in ZSTD_compressStream_generic()
6141 zcs->outBuff + zcs->outBuffFlushedSize, toFlush); in ZSTD_compressStream_generic()
6146 zcs->outBuffFlushedSize += flushed; in ZSTD_compressStream_generic()
6153 zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
6154 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
6157 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
6160 zcs->streamStage = zcss_load; in ZSTD_compressStream_generic()
6171 if (zcs->frameEnded) return 0; in ZSTD_compressStream_generic()
6172 return ZSTD_nextInputSizeHint(zcs); in ZSTD_compressStream_generic()
6181 size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input) in ZSTD_compressStream() argument
6183 FORWARD_IF_ERROR( ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue) , ""); in ZSTD_compressStream()
6184 return ZSTD_nextInputSizeHint_MTorST(zcs); in ZSTD_compressStream()
7429 static ZSTD_inBuffer inBuffer_forEndFlush(const ZSTD_CStream* zcs) in inBuffer_forEndFlush() argument
7432 const int stableInput = (zcs->appliedParams.inBufferMode == ZSTD_bm_stable); in inBuffer_forEndFlush()
7433 return stableInput ? zcs->expectedInBuffer : nullInput; in inBuffer_forEndFlush()
7438 size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_flushStream() argument
7440 ZSTD_inBuffer input = inBuffer_forEndFlush(zcs); in ZSTD_flushStream()
7442 return ZSTD_compressStream2(zcs, output, &input, ZSTD_e_flush); in ZSTD_flushStream()
7445 size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_endStream() argument
7447 ZSTD_inBuffer input = inBuffer_forEndFlush(zcs); in ZSTD_endStream()
7448 size_t const remainingToFlush = ZSTD_compressStream2(zcs, output, &input, ZSTD_e_end); in ZSTD_endStream()
7450 if (zcs->appliedParams.nbWorkers > 0) return remainingToFlush; /* minimal estimation */ in ZSTD_endStream()
7452 { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE; in ZSTD_endStream()
7453 …size_t const checksumSize = (size_t)(zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag… in ZSTD_endStream()