arithmeticmodel.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: arithmeticmodel.hpp
5 
6  CONTENTS:
7 
8  A modular C++ wrapper for an adapted version of Amir Said's FastAC Code.
9  see: http://www.cipr.rpi.edu/~said/FastAC.html
10 
11  PROGRAMMERS:
12 
13  martin.isenburg@gmail.com
14 
15  COPYRIGHT:
16 
17  (c) 2009-2011, Martin Isenburg, LASSO - tools to catch reality
18 
19  This is free software; you can redistribute and/or modify it under the
20  terms of the GNU Lesser General Licence as published by the Free Software
21  Foundation. See the COPYING file for more information.
22 
23  This software is distributed WITHOUT ANY WARRANTY and without even the
24  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 
26  CHANGE HISTORY:
27 
28  10 January 2011 -- licensing change for LGPL release and liblas integration
29  8 December 2010 -- unified framework for all entropy coders
30  30 October 2009 -- refactoring Amir Said's FastAC code
31 
32 ===============================================================================
33 */
34 #ifndef ARITHMETIC_MODEL_H
35 #define ARITHMETIC_MODEL_H
36 
37 #include <stdio.h>
38 #include <stdlib.h>
39 
40 #include "mydefs.hpp"
41 
42 /* this header byte needs to change in case incompatible change happen */
43 #define AC_HEADER_BYTE 2
44 #define AC_BUFFER_SIZE 1024
45 
46 const U32 AC__MinLength = 0x01000000U; // threshold for renormalization
47 const U32 AC__MaxLength = 0xFFFFFFFFU; // maximum AC interval length
48 
49  // Maximum values for binary models
50 const U32 BM__LengthShift = 13; // length bits discarded before mult.
51 const U32 BM__MaxCount = 1 << BM__LengthShift; // for adaptive models
52 
53  // Maximum values for general models
54 const U32 DM__LengthShift = 15; // length bits discarded before mult.
55 const U32 DM__MaxCount = 1 << DM__LengthShift; // for adaptive models
56 
58 {
59 public:
62 
63  I32 init(U32* table=0);
64 
65 private:
66  void update();
71  friend class ArithmeticEncoder;
72  friend class ArithmeticDecoder;
73 };
74 
76 {
77 public:
80 
81  void init();
82 
83 private:
84  void update();
85  U32 update_cycle, bits_until_update;
86  U32 bit_0_prob, bit_0_count, bit_count;
87  friend class ArithmeticEncoder;
88  friend class ArithmeticDecoder;
89 };
90 
91 #endif
int BOOL
Definition: mydefs.hpp:57
I32 init(U32 *table=0)
const U32 BM__LengthShift
unsigned int U32
Definition: mydefs.hpp:39
int I32
Definition: mydefs.hpp:35
const U32 AC__MaxLength
const U32 AC__MinLength
const U32 DM__LengthShift
const U32 DM__MaxCount
const U32 BM__MaxCount
ArithmeticModel(U32 symbols, BOOL compress)


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