~ubuntu-branches/ubuntu/trusty/advancecomp/trusty

« back to all changes in this revision

Viewing changes to 7z/LSBFDecoder.cc

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ozarowski
  • Date: 2006-05-13 21:15:49 UTC
  • Revision ID: james.westby@ubuntu.com-20060513211549-2vu7peis643ojcm5
Tags: upstream-1.15
ImportĀ upstreamĀ versionĀ 1.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "LSBFDecoder.h"
 
2
 
 
3
namespace NStream {
 
4
namespace NLSBF {
 
5
 
 
6
BYTE kInvertTable[256];
 
7
 
 
8
class CInverterTableInitializer
 
9
{
 
10
public:
 
11
  CInverterTableInitializer()
 
12
  {
 
13
    for(int i = 0; i < 256; i++)
 
14
    {
 
15
      BYTE aByte = BYTE(i);
 
16
      BYTE aByteInvert = 0;
 
17
      for(int j = 0; j < 8; j++)
 
18
      {
 
19
        aByteInvert <<= 1;
 
20
        if (aByte & 1)
 
21
          aByteInvert |= 1;
 
22
        aByte >>= 1;
 
23
      }
 
24
      kInvertTable[i] = aByteInvert;
 
25
    }
 
26
  }
 
27
} g_InverterTableInitializer;
 
28
 
 
29
 
 
30
}}