MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / DecodeTable

Class DecodeTable

Libraries/unrar/unpack.hpp:31–70  ·  view source on GitHub ↗

Decode compressed bit fields to alphabet numbers.

Source from the content-addressed store, hash-verified

29
30// Decode compressed bit fields to alphabet numbers.
31struct DecodeTable:PackDef
32{
33 // Real size of DecodeNum table.
34 uint MaxNum;
35
36 // Left aligned start and upper limit codes defining code space
37 // ranges for bit lengths. DecodeLen[BitLength-1] defines the start of
38 // range for bit length and DecodeLen[BitLength] defines next code
39 // after the end of range or in other words the upper limit code
40 // for specified bit length.
41 uint DecodeLen[16];
42
43 // Every item of this array contains the sum of all preceding items.
44 // So it contains the start position in code list for every bit length.
45 uint DecodePos[16];
46
47 // Number of compressed bits processed in quick mode.
48 // Must not exceed MAX_QUICK_DECODE_BITS.
49 uint QuickBits;
50
51 // Translates compressed bits (up to QuickBits length)
52 // to bit length in quick mode.
53 byte QuickLen[1<<MAX_QUICK_DECODE_BITS];
54
55 // Translates compressed bits (up to QuickBits length)
56 // to position in alphabet in quick mode.
57 // 'ushort' saves some memory and even provides a little speed gain
58 // comparting to 'uint' here.
59 ushort QuickNum[1<<MAX_QUICK_DECODE_BITS];
60
61 // Translate the position in code list to position in alphabet.
62 // We do not allocate it dynamically to avoid performance overhead
63 // introduced by pointer, so we use the largest possible table size
64 // as array dimension. Real size of this array is defined in MaxNum.
65 // We use this array if compressed bit field is too lengthy
66 // for QuickLen based translation.
67 // 'ushort' saves some memory and even provides a little speed gain
68 // comparting to 'uint' here.
69 ushort DecodeNum[LARGEST_TABLE_SIZE];
70};
71
72
73struct UnpackBlockHeader

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected