unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

compress.hpp
Go to the documentation of this file.
1#ifndef _RAR_COMPRESS_
2#define _RAR_COMPRESS_
3
4// Combine pack and unpack constants to class to avoid polluting global
5// namespace with numerous short names.
6class PackDef
7{
8 public:
9 // Maximum LZ match length we can encode even for short distances.
10 static const uint MAX_LZ_MATCH = 0x1001;
11
12 // We increment LZ match length for longer distances, because shortest
13 // matches are not allowed for them. Maximum length increment is 3
14 // for distances larger than 256KB (0x40000). Here we define the maximum
15 // incremented LZ match. Normally packer does not use it, but we must be
16 // ready to process it in corrupt archives.
18
19 static const uint MAX3_LZ_MATCH = 0x101; // Maximum match length for RAR v3.
20 static const uint LOW_DIST_REP_COUNT = 16;
21
22 static const uint NC = 306; /* alphabet = {0, 1, 2, ..., NC - 1} */
23 static const uint DC = 64;
24 static const uint LDC = 16;
25 static const uint RC = 44;
26 static const uint HUFF_TABLE_SIZE = NC + DC + RC + LDC;
27 static const uint BC = 20;
28
29 static const uint NC30 = 299; /* alphabet = {0, 1, 2, ..., NC - 1} */
30 static const uint DC30 = 60;
31 static const uint LDC30 = 17;
32 static const uint RC30 = 28;
33 static const uint BC30 = 20;
34 static const uint HUFF_TABLE_SIZE30 = NC30 + DC30 + RC30 + LDC30;
35
36 static const uint NC20 = 298; /* alphabet = {0, 1, 2, ..., NC - 1} */
37 static const uint DC20 = 48;
38 static const uint RC20 = 28;
39 static const uint BC20 = 19;
40 static const uint MC20 = 257;
41
42 // Largest alphabet size among all values listed above.
43 static const uint LARGEST_TABLE_SIZE = 306;
44
45 enum {
48 };
49};
50
51
53 // These values must not be changed, because we use them directly
54 // in RAR5 compression and decompression code.
57};
58
59#endif
static const uint DC
Definition: compress.hpp:23
static const uint LOW_DIST_REP_COUNT
Definition: compress.hpp:20
static const uint LARGEST_TABLE_SIZE
Definition: compress.hpp:43
static const uint DC30
Definition: compress.hpp:30
static const uint NC
Definition: compress.hpp:22
static const uint MC20
Definition: compress.hpp:40
static const uint BC30
Definition: compress.hpp:33
static const uint NC20
Definition: compress.hpp:36
static const uint LDC
Definition: compress.hpp:24
static const uint NC30
Definition: compress.hpp:29
static const uint DC20
Definition: compress.hpp:37
static const uint MAX_INC_LZ_MATCH
Definition: compress.hpp:17
@ CODE_CACHELZ
Definition: compress.hpp:46
@ CODE_ENDFILE
Definition: compress.hpp:47
@ CODE_FILTERDATA
Definition: compress.hpp:47
@ CODE_LZ
Definition: compress.hpp:46
@ CODE_REPEATLZ
Definition: compress.hpp:46
@ CODE_FILTER
Definition: compress.hpp:47
@ CODE_HUFFMAN
Definition: compress.hpp:46
@ CODE_STARTFILE
Definition: compress.hpp:46
static const uint LDC30
Definition: compress.hpp:31
static const uint MAX_LZ_MATCH
Definition: compress.hpp:10
static const uint HUFF_TABLE_SIZE
Definition: compress.hpp:26
static const uint HUFF_TABLE_SIZE30
Definition: compress.hpp:34
static const uint RC30
Definition: compress.hpp:32
static const uint RC20
Definition: compress.hpp:38
static const uint BC
Definition: compress.hpp:27
static const uint BC20
Definition: compress.hpp:39
static const uint MAX3_LZ_MATCH
Definition: compress.hpp:19
static const uint RC
Definition: compress.hpp:25
FilterType
Definition: compress.hpp:52
@ FILTER_E8
Definition: compress.hpp:55
@ FILTER_NONE
Definition: compress.hpp:56
@ FILTER_E8E9
Definition: compress.hpp:55
@ FILTER_AUDIO
Definition: compress.hpp:56
@ FILTER_PPM
Definition: compress.hpp:56
@ FILTER_DELTA
Definition: compress.hpp:55
@ FILTER_ITANIUM
Definition: compress.hpp:56
@ FILTER_RGB
Definition: compress.hpp:56
@ FILTER_ARM
Definition: compress.hpp:55
unsigned int uint
Definition: rartypes.hpp:8