summaryrefslogtreecommitdiffstats
path: root/lz4.h
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2011-06-05 21:23:42 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2011-06-05 21:23:42 (GMT)
commit075bf1349b23914d237f4e676d71da57ecfa4b7c (patch)
treede4436c5c700d01f3e9892a67fd92f9bed2e5b1d /lz4.h
parent6b798d5e40e4c0788f7c51f6e9b0e9c4e966d068 (diff)
downloadlz4-075bf1349b23914d237f4e676d71da57ecfa4b7c.zip
lz4-075bf1349b23914d237f4e676d71da57ecfa4b7c.tar.gz
lz4-075bf1349b23914d237f4e676d71da57ecfa4b7c.tar.bz2
Greatly improved compression and decompression speed, at the expense of some compression ratio.
Most of the change is due to a modification in the performance parameter (HASH_LOG) now set to 12, to match Intel L1 cache processors. You can change it back to 17 to get back previous compression ratio. AMD users are invited to try HASH_LOG = 13, since AMD L1 cache is twice larger. git-svn-id: https://lz4.googlecode.com/svn/trunk@10 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'lz4.h')
-rw-r--r--lz4.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/lz4.h b/lz4.h
index 031e8ee..429a20a 100644
--- a/lz4.h
+++ b/lz4.h
@@ -66,9 +66,9 @@ int LZ4_uncompress_unknownOutputSize (char* source, char* dest, int isize, int m
LZ4_uncompress :
return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize)
If the source stream is malformed, the function will stop decoding and return a negative result, indicating the byte position of the faulty instruction
- This version never writes beyond dest + osize, and is therefore protected against malicious data packets
+ This version never writes beyond dest + maxOutputSize, and is therefore protected against malicious data packets
note 1 : isize is the input size, therefore the compressed size
- note 2 : destination buffer must be already allocated
+ note 2 : destination buffer must already be allocated, with at least maxOutputSize bytes
note 3 : this version is slower by up to 10%, and is therefore not recommended for general use
*/
@@ -88,20 +88,21 @@ LZ4_compressCtx :
*/
-//****************************
-// Deprecated Functions
-//****************************
+//*********************************
+// Faster Decoding function
+//*********************************
-int LZ4_decode (char* source, char* dest, int isize);
+#define LZ4_uncompress_fast LZ4_decode
+int LZ4_decode (char* source, char* dest, int isize);
/*
-LZ4_decode :
+LZ4_decode : This version is the fastest one, besting LZ4_uncompress by a few %.
return : the number of bytes in decoded buffer dest
note 1 : isize is the input size, therefore the compressed size
note 2 : destination buffer must be already allocated.
The program calling the decoder must know in advance the size of decoded stream to properly allocate the destination buffer
The destination buffer size must be at least "decompressedSize + 3 Bytes"
- This version is unprotected against malicious data packets designed to create buffer overflow errors.
+ This version is **unprotected** against malicious data packets designed to create buffer overflow errors.
It is therefore deprecated, but still present in this version for compatibility.
*/