other-licenses/7zstub/src/7zip/Common/LSBFDecoder.cpp

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:57e67f1d90e8
1 // Stream/LSBFDecoder.cpp
2
3 #include "StdAfx.h"
4
5 #include "LSBFDecoder.h"
6
7 namespace NStream {
8 namespace NLSBF {
9
10 Byte kInvertTable[256];
11
12 class CInverterTableInitializer
13 {
14 public:
15 CInverterTableInitializer()
16 {
17 for(int i = 0; i < 256; i++)
18 {
19 Byte b = Byte(i);
20 Byte bInvert = 0;
21 for(int j = 0; j < 8; j++)
22 {
23 bInvert <<= 1;
24 if (b & 1)
25 bInvert |= 1;
26 b >>= 1;
27 }
28 kInvertTable[i] = bInvert;
29 }
30 }
31 } g_InverterTableInitializer;
32
33
34 }}

mercurial