Parolin
0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
val
xcx_xz
xz-5.6.2
xz-5.6.2
src
liblzma
rangecoder
range_common.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: 0BSD
2
4
//
8
// Authors: Igor Pavlov
9
// Lasse Collin
10
//
12
13
#ifndef LZMA_RANGE_COMMON_H
14
#define LZMA_RANGE_COMMON_H
15
16
// Skip common.h if building price_tablegen.c.
17
#ifndef BUILDING_PRICE_TABLEGEN
18
# include "common.h"
19
#endif
20
21
23
// Constants //
25
26
#define RC_SHIFT_BITS 8
27
#define RC_TOP_BITS 24
28
#define RC_TOP_VALUE (UINT32_C(1) << RC_TOP_BITS)
29
#define RC_BIT_MODEL_TOTAL_BITS 11
30
#define RC_BIT_MODEL_TOTAL (UINT32_C(1) << RC_BIT_MODEL_TOTAL_BITS)
31
#define RC_MOVE_BITS 5
32
33
35
// Macros //
37
38
// Resets the probability so that both 0 and 1 have probability of 50 %
39
#define bit_reset(prob) \
40
prob = RC_BIT_MODEL_TOTAL >> 1
41
42
// This does the same for a complete bit tree.
43
// (A tree represented as an array.)
44
#define bittree_reset(probs, bit_levels) \
45
for (uint32_t bt_i = 0; bt_i < (1 << (bit_levels)); ++bt_i) \
46
bit_reset((probs)[bt_i])
47
48
50
// Type definitions //
52
75
typedef
uint16_t
probability
;
76
77
#endif
probability
uint16_t probability
Type of probabilities used with range coder.
Definition
range_common.h:69
Generated by
1.12.0