contrib/python-zstandard/zstd/compress/zstd_compress_sequences.h
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 10 Dec 2022 14:44:46 -0500
changeset 49795 f1e820cda2f5
parent 43994 de7838053207
permissions -rw-r--r--
typing: add type hints related to message output in mercurial/ui.py This will shake loose some bytes vs str issues in the doc checker.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42937
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
/*
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
 * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
 * All rights reserved.
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
 *
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
 * This source code is licensed under both the BSD-style license (found in the
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
 * in the COPYING file in the root directory of this source tree).
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
 * You may select, at your option, one of the above-listed licenses.
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
 */
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
#ifndef ZSTD_COMPRESS_SEQUENCES_H
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
#define ZSTD_COMPRESS_SEQUENCES_H
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
#include "fse.h" /* FSE_repeat, FSE_CTable */
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
#include "zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
typedef enum {
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
    ZSTD_defaultDisallowed = 0,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
    ZSTD_defaultAllowed = 1
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
} ZSTD_defaultPolicy_e;
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
symbolEncodingType_e
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
ZSTD_selectEncodingType(
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
        FSE_repeat* repeatMode, unsigned const* count, unsigned const max,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
        size_t const mostFrequent, size_t nbSeq, unsigned const FSELog,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
        FSE_CTable const* prevCTable,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
        short const* defaultNorm, U32 defaultNormLog,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
        ZSTD_defaultPolicy_e const isDefaultAllowed,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
        ZSTD_strategy const strategy);
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
size_t
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
ZSTD_buildCTable(void* dst, size_t dstCapacity,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
                FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
                unsigned* count, U32 max,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
                const BYTE* codeTable, size_t nbSeq,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
                const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
                const FSE_CTable* prevCTable, size_t prevCTableSize,
43994
de7838053207 zstandard: vendor python-zstandard 0.13.0
Gregory Szorc <gregory.szorc@gmail.com>
parents: 42937
diff changeset
    38
                void* entropyWorkspace, size_t entropyWorkspaceSize);
42937
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
size_t ZSTD_encodeSequences(
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
            void* dst, size_t dstCapacity,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
            FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
            FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
            FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable,
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
            seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2);
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
69de49c4e39c zstandard: vendor python-zstandard 0.12
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
#endif /* ZSTD_COMPRESS_SEQUENCES_H */