arithmeticencoder.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: arithmeticencoder.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_ENCODER_H
35 #define ARITHMETIC_ENCODER_H
36 
37 #include "entropyencoder.hpp"
38 
40 {
41 public:
42 
43 /* Constructor & Destructor */
46 
47 /* Manage encoding */
49  void done();
50 
51 /* Manage an entropy model for a single bit */
52  EntropyModel* createBitModel();
53  void initBitModel(EntropyModel* model);
54  void destroyBitModel(EntropyModel* model);
55 
56 /* Manage an entropy model for n symbols (table optional) */
57  EntropyModel* createSymbolModel(U32 n);
58  void initSymbolModel(EntropyModel* model, U32 *table=0);
59  void destroySymbolModel(EntropyModel* model);
60 
61 /* Encode a bit with modelling */
62  void encodeBit(EntropyModel* model, U32 sym);
63 
64 /* Encode a symbol with modelling */
65  void encodeSymbol(EntropyModel* model, U32 sym);
66 
67 /* Encode a bit without modelling */
68  void writeBit(U32 sym);
69 
70 /* Encode bits without modelling */
71  void writeBits(U32 bits, U32 sym);
72 
73 /* Encode an unsigned char without modelling */
74  void writeByte(U8 sym);
75 
76 /* Encode an unsigned short without modelling */
77  void writeShort(U16 sym);
78 
79 /* Encode an unsigned int without modelling */
80  void writeInt(U32 sym);
81 
82 /* Encode a float without modelling */
83  void writeFloat(F32 sym);
84 
85 /* Encode an unsigned 64 bit int without modelling */
86  void writeInt64(U64 sym);
87 
88 /* Encode a double without modelling */
89  void writeDouble(F64 sym);
90 
91 private:
92 
94 
95  void propagate_carry();
96  void renorm_enc_interval();
97  void manage_outbuffer();
103 };
104 
105 #endif
int BOOL
Definition: mydefs.hpp:57
void writeBits(U32 bits, U32 sym)
float F32
Definition: mydefs.hpp:51
void initBitModel(EntropyModel *model)
unsigned int U32
Definition: mydefs.hpp:39
void destroySymbolModel(EntropyModel *model)
BOOL init(ByteStreamOut *outstream)
EntropyModel * createSymbolModel(U32 n)
unsigned short U16
Definition: mydefs.hpp:40
void encodeSymbol(EntropyModel *model, U32 sym)
void initSymbolModel(EntropyModel *model, U32 *table=0)
unsigned char U8
Definition: mydefs.hpp:41
void writeShort(U16 sym)
void destroyBitModel(EntropyModel *model)
void writeInt64(U64 sym)
void writeFloat(F32 sym)
void encodeBit(EntropyModel *model, U32 sym)
ByteStreamOut * outstream
void writeDouble(F64 sym)
unsigned long long U64
Definition: mydefs.hpp:47
EntropyModel * createBitModel()
double F64
Definition: mydefs.hpp:52


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