xref: /aosp_15_r20/external/zstd/lib/compress/zstd_double_fast.h (revision 01826a4963a0d8a59bc3812d29bdf0fb76416722)
1*01826a49SYabin Cui /*
2*01826a49SYabin Cui  * Copyright (c) Meta Platforms, Inc. and affiliates.
3*01826a49SYabin Cui  * All rights reserved.
4*01826a49SYabin Cui  *
5*01826a49SYabin Cui  * This source code is licensed under both the BSD-style license (found in the
6*01826a49SYabin Cui  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7*01826a49SYabin Cui  * in the COPYING file in the root directory of this source tree).
8*01826a49SYabin Cui  * You may select, at your option, one of the above-listed licenses.
9*01826a49SYabin Cui  */
10*01826a49SYabin Cui 
11*01826a49SYabin Cui #ifndef ZSTD_DOUBLE_FAST_H
12*01826a49SYabin Cui #define ZSTD_DOUBLE_FAST_H
13*01826a49SYabin Cui 
14*01826a49SYabin Cui #if defined (__cplusplus)
15*01826a49SYabin Cui extern "C" {
16*01826a49SYabin Cui #endif
17*01826a49SYabin Cui 
18*01826a49SYabin Cui #include "../common/mem.h"      /* U32 */
19*01826a49SYabin Cui #include "zstd_compress_internal.h"     /* ZSTD_CCtx, size_t */
20*01826a49SYabin Cui 
21*01826a49SYabin Cui #ifndef ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR
22*01826a49SYabin Cui 
23*01826a49SYabin Cui void ZSTD_fillDoubleHashTable(ZSTD_matchState_t* ms,
24*01826a49SYabin Cui                               void const* end, ZSTD_dictTableLoadMethod_e dtlm,
25*01826a49SYabin Cui                               ZSTD_tableFillPurpose_e tfp);
26*01826a49SYabin Cui 
27*01826a49SYabin Cui size_t ZSTD_compressBlock_doubleFast(
28*01826a49SYabin Cui         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
29*01826a49SYabin Cui         void const* src, size_t srcSize);
30*01826a49SYabin Cui size_t ZSTD_compressBlock_doubleFast_dictMatchState(
31*01826a49SYabin Cui         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
32*01826a49SYabin Cui         void const* src, size_t srcSize);
33*01826a49SYabin Cui size_t ZSTD_compressBlock_doubleFast_extDict(
34*01826a49SYabin Cui         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
35*01826a49SYabin Cui         void const* src, size_t srcSize);
36*01826a49SYabin Cui 
37*01826a49SYabin Cui #define ZSTD_COMPRESSBLOCK_DOUBLEFAST ZSTD_compressBlock_doubleFast
38*01826a49SYabin Cui #define ZSTD_COMPRESSBLOCK_DOUBLEFAST_DICTMATCHSTATE ZSTD_compressBlock_doubleFast_dictMatchState
39*01826a49SYabin Cui #define ZSTD_COMPRESSBLOCK_DOUBLEFAST_EXTDICT ZSTD_compressBlock_doubleFast_extDict
40*01826a49SYabin Cui #else
41*01826a49SYabin Cui #define ZSTD_COMPRESSBLOCK_DOUBLEFAST NULL
42*01826a49SYabin Cui #define ZSTD_COMPRESSBLOCK_DOUBLEFAST_DICTMATCHSTATE NULL
43*01826a49SYabin Cui #define ZSTD_COMPRESSBLOCK_DOUBLEFAST_EXTDICT NULL
44*01826a49SYabin Cui #endif /* ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR */
45*01826a49SYabin Cui 
46*01826a49SYabin Cui #if defined (__cplusplus)
47*01826a49SYabin Cui }
48*01826a49SYabin Cui #endif
49*01826a49SYabin Cui 
50*01826a49SYabin Cui #endif /* ZSTD_DOUBLE_FAST_H */
51