summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2011-09-26 21:15:24 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2011-09-26 21:15:24 (GMT)
commit7a40bd983fb786ec70a38f1d6c8215c7f436971a (patch)
treef092359a504f067e6a18dd3864ba42bba484e07a
parentd899a3918531c24fb8c019875489ca91a388a260 (diff)
downloadlz4-7a40bd983fb786ec70a38f1d6c8215c7f436971a.zip
lz4-7a40bd983fb786ec70a38f1d6c8215c7f436971a.tar.gz
lz4-7a40bd983fb786ec70a38f1d6c8215c7f436971a.tar.bz2
Modified a few comments
git-svn-id: https://lz4.googlecode.com/svn/trunk@32 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
-rw-r--r--lz4.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/lz4.c b/lz4.c
index 025ae5a..c8e4072 100644
--- a/lz4.c
+++ b/lz4.c
@@ -38,9 +38,9 @@
//**************************************
// Performance parameter
//**************************************
-// Lowering this value reduce memory usage
-// It may also improve speed, especially if you reach L1 cache size (32KB for Intel, 64KB for AMD)
-// Expanding memory usage typically improves compression ratio
+// Increasing this value improves compression ratio
+// Lowering this value reduces memory usage
+// Lowering may also improve speed, typically on reaching cache size limits (L1 32KB for Intel, 64KB for AMD)
// Memory usage formula for 32 bits systems : N->2^(N+2) Bytes (examples : 17 -> 512KB ; 12 -> 16KB)
#define HASH_LOG 12
@@ -72,8 +72,8 @@
#define COPYTOKEN 4
#define COPYLENGTH 8
#define LASTLITERALS 5
-#define MFLIMIT 12
-#define MINLENGTH 13
+#define MFLIMIT (COPYLENGTH+MINMATCH)
+#define MINLENGTH (MFLIMIT+1)
#define MAXD_LOG 16
#define MAX_DISTANCE ((1 << MAXD_LOG) - 1)
@@ -102,7 +102,6 @@ struct refTables
#define LZ4_HASH_FUNCTION(i) (((i) * 2654435761U) >> ((MINMATCH*8)-HASH_LOG))
#define LZ4_HASH_VALUE(p) LZ4_HASH_FUNCTION(*(U32*)(p))
#define LZ4_COPYPACKET(s,d) *(U32*)d = *(U32*)s; d+=4; s+=4; *(U32*)d = *(U32*)s; d+=4; s+=4;
-#define LZ4_COPY(s,d,e) while (d<e) { LZ4_COPYPACKET(s,d) }
#define LZ4_WILDCOPY(s,d,e) do { LZ4_COPYPACKET(s,d) } while (d<e);
#define LZ4_BLINDCOPY(s,d,l) { BYTE* e=d+l; LZ4_WILDCOPY(s,d,e); d=e; }
@@ -285,8 +284,8 @@ int LZ4_uncompress(char* source,
BYTE token;
- U32 dec[4]={0, 3, 2, 3};
- int len, length;
+ U32 dec[4]={0, 3, 2, 3};
+ int len, length;
// Main Loop
@@ -364,8 +363,8 @@ int LZ4_uncompress_unknownOutputSize(
BYTE token;
- U32 dec[4]={0, 3, 2, 3};
- int len, length;
+ U32 dec[4]={0, 3, 2, 3};
+ int len, length;
// Main Loop