1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
8 * You may select, at your option, one of the above-listed licenses.
9 */
10
11#ifndef ZSTD_LAZY_H
12#define ZSTD_LAZY_H
13
14#if defined (__cplusplus)
15extern "C" {
16#endif
17
18#include "zstd_compress_internal.h"
19
20/**
21 * Dedicated Dictionary Search Structure bucket log. In the
22 * ZSTD_dedicatedDictSearch mode, the hashTable has
23 * 2 ** ZSTD_LAZY_DDSS_BUCKET_LOG entries in each bucket, rather than just
24 * one.
25 */
26#define ZSTD_LAZY_DDSS_BUCKET_LOG 2
27
28#define ZSTD_ROW_HASH_TAG_BITS 8 /* nb bits to use for the tag */
29
30U32 ZSTD_insertAndFindFirstIndex(ZSTD_matchState_t* ms, const BYTE* ip);
31void ZSTD_row_update(ZSTD_matchState_t* const ms, const BYTE* ip);
32
33void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const BYTE* const ip);
34
35void ZSTD_preserveUnsortedMark (U32* const table, U32 const size, U32 const reducerValue); /*! used in ZSTD_reduceIndex(). preemptively increase value of ZSTD_DUBT_UNSORTED_MARK */
36
37size_t ZSTD_compressBlock_btlazy2(
38 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
39 void const* src, size_t srcSize);
40size_t ZSTD_compressBlock_lazy2(
41 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
42 void const* src, size_t srcSize);
43size_t ZSTD_compressBlock_lazy(
44 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
45 void const* src, size_t srcSize);
46size_t ZSTD_compressBlock_greedy(
47 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
48 void const* src, size_t srcSize);
49size_t ZSTD_compressBlock_lazy2_row(
50 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
51 void const* src, size_t srcSize);
52size_t ZSTD_compressBlock_lazy_row(
53 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
54 void const* src, size_t srcSize);
55size_t ZSTD_compressBlock_greedy_row(
56 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
57 void const* src, size_t srcSize);
58
59size_t ZSTD_compressBlock_btlazy2_dictMatchState(
60 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
61 void const* src, size_t srcSize);
62size_t ZSTD_compressBlock_lazy2_dictMatchState(
63 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
64 void const* src, size_t srcSize);
65size_t ZSTD_compressBlock_lazy_dictMatchState(
66 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
67 void const* src, size_t srcSize);
68size_t ZSTD_compressBlock_greedy_dictMatchState(
69 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
70 void const* src, size_t srcSize);
71size_t ZSTD_compressBlock_lazy2_dictMatchState_row(
72 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
73 void const* src, size_t srcSize);
74size_t ZSTD_compressBlock_lazy_dictMatchState_row(
75 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
76 void const* src, size_t srcSize);
77size_t ZSTD_compressBlock_greedy_dictMatchState_row(
78 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
79 void const* src, size_t srcSize);
80
81size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch(
82 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
83 void const* src, size_t srcSize);
84size_t ZSTD_compressBlock_lazy_dedicatedDictSearch(
85 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
86 void const* src, size_t srcSize);
87size_t ZSTD_compressBlock_greedy_dedicatedDictSearch(
88 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
89 void const* src, size_t srcSize);
90size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch_row(
91 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
92 void const* src, size_t srcSize);
93size_t ZSTD_compressBlock_lazy_dedicatedDictSearch_row(
94 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
95 void const* src, size_t srcSize);
96size_t ZSTD_compressBlock_greedy_dedicatedDictSearch_row(
97 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
98 void const* src, size_t srcSize);
99
100size_t ZSTD_compressBlock_greedy_extDict(
101 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
102 void const* src, size_t srcSize);
103size_t ZSTD_compressBlock_lazy_extDict(
104 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
105 void const* src, size_t srcSize);
106size_t ZSTD_compressBlock_lazy2_extDict(
107 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
108 void const* src, size_t srcSize);
109size_t ZSTD_compressBlock_greedy_extDict_row(
110 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
111 void const* src, size_t srcSize);
112size_t ZSTD_compressBlock_lazy_extDict_row(
113 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
114 void const* src, size_t srcSize);
115size_t ZSTD_compressBlock_lazy2_extDict_row(
116 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
117 void const* src, size_t srcSize);
118size_t ZSTD_compressBlock_btlazy2_extDict(
119 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
120 void const* src, size_t srcSize);
121
122
123#if defined (__cplusplus)
124}
125#endif
126
127#endif /* ZSTD_LAZY_H */
128