xref: /freebsd/sys/contrib/zstd/lib/compress/zstd_lazy.h (revision 5ff13fbc199bdf5f0572845351c68ee5ca828e71)
10c16b537SWarner Losh /*
2*5ff13fbcSAllan Jude  * Copyright (c) Yann Collet, Facebook, Inc.
30c16b537SWarner Losh  * All rights reserved.
40c16b537SWarner Losh  *
50c16b537SWarner Losh  * This source code is licensed under both the BSD-style license (found in the
60c16b537SWarner Losh  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
70c16b537SWarner Losh  * in the COPYING file in the root directory of this source tree).
80c16b537SWarner Losh  * You may select, at your option, one of the above-listed licenses.
90c16b537SWarner Losh  */
100c16b537SWarner Losh 
110c16b537SWarner Losh #ifndef ZSTD_LAZY_H
120c16b537SWarner Losh #define ZSTD_LAZY_H
130c16b537SWarner Losh 
140c16b537SWarner Losh #if defined (__cplusplus)
150c16b537SWarner Losh extern "C" {
160c16b537SWarner Losh #endif
170c16b537SWarner Losh 
1819fcbaf1SConrad Meyer #include "zstd_compress_internal.h"
19052d3c12SConrad Meyer 
20f7cd7fe5SConrad Meyer /**
21f7cd7fe5SConrad Meyer  * Dedicated Dictionary Search Structure bucket log. In the
22f7cd7fe5SConrad Meyer  * ZSTD_dedicatedDictSearch mode, the hashTable has
23f7cd7fe5SConrad Meyer  * 2 ** ZSTD_LAZY_DDSS_BUCKET_LOG entries in each bucket, rather than just
24f7cd7fe5SConrad Meyer  * one.
25f7cd7fe5SConrad Meyer  */
26f7cd7fe5SConrad Meyer #define ZSTD_LAZY_DDSS_BUCKET_LOG 2
27f7cd7fe5SConrad Meyer 
280f743729SConrad Meyer U32 ZSTD_insertAndFindFirstIndex(ZSTD_matchState_t* ms, const BYTE* ip);
29*5ff13fbcSAllan Jude void ZSTD_row_update(ZSTD_matchState_t* const ms, const BYTE* ip);
300c16b537SWarner Losh 
31f7cd7fe5SConrad Meyer void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const BYTE* const ip);
32f7cd7fe5SConrad Meyer 
332b9c00cbSConrad Meyer void ZSTD_preserveUnsortedMark (U32* const table, U32 const size, U32 const reducerValue);  /*! used in ZSTD_reduceIndex(). preemptively increase value of ZSTD_DUBT_UNSORTED_MARK */
340c16b537SWarner Losh 
3519fcbaf1SConrad Meyer size_t ZSTD_compressBlock_btlazy2(
3619fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
370f743729SConrad Meyer         void const* src, size_t srcSize);
3819fcbaf1SConrad Meyer size_t ZSTD_compressBlock_lazy2(
3919fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
400f743729SConrad Meyer         void const* src, size_t srcSize);
4119fcbaf1SConrad Meyer size_t ZSTD_compressBlock_lazy(
4219fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
430f743729SConrad Meyer         void const* src, size_t srcSize);
4419fcbaf1SConrad Meyer size_t ZSTD_compressBlock_greedy(
4519fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
460f743729SConrad Meyer         void const* src, size_t srcSize);
47*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy2_row(
48*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
49*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
50*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy_row(
51*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
52*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
53*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_greedy_row(
54*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
55*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
560f743729SConrad Meyer 
570f743729SConrad Meyer size_t ZSTD_compressBlock_btlazy2_dictMatchState(
580f743729SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
590f743729SConrad Meyer         void const* src, size_t srcSize);
600f743729SConrad Meyer size_t ZSTD_compressBlock_lazy2_dictMatchState(
610f743729SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
620f743729SConrad Meyer         void const* src, size_t srcSize);
630f743729SConrad Meyer size_t ZSTD_compressBlock_lazy_dictMatchState(
640f743729SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
650f743729SConrad Meyer         void const* src, size_t srcSize);
660f743729SConrad Meyer size_t ZSTD_compressBlock_greedy_dictMatchState(
670f743729SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
680f743729SConrad Meyer         void const* src, size_t srcSize);
69*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy2_dictMatchState_row(
70*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
71*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
72*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy_dictMatchState_row(
73*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
74*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
75*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_greedy_dictMatchState_row(
76*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
77*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
7819fcbaf1SConrad Meyer 
79f7cd7fe5SConrad Meyer size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch(
80f7cd7fe5SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
81f7cd7fe5SConrad Meyer         void const* src, size_t srcSize);
82f7cd7fe5SConrad Meyer size_t ZSTD_compressBlock_lazy_dedicatedDictSearch(
83f7cd7fe5SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
84f7cd7fe5SConrad Meyer         void const* src, size_t srcSize);
85f7cd7fe5SConrad Meyer size_t ZSTD_compressBlock_greedy_dedicatedDictSearch(
86f7cd7fe5SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
87f7cd7fe5SConrad Meyer         void const* src, size_t srcSize);
88*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch_row(
89*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
90*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
91*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy_dedicatedDictSearch_row(
92*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
93*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
94*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_greedy_dedicatedDictSearch_row(
95*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
96*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
97f7cd7fe5SConrad Meyer 
9819fcbaf1SConrad Meyer size_t ZSTD_compressBlock_greedy_extDict(
9919fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
1000f743729SConrad Meyer         void const* src, size_t srcSize);
10119fcbaf1SConrad Meyer size_t ZSTD_compressBlock_lazy_extDict(
10219fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
1030f743729SConrad Meyer         void const* src, size_t srcSize);
10419fcbaf1SConrad Meyer size_t ZSTD_compressBlock_lazy2_extDict(
10519fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
1060f743729SConrad Meyer         void const* src, size_t srcSize);
107*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_greedy_extDict_row(
108*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
109*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
110*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy_extDict_row(
111*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
112*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
113*5ff13fbcSAllan Jude size_t ZSTD_compressBlock_lazy2_extDict_row(
114*5ff13fbcSAllan Jude         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
115*5ff13fbcSAllan Jude         void const* src, size_t srcSize);
11619fcbaf1SConrad Meyer size_t ZSTD_compressBlock_btlazy2_extDict(
11719fcbaf1SConrad Meyer         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
1180f743729SConrad Meyer         void const* src, size_t srcSize);
1190c16b537SWarner Losh 
120*5ff13fbcSAllan Jude 
1210c16b537SWarner Losh #if defined (__cplusplus)
1220c16b537SWarner Losh }
1230c16b537SWarner Losh #endif
1240c16b537SWarner Losh 
1250c16b537SWarner Losh #endif /* ZSTD_LAZY_H */
126