diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2018-02-01 16:53:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-01 16:53:23 (GMT) |
commit | 424c773f833796cbdbe784c05e6c9654fc28b741 (patch) | |
tree | b3d09a27df8edc9f12667f69a92d1f408d630e86 /lib/lz4frame.h | |
parent | d1ccd620d62acb1863357aeb1bb64fe374b0d055 (diff) | |
parent | 3ce289bcce012b8173edd4c1040208da2692d060 (diff) | |
download | lz4-424c773f833796cbdbe784c05e6c9654fc28b741.zip lz4-424c773f833796cbdbe784c05e6c9654fc28b741.tar.gz lz4-424c773f833796cbdbe784c05e6c9654fc28b741.tar.bz2 |
Merge pull request #460 from lz4/frameCompress
refactored frameCompress.c example
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r-- | lib/lz4frame.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h index eb55e45..15484d7 100644 --- a/lib/lz4frame.h +++ b/lib/lz4frame.h @@ -189,8 +189,10 @@ LZ4FLIB_API int LZ4F_compressionLevel_max(void); * Simple compression function ***********************************/ /*! LZ4F_compressFrameBound() : - * Returns the maximum possible size of a frame compressed with LZ4F_compressFrame() given srcSize content and preferences. - * Note : this result is only usable with LZ4F_compressFrame(), not with multi-segments compression. + * Returns the maximum possible compressed size with LZ4F_compressFrame() given srcSize and preferences. + * `preferencesPtr` is optional. It can be replaced by NULL, in which case, the function will assume default preferences. + * Note : this result is only usable with LZ4F_compressFrame(). + * It may also be used with LZ4F_compressUpdate() _if no flush() operation_ is performed. */ LZ4FLIB_API size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr); @@ -235,7 +237,7 @@ LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_cctx* cctx); /*---- Compression ----*/ -#define LZ4F_HEADER_SIZE_MAX 19 +#define LZ4F_HEADER_SIZE_MAX 19 /* LZ4 Frame header size can vary from 7 to 19 bytes */ /*! LZ4F_compressBegin() : * will write the frame header into dstBuffer. * dstCapacity must be >= LZ4F_HEADER_SIZE_MAX bytes. @@ -248,7 +250,9 @@ LZ4FLIB_API size_t LZ4F_compressBegin(LZ4F_cctx* cctx, const LZ4F_preferences_t* prefsPtr); /*! LZ4F_compressBound() : - * Provides minimum dstCapacity for a given srcSize to guarantee operation success in worst case situations. + * Provides minimum dstCapacity for a given srcSize to guarantee operation success in worst case scenarios. + * Estimation includes frame footer, which would be generated by LZ4F_compressEnd(). + * Estimation doesn't include frame header, already generated by LZ4F_compressBegin(). * prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. * Result is always the same for a srcSize and prefsPtr, so it can be trusted to size reusable buffers. * When srcSize==0, LZ4F_compressBound() provides an upper bound for LZ4F_flush() and LZ4F_compressEnd() operations. |