Imported Upstream version 9.20
[platform/upstream/7zip.git] / CPP / 7zip / Compress / BitlDecoder.cpp
1 // BitlDecoder.cpp\r
2 \r
3 #include "StdAfx.h"\r
4 \r
5 #include "BitlDecoder.h"\r
6 \r
7 namespace NBitl {\r
8 \r
9 Byte kInvertTable[256];\r
10 \r
11 struct CInverterTableInitializer\r
12 {\r
13   CInverterTableInitializer()\r
14   {\r
15     for (int i = 0; i < 256; i++)\r
16     {\r
17       int x = ((i & 0x55) << 1) | ((i & 0xAA) >> 1);\r
18       x = ((x & 0x33) << 2) | ((x & 0xCC) >> 2);\r
19       kInvertTable[i] = (Byte)(((x & 0x0F) << 4) | ((x & 0xF0) >> 4));\r
20     }\r
21   }\r
22 } g_InverterTableInitializer;\r
23 \r
24 }\r