MCPcopy Create free account
hub / github.com/LASzip/LASzip / IntegerCompressor

Class IntegerCompressor

src/integercompressor.hpp:54–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52#include "arithmeticdecoder.hpp"
53
54class IntegerCompressor
55{
56public:
57
58 // Constructor & Deconstructor
59 IntegerCompressor(ArithmeticEncoder* enc, U32 bits=16, U32 contexts=1, U32 bits_high=8, U32 range=0);
60 IntegerCompressor(ArithmeticDecoder* dec, U32 bits=16, U32 contexts=1, U32 bits_high=8, U32 range=0);
61 ~IntegerCompressor();
62
63 // Manage Compressor
64 void initCompressor();
65 void compress(I32 iPred, I32 iReal, U32 context=0);
66
67 // Manage Decompressor
68 void initDecompressor();
69 I32 decompress(I32 iPred, U32 context=0);
70
71 // Get the k corrector bits from the last compress/decompress call
72 U32 getK() const {return k;};
73
74private:
75 void writeCorrector(I32 c, ArithmeticModel* model);
76 I32 readCorrector(ArithmeticModel* model);
77
78 U32 k;
79
80 U32 contexts;
81 U32 bits_high;
82
83 U32 bits;
84 U32 range;
85
86 U32 corr_bits;
87 U32 corr_range;
88 I32 corr_min;
89 I32 corr_max;
90
91 ArithmeticEncoder* enc;
92 ArithmeticDecoder* dec;
93
94 ArithmeticModel** mBits;
95
96 ArithmeticModel** mCorrector;
97
98#ifdef CREATE_HISTOGRAMS
99 int** corr_histogram;
100#endif
101};
102
103#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected