Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Compress/RangeCoder/RangeCoderOpt.h
3 #ifndef __COMPRESS_RANGECODER_OPT_H
4 #define __COMPRESS_RANGECODER_OPT_H
6 #define RC_INIT_VAR \
7 UInt32 range = rangeDecoder->Range; \
8 UInt32 code = rangeDecoder->Code;
10 #define RC_FLUSH_VAR \
11 rangeDecoder->Range = range; \
12 rangeDecoder->Code = code;
14 #define RC_NORMALIZE \
15 if (range < NCompress::NRangeCoder::kTopValue) \
16 { code = (code << 8) | rangeDecoder->Stream.ReadByte(); range <<= 8; }
18 #define RC_GETBIT2(numMoveBits, prob, mi, A0, A1) \
19 { UInt32 bound = (range >> NCompress::NRangeCoder::kNumBitModelTotalBits) * prob; \
20 if (code < bound) \
21 { A0; range = bound; \
22 prob += (NCompress::NRangeCoder::kBitModelTotal - prob) >> numMoveBits; \
23 mi <<= 1; } \
24 else \
25 { A1; range -= bound; code -= bound; prob -= (prob) >> numMoveBits; \
26 mi = (mi + mi) + 1; }} \
27 RC_NORMALIZE
29 #define RC_GETBIT(numMoveBits, prob, mi) RC_GETBIT2(numMoveBits, prob, mi, ; , ;)
31 #endif