162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright (c) Yann Collet, Facebook, Inc.
362306a36Sopenharmony_ci * All rights reserved.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * This source code is licensed under both the BSD-style license (found in the
662306a36Sopenharmony_ci * LICENSE file in the root directory of this source tree) and the GPLv2 (found
762306a36Sopenharmony_ci * in the COPYING file in the root directory of this source tree).
862306a36Sopenharmony_ci * You may select, at your option, one of the above-listed licenses.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#ifndef ZSTD_LAZY_H
1262306a36Sopenharmony_ci#define ZSTD_LAZY_H
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include "zstd_compress_internal.h"
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci/*
1862306a36Sopenharmony_ci * Dedicated Dictionary Search Structure bucket log. In the
1962306a36Sopenharmony_ci * ZSTD_dedicatedDictSearch mode, the hashTable has
2062306a36Sopenharmony_ci * 2 ** ZSTD_LAZY_DDSS_BUCKET_LOG entries in each bucket, rather than just
2162306a36Sopenharmony_ci * one.
2262306a36Sopenharmony_ci */
2362306a36Sopenharmony_ci#define ZSTD_LAZY_DDSS_BUCKET_LOG 2
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciU32 ZSTD_insertAndFindFirstIndex(ZSTD_matchState_t* ms, const BYTE* ip);
2662306a36Sopenharmony_civoid ZSTD_row_update(ZSTD_matchState_t* const ms, const BYTE* ip);
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_civoid ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const BYTE* const ip);
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_civoid ZSTD_preserveUnsortedMark (U32* const table, U32 const size, U32 const reducerValue);  /*! used in ZSTD_reduceIndex(). preemptively increase value of ZSTD_DUBT_UNSORTED_MARK */
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_cisize_t ZSTD_compressBlock_btlazy2(
3362306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
3462306a36Sopenharmony_ci        void const* src, size_t srcSize);
3562306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2(
3662306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
3762306a36Sopenharmony_ci        void const* src, size_t srcSize);
3862306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy(
3962306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
4062306a36Sopenharmony_ci        void const* src, size_t srcSize);
4162306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy(
4262306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
4362306a36Sopenharmony_ci        void const* src, size_t srcSize);
4462306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_row(
4562306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
4662306a36Sopenharmony_ci        void const* src, size_t srcSize);
4762306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_row(
4862306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
4962306a36Sopenharmony_ci        void const* src, size_t srcSize);
5062306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_row(
5162306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
5262306a36Sopenharmony_ci        void const* src, size_t srcSize);
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_cisize_t ZSTD_compressBlock_btlazy2_dictMatchState(
5562306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
5662306a36Sopenharmony_ci        void const* src, size_t srcSize);
5762306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_dictMatchState(
5862306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
5962306a36Sopenharmony_ci        void const* src, size_t srcSize);
6062306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_dictMatchState(
6162306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
6262306a36Sopenharmony_ci        void const* src, size_t srcSize);
6362306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_dictMatchState(
6462306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
6562306a36Sopenharmony_ci        void const* src, size_t srcSize);
6662306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_dictMatchState_row(
6762306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
6862306a36Sopenharmony_ci        void const* src, size_t srcSize);
6962306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_dictMatchState_row(
7062306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
7162306a36Sopenharmony_ci        void const* src, size_t srcSize);
7262306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_dictMatchState_row(
7362306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
7462306a36Sopenharmony_ci        void const* src, size_t srcSize);
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_dedicatedDictSearch(
7762306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
7862306a36Sopenharmony_ci        void const* src, size_t srcSize);
7962306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_dedicatedDictSearch(
8062306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
8162306a36Sopenharmony_ci        void const* src, size_t srcSize);
8262306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_dedicatedDictSearch(
8362306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
8462306a36Sopenharmony_ci        void const* src, size_t srcSize);
8562306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_dedicatedDictSearch_row(
8662306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
8762306a36Sopenharmony_ci        void const* src, size_t srcSize);
8862306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_dedicatedDictSearch_row(
8962306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
9062306a36Sopenharmony_ci        void const* src, size_t srcSize);
9162306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_dedicatedDictSearch_row(
9262306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
9362306a36Sopenharmony_ci        void const* src, size_t srcSize);
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_extDict(
9662306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
9762306a36Sopenharmony_ci        void const* src, size_t srcSize);
9862306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_extDict(
9962306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
10062306a36Sopenharmony_ci        void const* src, size_t srcSize);
10162306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_extDict(
10262306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
10362306a36Sopenharmony_ci        void const* src, size_t srcSize);
10462306a36Sopenharmony_cisize_t ZSTD_compressBlock_greedy_extDict_row(
10562306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
10662306a36Sopenharmony_ci        void const* src, size_t srcSize);
10762306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy_extDict_row(
10862306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
10962306a36Sopenharmony_ci        void const* src, size_t srcSize);
11062306a36Sopenharmony_cisize_t ZSTD_compressBlock_lazy2_extDict_row(
11162306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
11262306a36Sopenharmony_ci        void const* src, size_t srcSize);
11362306a36Sopenharmony_cisize_t ZSTD_compressBlock_btlazy2_extDict(
11462306a36Sopenharmony_ci        ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
11562306a36Sopenharmony_ci        void const* src, size_t srcSize);
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci#endif /* ZSTD_LAZY_H */
120