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_OPT_H 12 #define ZSTD_OPT_H 13 14 #include "zstd_compress_internal.h" 15 16 #if !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) \ 17 || !defined(ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR) \ 18 || !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR) 19 /* used in ZSTD_loadDictionaryContent() */ 20 void ZSTD_updateTree(ZSTD_MatchState_t* ms, const BYTE* ip, const BYTE* iend); 21 #endif 22 23 #ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR 24 size_t ZSTD_compressBlock_btopt( 25 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 26 void const* src, size_t srcSize); 27 size_t ZSTD_compressBlock_btopt_dictMatchState( 28 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 29 void const* src, size_t srcSize); 30 size_t ZSTD_compressBlock_btopt_extDict( 31 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 32 void const* src, size_t srcSize); 33 34 #define ZSTD_COMPRESSBLOCK_BTOPT ZSTD_compressBlock_btopt 35 #define ZSTD_COMPRESSBLOCK_BTOPT_DICTMATCHSTATE ZSTD_compressBlock_btopt_dictMatchState 36 #define ZSTD_COMPRESSBLOCK_BTOPT_EXTDICT ZSTD_compressBlock_btopt_extDict 37 #else 38 #define ZSTD_COMPRESSBLOCK_BTOPT NULL 39 #define ZSTD_COMPRESSBLOCK_BTOPT_DICTMATCHSTATE NULL 40 #define ZSTD_COMPRESSBLOCK_BTOPT_EXTDICT NULL 41 #endif 42 43 #ifndef ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR 44 size_t ZSTD_compressBlock_btultra( 45 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 46 void const* src, size_t srcSize); 47 size_t ZSTD_compressBlock_btultra_dictMatchState( 48 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 49 void const* src, size_t srcSize); 50 size_t ZSTD_compressBlock_btultra_extDict( 51 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 52 void const* src, size_t srcSize); 53 54 /* note : no btultra2 variant for extDict nor dictMatchState, 55 * because btultra2 is not meant to work with dictionaries 56 * and is only specific for the first block (no prefix) */ 57 size_t ZSTD_compressBlock_btultra2( 58 ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 59 void const* src, size_t srcSize); 60 61 #define ZSTD_COMPRESSBLOCK_BTULTRA ZSTD_compressBlock_btultra 62 #define ZSTD_COMPRESSBLOCK_BTULTRA_DICTMATCHSTATE ZSTD_compressBlock_btultra_dictMatchState 63 #define ZSTD_COMPRESSBLOCK_BTULTRA_EXTDICT ZSTD_compressBlock_btultra_extDict 64 #define ZSTD_COMPRESSBLOCK_BTULTRA2 ZSTD_compressBlock_btultra2 65 #else 66 #define ZSTD_COMPRESSBLOCK_BTULTRA NULL 67 #define ZSTD_COMPRESSBLOCK_BTULTRA_DICTMATCHSTATE NULL 68 #define ZSTD_COMPRESSBLOCK_BTULTRA_EXTDICT NULL 69 #define ZSTD_COMPRESSBLOCK_BTULTRA2 NULL 70 #endif 71 72 #endif /* ZSTD_OPT_H */ 73