Mercurial > hg
annotate contrib/python-zstandard/zstd/compress/zstd_compress_sequences.h @ 44413:4cabeea6d214
hgext: start building a library for simple hooks
Many workflows depend on hooks to enforce certain policies, e.g. to
prevent forced pushes. The Mercurial Guide includes some cases and
Google can help finding others, but it can save users a lot of time
if hg itself has a couple of examples for further customization.
Differential Revision: https://phab.mercurial-scm.org/D6825
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Sat, 07 Sep 2019 14:50:39 +0200 |
parents | de7838053207 |
children |
rev | line source |
---|---|
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 */ |