1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-06 16:56:49 +02:00

Tweak Ultra/Opt Guards

This commit is contained in:
W. Felix Handte 2023-04-20 11:46:29 -04:00
parent 16bbd7437c
commit 6761e1c949

View File

@ -1350,21 +1350,26 @@ _shortestPath: /* cur, last_pos, best_mlen, best_off have to be set */
/* Return the last literals size */
return (size_t)(iend - anchor);
}
#endif /* build exclusions */
#ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR
static size_t ZSTD_compressBlock_opt0(
ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
const void* src, size_t srcSize, const ZSTD_dictMode_e dictMode)
{
return ZSTD_compressBlock_opt_generic(ms, seqStore, rep, src, srcSize, 0 /* optLevel */, dictMode);
}
#endif
#if !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR) \
|| !defined(ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR)
static size_t ZSTD_compressBlock_opt2(
ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
const void* src, size_t srcSize, const ZSTD_dictMode_e dictMode)
{
return ZSTD_compressBlock_opt_generic(ms, seqStore, rep, src, srcSize, 2 /* optLevel */, dictMode);
}
#endif /* build exclusions */
#endif
#ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR
size_t ZSTD_compressBlock_btopt(
@ -1379,8 +1384,7 @@ size_t ZSTD_compressBlock_btopt(
#if !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR) \
|| !defined(ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR)
#ifndef ZSTD_EXCLUDE_BTULTRA2_BLOCK_COMPRESSOR
/* ZSTD_initStats_ultra():
* make a first compression pass, just to seed stats with more accurate starting values.
* only works on first block, with no dictionary and no ldm.