Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: third_party/lzma_sdk/LzHash.h

Issue 658573004: Updating to new OTS repo from https://github.com/khaledhosny/ots.git (Closed) Base URL: https://chromium.googlesource.com/external/ots@master
Patch Set: Adding Colored Emoji changes from external/git repo Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* LzHash.h -- HASH functions for LZ algorithms
2 2009-02-07 : Igor Pavlov : Public domain
3 in the public domain */
4
5 #ifndef __LZ_HASH_H
6 #define __LZ_HASH_H
7
8 #define kHash2Size (1 << 10)
9 #define kHash3Size (1 << 16)
10 #define kHash4Size (1 << 20)
11
12 #define kFix3HashSize (kHash2Size)
13 #define kFix4HashSize (kHash2Size + kHash3Size)
14 #define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
15
16 #define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);
17
18 #define HASH3_CALC { \
19 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
20 hash2Value = temp & (kHash2Size - 1); \
21 hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
22
23 #define HASH4_CALC { \
24 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
25 hash2Value = temp & (kHash2Size - 1); \
26 hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
27 hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMa sk; }
28
29 #define HASH5_CALC { \
30 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
31 hash2Value = temp & (kHash2Size - 1); \
32 hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
33 hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \
34 hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \
35 hash4Value &= (kHash4Size - 1); }
36
37 /* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[ cur[2]]) & 0xFFFF; */
38 #define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur [1]]) & 0xFFFF;
39
40
41 #define MT_HASH2_CALC \
42 hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
43
44 #define MT_HASH3_CALC { \
45 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
46 hash2Value = temp & (kHash2Size - 1); \
47 hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
48
49 #define MT_HASH4_CALC { \
50 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
51 hash2Value = temp & (kHash2Size - 1); \
52 hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
53 hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4S ize - 1); }
54
55 #endif
OLDNEW
« .gitmodules ('K') | « third_party/lzma_sdk/LzFind.c ('k') | third_party/lzma_sdk/LzmaDec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698