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