~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/7zip/Compress/ImplodeHuffmanDecoder.h

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ImplodeHuffmanDecoder.h
 
2
 
 
3
#ifndef __IMPLODE_HUFFMAN_DECODER_H
 
4
#define __IMPLODE_HUFFMAN_DECODER_H
 
5
 
 
6
#include "../Common/InBuffer.h"
 
7
 
 
8
#include "BitlDecoder.h"
 
9
 
 
10
namespace NCompress {
 
11
namespace NImplode {
 
12
namespace NHuffman {
 
13
 
 
14
const int kNumBitsInLongestCode = 16;
 
15
 
 
16
typedef NBitl::CDecoder<CInBuffer> CInBit;
 
17
 
 
18
class CDecoder
 
19
{
 
20
  UInt32 m_Limitits[kNumBitsInLongestCode + 2]; // m_Limitits[i] = value limit for symbols with length = i
 
21
  UInt32 m_Positions[kNumBitsInLongestCode + 2];   // m_Positions[i] = index in m_Symbols[] of first symbol with length = i
 
22
  UInt32 m_NumSymbols; // number of symbols in m_Symbols
 
23
  UInt32 *m_Symbols; // symbols: at first with len=1 then 2, ... 15.
 
24
public:
 
25
  CDecoder(UInt32 numSymbols);
 
26
  ~CDecoder();
 
27
  
 
28
  bool SetCodeLengths(const Byte *codeLengths);
 
29
  UInt32 DecodeSymbol(CInBit *inStream);
 
30
};
 
31
 
 
32
}}}
 
33
 
 
34
#endif