Path: blob/master/Utilities/cmzstd/lib/compress/zstd_compress_sequences.h
3158 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 "../common/fse.h" /* FSE_repeat, FSE_CTable */14#include "../common/zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */1516typedef enum {17ZSTD_defaultDisallowed = 0,18ZSTD_defaultAllowed = 119} ZSTD_defaultPolicy_e;2021symbolEncodingType_e22ZSTD_selectEncodingType(23FSE_repeat* repeatMode, unsigned const* count, unsigned const max,24size_t const mostFrequent, size_t nbSeq, unsigned const FSELog,25FSE_CTable const* prevCTable,26short const* defaultNorm, U32 defaultNormLog,27ZSTD_defaultPolicy_e const isDefaultAllowed,28ZSTD_strategy const strategy);2930size_t31ZSTD_buildCTable(void* dst, size_t dstCapacity,32FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type,33unsigned* count, U32 max,34const BYTE* codeTable, size_t nbSeq,35const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax,36const FSE_CTable* prevCTable, size_t prevCTableSize,37void* entropyWorkspace, size_t entropyWorkspaceSize);3839size_t ZSTD_encodeSequences(40void* dst, size_t dstCapacity,41FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable,42FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable,43FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable,44seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2);4546size_t ZSTD_fseBitCost(47FSE_CTable const* ctable,48unsigned const* count,49unsigned const max);5051size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog,52unsigned const* count, unsigned const max);53#endif /* ZSTD_COMPRESS_SEQUENCES_H */545556