File: DecodeBuffer.H

package info (click to toggle)
dxpc 3.8.0-1
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 672 kB
  • ctags: 780
  • sloc: cpp: 10,145; sh: 173; makefile: 88
file content (38 lines) | stat: -rw-r--r-- 1,016 bytes parent folder | download | duplicates (3)
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
#ifndef DecodeBuffer_H
#define DecodeBuffer_H

class IntCache;
class CharCache;
class PixelCache;
class HuffmanCoder;


class DecodeBuffer
{
  public:
  DecodeBuffer(const unsigned char *data, unsigned int length);
   ~DecodeBuffer()
  {
  }

  int decodeValue(unsigned int &value, unsigned int numBits,
		  unsigned int blockSize = 0, int endOkay = 0);
  int decodeCachedValue(unsigned int &value, unsigned int numBits,
			IntCache & cache, unsigned int blockSize = 0,
			int endOkay = 0);
  int decodeCachedValue(unsigned char &value, unsigned int numBits,
			CharCache & cache, unsigned int blockSize = 0,
			int endOkay = 0);
  int decodeCachedValue(unsigned int &value, unsigned int numBits,
			PixelCache & cache, HuffmanCoder & escapeCoder0,
			HuffmanCoder & escapeCoder1, int endOkay = 0);

  const unsigned char *decodeRawMem(unsigned int len);
private:
  const unsigned char *buffer_;
  const unsigned char *end_;
  const unsigned char *nextSrc_;
  unsigned char srcMask_;
};

#endif /* DecodeBuffer_H */