diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2009-10-30 18:16:09 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2009-10-30 18:16:09 +0000 |
commit | 20d626572bf95cd20bfeec98e81a74a2b40366b8 (patch) | |
tree | 10202e31c07d52a43d0a4d37ce45aba3579e120c /payloads/bayou/util/pbuilder/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h | |
parent | 9ac9e94b452b5ac58b6f7c44f1356b8e212ffcec (diff) | |
download | coreboot-20d626572bf95cd20bfeec98e81a74a2b40366b8.tar.xz |
drop svn:externals in the tree and add it locally.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4898 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/bayou/util/pbuilder/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h')
-rw-r--r-- | payloads/bayou/util/pbuilder/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/payloads/bayou/util/pbuilder/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h b/payloads/bayou/util/pbuilder/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h new file mode 100644 index 0000000000..829fc83d77 --- /dev/null +++ b/payloads/bayou/util/pbuilder/lzma/C/7zip/Compress/RangeCoder/RangeCoderOpt.h @@ -0,0 +1,31 @@ +// Compress/RangeCoder/RangeCoderOpt.h
+
+#ifndef __COMPRESS_RANGECODER_OPT_H
+#define __COMPRESS_RANGECODER_OPT_H
+
+#define RC_INIT_VAR \
+ UInt32 range = rangeDecoder->Range; \
+ UInt32 code = rangeDecoder->Code;
+
+#define RC_FLUSH_VAR \
+ rangeDecoder->Range = range; \
+ rangeDecoder->Code = code;
+
+#define RC_NORMALIZE \
+ if (range < NCompress::NRangeCoder::kTopValue) \
+ { code = (code << 8) | rangeDecoder->Stream.ReadByte(); range <<= 8; }
+
+#define RC_GETBIT2(numMoveBits, prob, mi, A0, A1) \
+ { UInt32 bound = (range >> NCompress::NRangeCoder::kNumBitModelTotalBits) * prob; \
+ if (code < bound) \
+ { A0; range = bound; \
+ prob += (NCompress::NRangeCoder::kBitModelTotal - prob) >> numMoveBits; \
+ mi <<= 1; } \
+ else \
+ { A1; range -= bound; code -= bound; prob -= (prob) >> numMoveBits; \
+ mi = (mi + mi) + 1; }} \
+ RC_NORMALIZE
+
+#define RC_GETBIT(numMoveBits, prob, mi) RC_GETBIT2(numMoveBits, prob, mi, ; , ;)
+
+#endif
|