diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lz4_manual.html | 27 | ||||
-rw-r--r-- | doc/lz4frame_manual.html | 13 |
2 files changed, 23 insertions, 17 deletions
diff --git a/doc/lz4_manual.html b/doc/lz4_manual.html index ef715f8..d14467f 100644 --- a/doc/lz4_manual.html +++ b/doc/lz4_manual.html @@ -1,10 +1,10 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>1.8.1 Manual</title> +<title>1.8.2 Manual</title> </head> <body> -<h1>1.8.1 Manual</h1> +<h1>1.8.2 Manual</h1> <hr> <a name="Contents"></a><h2>Contents</h2> <ol> @@ -172,26 +172,29 @@ int LZ4_freeStream (LZ4_stream_t* streamPtr); </p></pre><BR> <pre><b>int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); -</b><p> Compress content into 'src' using data from previously compressed blocks, improving compression ratio. +</b><p> Compress 'src' content using data from previously compressed blocks, for better compression ratio. 'dst' buffer must be already allocated. If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster. - Important : The previous 64KB of compressed data is assumed to remain preset and unmodified in memory! - If less than 64KB has been compressed all the data must be present. - Special 1 : If input buffer is a double-buffer, it can have any size, including < 64 KB. + Important : The previous 64KB of compressed data is assumed to remain present and unmodified in memory! + + Special 1 : When input is a double-buffer, they can have any size, including < 64 KB. + Make sure that buffers are separated by at least one byte. + This way, each block only depends on previous block. Special 2 : If input buffer is a ring-buffer, it can have any size, including < 64 KB. @return : size of compressed block - or 0 if there is an error (typically, compressed data cannot fit into 'dst') + or 0 if there is an error (typically, cannot fit into 'dst'). After an error, the stream status is invalid, it can only be reset or freed. </p></pre><BR> -<pre><b>int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int dictSize); -</b><p> If previously compressed data block is not guaranteed to remain available at its current memory location, +<pre><b>int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int maxDictSize); +</b><p> If last 64KB data cannot be guaranteed to remain available at its current memory location, save it into a safer place (char* safeBuffer). - Note : it's not necessary to call LZ4_loadDict() after LZ4_saveDict(), dictionary is immediately usable. - @return : saved dictionary size in bytes (necessarily <= dictSize), or 0 if error. + This is schematically equivalent to a memcpy() followed by LZ4_loadDict(), + but is much faster, because LZ4_saveDict() doesn't need to rebuild tables. + @return : saved dictionary size in bytes (necessarily <= maxDictSize), or 0 if error. </p></pre><BR> @@ -207,7 +210,7 @@ int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream); <pre><b>int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize); </b><p> An LZ4_streamDecode_t structure can be allocated once and re-used multiple times. Use this function to start decompression of a new stream of blocks. - A dictionary can optionnally be set. Use NULL or size 0 for a simple reset order. + A dictionary can optionnally be set. Use NULL or size 0 for a reset order. @return : 1 if OK, 0 if error </p></pre><BR> diff --git a/doc/lz4frame_manual.html b/doc/lz4frame_manual.html index 1ddf6d8..f0f7f5a 100644 --- a/doc/lz4frame_manual.html +++ b/doc/lz4frame_manual.html @@ -1,10 +1,10 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>1.8.1 Manual</title> +<title>1.8.2 Manual</title> </head> <body> -<h1>1.8.1 Manual</h1> +<h1>1.8.2 Manual</h1> <hr> <a name="Contents"></a><h2>Contents</h2> <ol> @@ -153,10 +153,13 @@ LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_cctx* cctx); </p></pre><BR> <pre><b>size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* prefsPtr); -</b><p> 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(). +</b><p> Provides minimum dstCapacity required to guarantee compression success + given a srcSize and preferences, covering worst case scenario. prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. + Estimation is valid for either LZ4F_compressUpdate(), LZ4F_flush() or LZ4F_compressEnd(), + Estimation includes the possibility that internal buffer might already be filled by up to (blockSize-1) bytes. + It also includes frame footer (ending + checksum), which would have to be generated by LZ4F_compressEnd(). + Estimation doesn't include frame header, as it was already generated by LZ4F_compressBegin(). 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. |