From 4c89419158d9aff46164db5ef49004152fbc9453 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 27 Mar 2011 23:53:23 +0000 Subject: *** empty log message *** --- lzfP.h | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'lzfP.h') diff --git a/lzfP.h b/lzfP.h index cf4af7f..97aabf4 100644 --- a/lzfP.h +++ b/lzfP.h @@ -88,7 +88,7 @@ * deterministic/repeatable when the configuration otherwise is the same). */ #ifndef INIT_HTAB -# define INIT_HTAB 0 +# define INIT_HTAB 1 #endif /* @@ -121,12 +121,30 @@ # define CHECK_INPUT 1 #endif +/* + * Whether the target CPU has a slow multiplication. This affects + * the default hash function for the compressor, and enables a slightly + * worse hash function that needs only shifts. + */ +#ifndef MULTIPLICATION_IS_SLOW +# define MULTIPLICATION_IS_SLOW 0 +#endif + +/* + * If defined, then this data type will be used for storing offsets. + * This can be useful if you want to use a huge hashtable, want to + * conserve memory, or both, and your data fits into e.g. 64kb. + * If instead you want to compress data > 4GB, then it's better to + * to "#define LZF_USE_OFFSETS 0" instead. + */ +/*#define LZF_HSLOT unsigned short*/ + /* * Whether to store pointers or offsets inside the hash table. On * 64 bit architetcures, pointers take up twice as much space, * and might also be slower. Default is to autodetect. */ -/*#define LZF_USER_OFFSETS autodetect */ +/*#define LZF_USE_OFFSETS autodetect */ /*****************************************************************************/ /* nothing should be changed below */ @@ -155,12 +173,16 @@ using namespace std; typedef unsigned char u8; -#if LZF_USE_OFFSETS +#ifdef LZF_HSLOT # define LZF_HSLOT_BIAS ((const u8 *)in_data) - typedef unsigned int LZF_HSLOT; #else -# define LZF_HSLOT_BIAS 0 - typedef const u8 *LZF_HSLOT; +# if LZF_USE_OFFSETS +# define LZF_HSLOT_BIAS ((const u8 *)in_data) + typedef unsigned int LZF_HSLOT; +# else +# define LZF_HSLOT_BIAS 0 + typedef const u8 *LZF_HSLOT; +# endif #endif typedef LZF_HSLOT LZF_STATE[1 << (HLOG)]; -- cgit v1.2.3