ReactOS  0.4.15-dev-4863-gba0d16f
zstd_fast.h File Reference
#include "mem.h"
#include "zstd_compress_internal.h"
Include dependency graph for zstd_fast.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ZSTD_fillHashTable (ZSTD_matchState_t *ms, void const *end, ZSTD_dictTableLoadMethod_e dtlm)
 
size_t ZSTD_compressBlock_fast (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_fast_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_fast_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 

Function Documentation

◆ ZSTD_compressBlock_fast()

size_t ZSTD_compressBlock_fast ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const src,
size_t  srcSize 
)

Definition at line 186 of file zstd_fast.c.

189 {
190  U32 const mls = ms->cParams.minMatch;
191  assert(ms->dictMatchState == NULL);
192  switch(mls)
193  {
194  default: /* includes case 3 */
195  case 4 :
196  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 4);
197  case 5 :
198  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 5);
199  case 6 :
200  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 6);
201  case 7 :
202  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 7);
203  }
204 }
#define assert(x)
Definition: debug.h:53
void mls(int argc, const char *argv[])
Definition: cmds.c:1168
ZSTD_compressionParameters cParams
const ZSTD_matchState_t * dictMatchState
GLenum src
Definition: glext.h:6340
#define NULL
Definition: types.h:112
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_generic(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
Definition: zstd_fast.c:47
unsigned int U32
Definition: xxhash.c:195

Referenced by ZSTD_selectBlockCompressor().

◆ ZSTD_compressBlock_fast_dictMatchState()

size_t ZSTD_compressBlock_fast_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const src,
size_t  srcSize 
)

Definition at line 354 of file zstd_fast.c.

357 {
358  U32 const mls = ms->cParams.minMatch;
359  assert(ms->dictMatchState != NULL);
360  switch(mls)
361  {
362  default: /* includes case 3 */
363  case 4 :
364  return ZSTD_compressBlock_fast_dictMatchState_generic(ms, seqStore, rep, src, srcSize, 4);
365  case 5 :
366  return ZSTD_compressBlock_fast_dictMatchState_generic(ms, seqStore, rep, src, srcSize, 5);
367  case 6 :
368  return ZSTD_compressBlock_fast_dictMatchState_generic(ms, seqStore, rep, src, srcSize, 6);
369  case 7 :
370  return ZSTD_compressBlock_fast_dictMatchState_generic(ms, seqStore, rep, src, srcSize, 7);
371  }
372 }
#define assert(x)
Definition: debug.h:53
void mls(int argc, const char *argv[])
Definition: cmds.c:1168
ZSTD_compressionParameters cParams
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_dictMatchState_generic(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
Definition: zstd_fast.c:207
const ZSTD_matchState_t * dictMatchState
GLenum src
Definition: glext.h:6340
#define NULL
Definition: types.h:112
unsigned int U32
Definition: xxhash.c:195

Referenced by ZSTD_selectBlockCompressor().

◆ ZSTD_compressBlock_fast_extDict()

size_t ZSTD_compressBlock_fast_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const src,
size_t  srcSize 
)

Definition at line 479 of file zstd_fast.c.

482 {
483  U32 const mls = ms->cParams.minMatch;
484  switch(mls)
485  {
486  default: /* includes case 3 */
487  case 4 :
488  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 4);
489  case 5 :
490  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 5);
491  case 6 :
492  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 6);
493  case 7 :
494  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 7);
495  }
496 }
void mls(int argc, const char *argv[])
Definition: cmds.c:1168
ZSTD_compressionParameters cParams
GLenum src
Definition: glext.h:6340
unsigned int U32
Definition: xxhash.c:195
static size_t ZSTD_compressBlock_fast_extDict_generic(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
Definition: zstd_fast.c:375

Referenced by ZSTD_selectBlockCompressor().

◆ ZSTD_fillHashTable()

void ZSTD_fillHashTable ( ZSTD_matchState_t ms,
void const end,
ZSTD_dictTableLoadMethod_e  dtlm 
)

Definition at line 15 of file zstd_fast.c.

18 {
19  const ZSTD_compressionParameters* const cParams = &ms->cParams;
20  U32* const hashTable = ms->hashTable;
21  U32 const hBits = cParams->hashLog;
22  U32 const mls = cParams->minMatch;
23  const BYTE* const base = ms->window.base;
24  const BYTE* ip = base + ms->nextToUpdate;
25  const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE;
26  const U32 fastHashFillStep = 3;
27 
28  /* Always insert every fastHashFillStep position into the hash table.
29  * Insert the other positions if their hash entry is empty.
30  */
31  for ( ; ip + fastHashFillStep < iend + 2; ip += fastHashFillStep) {
32  U32 const current = (U32)(ip - base);
33  size_t const hash0 = ZSTD_hashPtr(ip, hBits, mls);
34  hashTable[hash0] = current;
35  if (dtlm == ZSTD_dtlm_fast) continue;
36  /* Only load extra positions for ZSTD_dtlm_full */
37  { U32 p;
38  for (p = 1; p < fastHashFillStep; ++p) {
39  size_t const hash = ZSTD_hashPtr(ip + p, hBits, mls);
40  if (hashTable[hash] == 0) { /* not yet filled */
41  hashTable[hash] = current + p;
42  } } } }
43 }
void mls(int argc, const char *argv[])
Definition: cmds.c:1168
int hash
Definition: main.c:58
ZSTD_compressionParameters cParams
Definition: dhcpd.h:61
struct task_struct * current
Definition: linux.c:32
GLuint GLuint end
Definition: gl.h:1545
#define HASH_READ_SIZE
unsigned char BYTE
Definition: xxhash.c:193
MEM_STATIC size_t ZSTD_hashPtr(const void *p, U32 hBits, U32 mls)
GLfloat GLfloat p
Definition: glext.h:8902
Definition: _hash_fun.h:40
unsigned int U32
Definition: xxhash.c:195

Referenced by ZSTD_ldm_fillFastTables(), and ZSTD_loadDictionaryContent().