File: DeflateDecoder.h

package info (click to toggle)
apngasm 2.91-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,760 kB
  • sloc: ansic: 34,259; cpp: 7,258; makefile: 40
file content (41 lines) | stat: -rw-r--r-- 1,052 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __ARCHIVE_ZIP_DEFLATEDECODER_H
#define __ARCHIVE_ZIP_DEFLATEDECODER_H

#include "WindowOut.h"
#include "LSBFDecoder.h"
#include "InByte.h"
#include "HuffmanDecoder.h"
#include "Const.h"

namespace NDeflate{
namespace NDecoder{

typedef NStream::NLSBF::CDecoder<NStream::CInByte> CInBit;
typedef NCompression::NHuffman::CDecoder<kNumHuffmanBits> CHuffmanDecoder;

class CCoder
{
  NStream::NWindow::COut m_OutWindowStream;
  CInBit m_InBitStream;
  CHuffmanDecoder m_MainDecoder;
  CHuffmanDecoder m_DistDecoder;
  CHuffmanDecoder m_LevelDecoder; // table for decoding other tables;

  bool m_FinalBlock;
  bool m_StoredMode;
  UINT32 m_StoredBlockSize;

  void DeCodeLevelTable(BYTE *aNewLevels, int aNumLevels);
  void ReadTables();

  HRESULT CodeReal(ISequentialInStream *anInStream, ISequentialOutStream *anOutStream, const UINT64 *anInSize, const UINT64 *anOutSize);
  
public:
  CCoder();

  HRESULT Code(ISequentialInStream *anInStream, ISequentialOutStream *anOutStream, const UINT64 *anInSize, const UINT64 *anOutSize);
};

}}

#endif