Path: blob/master/Utilities/cmzstd/lib/compress/zstd_compress_sequences.h
5025 views
/*1* Copyright (c) Meta Platforms, Inc. and affiliates.2* All rights reserved.3*4* This source code is licensed under both the BSD-style license (found in the5* LICENSE file in the root directory of this source tree) and the GPLv2 (found6* in the COPYING file in the root directory of this source tree).7* You may select, at your option, one of the above-listed licenses.8*/910#ifndef ZSTD_COMPRESS_SEQUENCES_H11#define ZSTD_COMPRESS_SEQUENCES_H1213#include "zstd_compress_internal.h" /* SeqDef */14#include "../common/fse.h" /* FSE_repeat, FSE_CTable */15#include "../common/zstd_internal.h" /* SymbolEncodingType_e, ZSTD_strategy */1617typedef enum {18ZSTD_defaultDisallowed = 0,19ZSTD_defaultAllowed = 120} ZSTD_DefaultPolicy_e;2122SymbolEncodingType_e23ZSTD_selectEncodingType(24FSE_repeat* repeatMode, unsigned const* count, unsigned const max,25size_t const mostFrequent, size_t nbSeq, unsigned const FSELog,26FSE_CTable const* prevCTable,27short const* defaultNorm, U32 defaultNormLog,28ZSTD_DefaultPolicy_e const isDefaultAllowed,29ZSTD_strategy const strategy);3031size_t32ZSTD_buildCTable(void* dst, size_t dstCapacity,33FSE_CTable* nextCTable, U32 FSELog, SymbolEncodingType_e type,34unsigned* count, U32 max,35const BYTE* codeTable, size_t nbSeq,36const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax,37const FSE_CTable* prevCTable, size_t prevCTableSize,38void* entropyWorkspace, size_t entropyWorkspaceSize);3940size_t ZSTD_encodeSequences(41void* dst, size_t dstCapacity,42FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable,43FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable,44FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable,45SeqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2);4647size_t ZSTD_fseBitCost(48FSE_CTable const* ctable,49unsigned const* count,50unsigned const max);5152size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog,53unsigned const* count, unsigned const max);54#endif /* ZSTD_COMPRESS_SEQUENCES_H */555657