ReactOS  0.4.15-dev-1386-g5cb9f87
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 233 of file zstd_fast.c.

236 {
237  ZSTD_compressionParameters const* cParams = &ms->cParams;
238  U32 const mls = cParams->searchLength;
239  assert(ms->dictMatchState == NULL);
240  switch(mls)
241  {
242  default: /* includes case 3 */
243  case 4 :
244  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 4, ZSTD_noDict);
245  case 5 :
246  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 5, ZSTD_noDict);
247  case 6 :
248  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 6, ZSTD_noDict);
249  case 7 :
250  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 7, ZSTD_noDict);
251  }
252 }
#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
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, ZSTD_dictMode_e const dictMode)
Definition: zstd_fast.c:45
#define NULL
Definition: types.h:112
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 254 of file zstd_fast.c.

257 {
258  ZSTD_compressionParameters const* cParams = &ms->cParams;
259  U32 const mls = cParams->searchLength;
260  assert(ms->dictMatchState != NULL);
261  switch(mls)
262  {
263  default: /* includes case 3 */
264  case 4 :
265  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 4, ZSTD_dictMatchState);
266  case 5 :
267  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 5, ZSTD_dictMatchState);
268  case 6 :
269  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 6, ZSTD_dictMatchState);
270  case 7 :
271  return ZSTD_compressBlock_fast_generic(ms, seqStore, rep, src, srcSize, 7, ZSTD_dictMatchState);
272  }
273 }
#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
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, ZSTD_dictMode_e const dictMode)
Definition: zstd_fast.c:45
#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 373 of file zstd_fast.c.

376 {
377  ZSTD_compressionParameters const* cParams = &ms->cParams;
378  U32 const mls = cParams->searchLength;
379  switch(mls)
380  {
381  default: /* includes case 3 */
382  case 4 :
383  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 4);
384  case 5 :
385  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 5);
386  case 6 :
387  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 6);
388  case 7 :
389  return ZSTD_compressBlock_fast_extDict_generic(ms, seqStore, rep, src, srcSize, 7);
390  }
391 }
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:276

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.

17 {
18  const ZSTD_compressionParameters* const cParams = &ms->cParams;
19  U32* const hashTable = ms->hashTable;
20  U32 const hBits = cParams->hashLog;
21  U32 const mls = cParams->searchLength;
22  const BYTE* const base = ms->window.base;
23  const BYTE* ip = base + ms->nextToUpdate;
24  const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE;
25  const U32 fastHashFillStep = 3;
26 
27  /* Always insert every fastHashFillStep position into the hash table.
28  * Insert the other positions if their hash entry is empty.
29  */
30  for (; ip + fastHashFillStep - 1 <= iend; ip += fastHashFillStep) {
31  U32 const current = (U32)(ip - base);
32  U32 i;
33  for (i = 0; i < fastHashFillStep; ++i) {
34  size_t const hash = ZSTD_hashPtr(ip + i, hBits, mls);
35  if (i == 0 || hashTable[hash] == 0)
36  hashTable[hash] = current + i;
37  /* Only load extra positions for ZSTD_dtlm_full */
38  if (dtlm == ZSTD_dtlm_fast)
39  break;
40  }
41  }
42 }
void mls(int argc, const char *argv[])
Definition: cmds.c:1168
int hash
Definition: main.c:58
ZSTD_compressionParameters cParams
Definition: dhcpd.h:61
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)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: _hash_fun.h:40
unsigned int U32
Definition: xxhash.c:195
struct task_struct * current
Definition: linux.c:32

Referenced by ZSTD_ldm_fillFastTables(), and ZSTD_loadDictionaryContent().