Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
LzFindMt.h
Go to the documentation of this file.
1/* LzFindMt.h -- multithreaded Match finder for LZ algorithms
22023-03-05 : Igor Pavlov : Public domain */
3
4#ifndef ZIP7_INC_LZ_FIND_MT_H
5#define ZIP7_INC_LZ_FIND_MT_H
6
7#include "LzFind.h"
8#include "Threads.h"
9
11
12typedef struct
13{
14 UInt32 numProcessedBlocks;
15 CThread thread;
16 UInt64 affinity;
17
18 BoolInt wasCreated;
19 BoolInt needStart;
20 BoolInt csWasInitialized;
21 BoolInt csWasEntered;
22
23 BoolInt exit;
24 BoolInt stopWriting;
25
26 CAutoResetEvent canStart;
27 CAutoResetEvent wasStopped;
28 CSemaphore freeSemaphore;
29 CSemaphore filledSemaphore;
31 // UInt32 numBlocks_Sent;
32} CMtSync;
33
34typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances);
35
36/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */
37#define kMtCacheLineDummy 128
38
39typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos,
40 UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc);
41
42typedef struct
43{
44 /* LZ */
51
54 // UInt32 hash4Mask;
56 const UInt32 *crc;
57
59 UInt32 failure_LZ_BT; // failure in BT transfered to LZ
60 // UInt32 failure_LZ_LZ; // failure in LZ tables
61 UInt32 failureBuf[1];
62 // UInt32 crc[256];
63
64 /* LZ + BT */
67
68 /* BT */
74
75
80 const Byte *buffer;
82 UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
84
85 /* BT + Hash */
87 /* Byte hashDummy[kMtCacheLineDummy]; */
88
89 /* Hash */
92 // CMatchFinder MatchFinder;
94
95// only for Mt part
98
99SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,
100 UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc);
102
103/* call MatchFinderMt_InitMt() before IMatchFinder::Init() */
106
108
109#endif
int BoolInt
Definition 7zTypes.h:259
#define EXTERN_C_BEGIN
Definition 7zTypes.h:20
unsigned long long int UInt64
Definition 7zTypes.h:234
int SRes
Definition 7zTypes.h:45
#define EXTERN_C_END
Definition 7zTypes.h:21
EXTERN_C_BEGIN typedef UInt32 CLzRef
Definition LzFind.h:11
void MatchFinderMt_Construct(CMatchFinderMt *p)
Definition LzFindMt.c:789
SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc)
Definition LzFindMt.c:848
void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable)
void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAllocPtr alloc)
Definition LzFindMt.c:802
SRes MatchFinderMt_InitMt(CMatchFinderMt *p)
Definition LzFindMt.c:873
void MatchFinderMt_ReleaseStream(CMatchFinderMt *p)
Definition LzFindMt.c:936
struct CMatchFinderMt_ CMatchFinderMt
void(* Mf_GetHeads)(const Byte *buffer, UInt32 pos, UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc)
Definition LzFindMt.h:42
struct _CMtSync CMtSync
#define kMtCacheLineDummy
Definition LzFindMt.h:37
UInt32 *(* Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances)
Definition LzFindMt.h:34
Definition Threads.h:232
Definition Threads.h:186
Definition LzFind.h:14
Definition LzFindMt.h:43
UInt32 cyclicBufferSize
Definition LzFindMt.h:82
Mf_Mix_Matches MixMatchesFunc
Definition LzFindMt.h:58
const UInt32 * btBufPos
Definition LzFindMt.h:47
const UInt32 * crc
Definition LzFindMt.h:56
UInt32 * hash
Definition LzFindMt.h:52
const Byte * buffer
Definition LzFindMt.h:80
CMtSync btSync
Definition LzFindMt.h:65
CLzRef * son
Definition LzFindMt.h:76
UInt32 failure_BT
Definition LzFindMt.h:73
UInt32 fixedHashSize
Definition LzFindMt.h:53
UInt32 hashBufPosLimit
Definition LzFindMt.h:71
Mf_GetHeads GetHeadsFunc
Definition LzFindMt.h:90
UInt32 matchMaxLen
Definition LzFindMt.h:77
UInt32 historySize
Definition LzFindMt.h:55
CMatchFinder * MatchFinder
Definition LzFindMt.h:91
UInt32 numHashBytes
Definition LzFindMt.h:78
const UInt32 * btBufPosLimit
Definition LzFindMt.h:48
UInt32 pos
Definition LzFindMt.h:79
const Byte * pointerToCurPos
Definition LzFindMt.h:45
UInt32 cutValue
Definition LzFindMt.h:83
CMtSync hashSync
Definition LzFindMt.h:86
UInt32 * hashBuf
Definition LzFindMt.h:69
UInt32 hashNumAvail
Definition LzFindMt.h:72
UInt32 hashBufPos
Definition LzFindMt.h:70
UInt32 btNumAvailBytes
Definition LzFindMt.h:50
UInt32 lzPos
Definition LzFindMt.h:49
UInt32 failure_LZ_BT
Definition LzFindMt.h:59
UInt32 cyclicBufferPos
Definition LzFindMt.h:81
UInt32 * btBuf
Definition LzFindMt.h:46
Definition LzFindMt.h:13
Definition Threads.h:212
Definition Threads.h:76
Definition LzFind.h:134
Definition 7zTypes.h:460
unsigned int UInt32
Definition bzlib_private.h:45
unsigned char Byte
Definition zconf.h:391