Lines Matching refs:srcSize
241 static LZ4F_blockSizeID_t LZ4F_optimalBSID(const LZ4F_blockSizeID_t requestedBSID, const size_t srcSize)
247 if (srcSize <= maxBlockSize)
256 size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr)
265 prefs.frameInfo.blockSizeID = LZ4F_optimalBSID(prefs.frameInfo.blockSizeID, srcSize);
269 streamSize = LZ4F_compressBound(srcSize, &prefs);
284 size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr)
306 prefs.frameInfo.contentSize = (U64)srcSize; /* auto-correct content size if selected (!=0) */
314 prefs.frameInfo.blockSizeID = LZ4F_optimalBSID(prefs.frameInfo.blockSizeID, srcSize);
316 if (srcSize <= LZ4F_getBlockSize(prefs.frameInfo.blockSizeID))
321 if (dstMaxSize < LZ4F_compressFrameBound(srcSize, &prefs))
328 errorCode = LZ4F_compressUpdate(&cctxI, dstPtr, dstEnd-dstPtr, srcBuffer, srcSize, &options);
473 /* LZ4F_compressBound() : gives the size of Dst buffer given a srcSize to handle worst case situations.
477 size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr)
486 unsigned nbBlocks = (unsigned)(srcSize / blockSize) + 1;
487 size_t lastBlockSize = prefsPtr->autoFlush ? srcSize % blockSize : blockSize;
496 typedef int (*compressFunc_t)(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level);
498 static size_t LZ4F_compressBlock(void* dst, const void* src, size_t srcSize, compressFunc_t compress, void* lz4ctx, int level)
503 cSize = (U32)compress(lz4ctx, (const char*)src, (char*)(cSizePtr+4), (int)(srcSize), (int)(srcSize-1), level);
507 cSize = (U32)srcSize;
509 memcpy(cSizePtr+4, src, srcSize);
515 static int LZ4F_localLZ4_compress_limitedOutput_withState(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level)
518 return LZ4_compress_limitedOutput_withState(ctx, src, dst, srcSize, dstSize);
521 static int LZ4F_localLZ4_compress_limitedOutput_continue(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level)
524 return LZ4_compress_limitedOutput_continue((LZ4_stream_t*)ctx, src, dst, srcSize, dstSize);
527 static int LZ4F_localLZ4_compressHC_limitedOutput_continue(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level)
530 return LZ4_compress_HC_continue((LZ4_streamHC_t*)ctx, src, dst, srcSize, dstSize);
562 size_t LZ4F_compressUpdate(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_compressOptions_t* compressOptionsPtr)
568 const BYTE* const srcEnd = srcPtr + srcSize;
576 if (dstMaxSize < LZ4F_compressBound(srcSize, &(cctxPtr->prefs))) return (size_t)-LZ4F_ERROR_dstMaxSize_tooSmall;
587 if (sizeToCopy > srcSize)
590 memcpy(cctxPtr->tmpIn + cctxPtr->tmpInSize, srcBuffer, srcSize);
592 cctxPtr->tmpInSize += srcSize;
658 XXH32_update(&(cctxPtr->xxh), srcBuffer, srcSize);
660 cctxPtr->totalInSize += srcSize;
804 return : nb Bytes read from srcVoidPtr (necessarily <= srcSize)
810 static size_t LZ4F_decodeHeader(LZ4F_dctx_t* dctxPtr, const void* srcVoidPtr, size_t srcSize)
819 if (srcSize < minFHSize) return (size_t)-LZ4F_ERROR_frameHeader_incomplete; /* minimal frame header size */
828 dctxPtr->tmpInSize = srcSize;
831 return srcSize;
855 if (srcSize < frameHeaderSize)
859 memcpy(dctxPtr->header, srcPtr, srcSize);
860 dctxPtr->tmpInSize = srcSize;
863 return srcSize;
925 * The function result is an hint of the better srcSize to use for next call to LZ4F_decompress,
1037 * The function result is an hint of the better srcSize to use for next call to LZ4F_decompress.
1040 * Note that this is just a hint, you can always provide any srcSize you want.