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
ArithmeticEncoder::writeInt
void writeInt(U32 sym)
Definition: arithmeticencoder.cpp:269
ArithmeticEncoder::endbyte
U8 * endbyte
Definition: arithmeticencoder.hpp:101
ArithmeticEncoder::init
BOOL init(ByteStreamOut *outstream)
Definition: arithmeticencoder.cpp:94
ArithmeticEncoder::base
U32 base
Definition: arithmeticencoder.hpp:102
ArithmeticEncoder::value
U32 value
Definition: arithmeticencoder.hpp:102
F64
double F64
Definition: mydefs.hpp:52
ArithmeticEncoder::length
U32 length
Definition: arithmeticencoder.hpp:102
ArithmeticEncoder::initBitModel
void initBitModel(EntropyModel *model)
Definition: arithmeticencoder.cpp:145
ArithmeticEncoder::encodeSymbol
void encodeSymbol(EntropyModel *model, U32 sym)
Definition: arithmeticencoder.cpp:197
ArithmeticEncoder::writeByte
void writeByte(U8 sym)
Definition: arithmeticencoder.cpp:251
ArithmeticEncoder::writeBits
void writeBits(U32 bits, U32 sym)
Definition: arithmeticencoder.cpp:233
ArithmeticEncoder::createSymbolModel
EntropyModel * createSymbolModel(U32 n)
Definition: arithmeticencoder.cpp:157
ArithmeticEncoder::~ArithmeticEncoder
~ArithmeticEncoder()
Definition: arithmeticencoder.cpp:89
entropyencoder.hpp
ArithmeticEncoder::done
void done()
Definition: arithmeticencoder.cpp:105
ArithmeticEncoder::endbuffer
U8 * endbuffer
Definition: arithmeticencoder.hpp:99
ArithmeticEncoder::destroySymbolModel
void destroySymbolModel(EntropyModel *model)
Definition: arithmeticencoder.cpp:169
ByteStreamOut
Definition: bytestreamout.hpp:36
ArithmeticEncoder::destroyBitModel
void destroyBitModel(EntropyModel *model)
Definition: arithmeticencoder.cpp:151
ArithmeticEncoder
Definition: arithmeticencoder.hpp:39
ArithmeticEncoder::ArithmeticEncoder
ArithmeticEncoder()
Definition: arithmeticencoder.cpp:81
ArithmeticEncoder::writeShort
void writeShort(U16 sym)
Definition: arithmeticencoder.cpp:260
ArithmeticEncoder::renorm_enc_interval
void renorm_enc_interval()
Definition: arithmeticencoder.cpp:316
ArithmeticEncoder::propagate_carry
void propagate_carry()
Definition: arithmeticencoder.cpp:295
ArithmeticEncoder::initSymbolModel
void initSymbolModel(EntropyModel *model, U32 *table=0)
Definition: arithmeticencoder.cpp:163
U16
unsigned short U16
Definition: mydefs.hpp:40
ArithmeticEncoder::outstream
ByteStreamOut * outstream
Definition: arithmeticencoder.hpp:93
ArithmeticEncoder::writeBit
void writeBit(U32 sym)
Definition: arithmeticencoder.cpp:222
ArithmeticEncoder::manage_outbuffer
void manage_outbuffer()
Definition: arithmeticencoder.cpp:328
ArithmeticEncoder::writeFloat
void writeFloat(F32 sym)
Definition: arithmeticencoder.cpp:275
U8
unsigned char U8
Definition: mydefs.hpp:41
BOOL
int BOOL
Definition: mydefs.hpp:57
U64
unsigned long long U64
Definition: mydefs.hpp:47
ArithmeticEncoder::writeInt64
void writeInt64(U64 sym)
Definition: arithmeticencoder.cpp:282
F32
float F32
Definition: mydefs.hpp:51
ArithmeticEncoder::encodeBit
void encodeBit(EntropyModel *model, U32 sym)
Definition: arithmeticencoder.cpp:175
ArithmeticEncoder::outbuffer
U8 * outbuffer
Definition: arithmeticencoder.hpp:98
ArithmeticEncoder::outbyte
U8 * outbyte
Definition: arithmeticencoder.hpp:100
U32
unsigned int U32
Definition: mydefs.hpp:39
ArithmeticEncoder::createBitModel
EntropyModel * createBitModel()
Definition: arithmeticencoder.cpp:139
EntropyEncoder
Definition: entropyencoder.hpp:38
ArithmeticEncoder::writeDouble
void writeDouble(F64 sym)
Definition: arithmeticencoder.cpp:288


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 Wed Mar 2 2022 00:37:22