integercompressor.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: integercompressor.hpp
5 
6  CONTENTS:
7 
8  This compressor provides three different contexts for encoding integer
9  numbers whose range may lie anywhere between 1 and 31 bits, which is
10  specified with the SetPrecision function.
11 
12  The compressor encodes two things:
13 
14  (1) the number k of miss-predicted low-order bits and
15  (2) the k-bit number that corrects the missprediction
16 
17  The k-bit number is usually coded broken in two chunks. The highest
18  bits are compressed using an arithmetic range table. The lower bits
19  are stored raw without predicive coding. How many of the higher bits
20  are compressed can be specified with bits_high. The default is 8.
21 
22  PROGRAMMERS:
23 
24  martin.isenburg@gmail.com
25 
26  COPYRIGHT:
27 
28  (c) 2005-2011, Martin Isenburg, LASSO - tools to catch reality
29 
30  This is free software; you can redistribute and/or modify it under the
31  terms of the GNU Lesser General Licence as published by the Free Software
32  Foundation. See the COPYING file for more information.
33 
34  This software is distributed WITHOUT ANY WARRANTY and without even the
35  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 
37  CHANGE HISTORY:
38 
39  10 January 2011 -- licensing change for LGPL release and liblas integration
40  10 December 2010 -- unified for all entropy coders at Baeckerei Schaefer
41  31 October 2009 -- switched from the Rangecoder to the Entropycoder
42  30 September 2005 -- now splitting the corrector into raw and compressed bits
43  13 July 2005 -- created after returning with many mosquito bites from OBX
44 
45 ===============================================================================
46 */
47 #ifndef INTEGER_COMPRESSOR_HPP
48 #define INTEGER_COMPRESSOR_HPP
49 
50 #include "entropyencoder.hpp"
51 #include "entropydecoder.hpp"
52 
54 {
55 public:
56 
57  // Constructor & Deconstructor
61 
62  // Manage Compressor
63  void initCompressor();
64  void compress(I32 iPred, I32 iReal, U32 context=0);
65 
66  // Manage Decompressor
67  void initDecompressor();
68  I32 decompress(I32 iPred, U32 context=0);
69 
70  // Get the k corrector bits from the last compress/decompress call
71  U32 getK() const {return k;};
72 
73 private:
74  void writeCorrector(I32 c, EntropyModel* model);
75  I32 readCorrector(EntropyModel* model);
76 
77  U32 k;
78 
81 
84 
89 
92 
93  EntropyModel** mBits;
94 
95  EntropyModel** mCorrector;
96 
98 };
99 
100 #endif
I32 decompress(I32 iPred, U32 context=0)
EntropyModel ** mBits
unsigned int U32
Definition: mydefs.hpp:39
EntropyDecoder * dec
EntropyModel ** mCorrector
IntegerCompressor(EntropyEncoder *enc, U32 bits=16, U32 contexts=1, U32 bits_high=8, U32 range=0)
I32 readCorrector(EntropyModel *model)
int I32
Definition: mydefs.hpp:35
void writeCorrector(I32 c, EntropyModel *model)
EntropyEncoder * enc
void compress(I32 iPred, I32 iReal, U32 context=0)


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06