Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nemequ/liblzf.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Lehmann <schmorpforge@schmorp.de>2007-11-13 14:30:37 +0300
committerMarc Lehmann <schmorpforge@schmorp.de>2007-11-13 14:30:37 +0300
commit5ac1106a2067487810d91267a4181c3f542edf86 (patch)
tree8c204af427594f94210c5a1dbf02aaf35748a63c
parente8292324f3881e15feb01a155f177d52a0c6ae96 (diff)
*** empty log message ***
-rw-r--r--Changes1
-rw-r--r--lzfP.h4
-rw-r--r--lzf_c.c29
3 files changed, 17 insertions, 17 deletions
diff --git a/Changes b/Changes
index 429bb62..ab8f086 100644
--- a/Changes
+++ b/Changes
@@ -11,6 +11,7 @@
(amd64 and core 2 duo, ymmv). thanks a lot for the competition :)
- undo inline assembly, it is no longer helpful.
- no changes to the decompressor.
+ - use a HLOG of 16 by default now (formerly 15).
2.1 Fri Nov 2 13:34:42 CET 2007
- switched to a 2-clause bsd license with GPL exception.
diff --git a/lzfP.h b/lzfP.h
index 5c3ddc5..d533f18 100644
--- a/lzfP.h
+++ b/lzfP.h
@@ -49,10 +49,10 @@
* the difference between 15 and 14 is very small
* for small blocks (and 14 is usually a bit faster).
* For a low-memory/faster configuration, use HLOG == 13;
- * For best compression, use 15 or 16 (or more).
+ * For best compression, use 15 or 16 (or more, up to 23).
*/
#ifndef HLOG
-# define HLOG 15
+# define HLOG 16
#endif
/*
diff --git a/lzf_c.c b/lzf_c.c
index 48bdd6a..c9c05a4 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -237,32 +237,31 @@ lzf_compress (const void *const in_data, unsigned int in_len,
}
while (len--);
#endif
+
lit = 0; op++; /* start run */
- continue;
}
+ else
+ {
+ /* one more literal byte we must copy */
+ if (expect_false (op >= out_end))
+ return 0;
- /* one more literal byte we must copy */
-
- if (expect_false (op >= out_end))
- return 0;
-
- lit++;
- *op++ = *ip++;
+ lit++; *op++ = *ip++;
- if (expect_false (lit == MAX_LIT))
- {
- op [- lit - 1] = lit - 1; /* stop run */
- lit = 0; op++; /* start run */
+ if (expect_false (lit == MAX_LIT))
+ {
+ op [- lit - 1] = lit - 1; /* stop run */
+ lit = 0; op++; /* start run */
+ }
}
}
- if (op + 2 >= out_end)
+ if (op + 2 > out_end) /* at most 2 bytes can be missing here */
return 0;
while (ip < in_end)
{
- lit++;
- *op++ = *ip++;
+ lit++; *op++ = *ip++;
}
op [- lit - 1] = lit - 1; /* end run */