ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/liblzf/lzf_c.c
(Generate patch)

Comparing liblzf/lzf_c.c (file contents):
Revision 1.22 by root, Tue Nov 13 10:41:52 2007 UTC vs.
Revision 1.23 by root, Tue Nov 13 10:48:02 2007 UTC

46 */ 46 */
47#ifndef FRST 47#ifndef FRST
48# define FRST(p) (((p[0]) << 8) | p[1]) 48# define FRST(p) (((p[0]) << 8) | p[1])
49# define NEXT(v,p) (((v) << 8) | p[2]) 49# define NEXT(v,p) (((v) << 8) | p[2])
50# if ULTRA_FAST 50# if ULTRA_FAST
51# define IDX(h) (((h >> (3*8 - HLOG)) - h ) & (HSIZE - 1)) 51# define IDX(h) ((( h >> (3*8 - HLOG)) - h ) & (HSIZE - 1))
52# elif VERY_FAST 52# elif VERY_FAST
53# define IDX(h) (((h >> (3*8 - HLOG)) - h*5) & (HSIZE - 1)) 53# define IDX(h) ((( h >> (3*8 - HLOG)) - h*5) & (HSIZE - 1))
54# else 54# else
55# define IDX(h) ((((h ^ (h << 5)) >> (3*8 - HLOG)) - h*5) & (HSIZE - 1)) 55# define IDX(h) ((((h ^ (h << 5)) >> (3*8 - HLOG)) - h*5) & (HSIZE - 1))
56# endif 56# endif
57/*# define IDX(h) ((ip[0] * 121 ^ ip[1] * 33 ^ ip[2] * 1) & (HSIZE-1))*/
58#endif 57#endif
59/* 58/*
60 * IDX works because it is very similar to a multiplicative hash, e.g. 59 * IDX works because it is very similar to a multiplicative hash, e.g.
61 * ((h * 57321 >> (3*8 - HLOG)) & (HSIZE - 1)) 60 * ((h * 57321 >> (3*8 - HLOG)) & (HSIZE - 1))
62 * the latter is also quite fast on newer CPUs, and compresses similarly. 61 * the latter is also quite fast on newer CPUs, and compresses similarly.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines