MCPcopy Create free account
hub / github.com/LAStools/LAStools / initCompressor

Method initCompressor

LASzip/src/integercompressor.cpp:219–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void IntegerCompressor::initCompressor()
220{
221 U32 i;
222
223 assert(enc);
224
225 // maybe create the models
226 if (mBits == 0)
227 {
228 mBits = new ArithmeticModel*[contexts];
229 for (i = 0; i < contexts; i++)
230 {
231 mBits[i] = enc->createSymbolModel(corr_bits+1);
232 }
233#ifndef COMPRESS_ONLY_K
234 mCorrector = new ArithmeticModel*[corr_bits+1];
235 mCorrector[0] = (ArithmeticModel*)enc->createBitModel();
236 for (i = 1; i <= corr_bits; i++)
237 {
238 if (i <= bits_high)
239 {
240 mCorrector[i] = enc->createSymbolModel(1<<i);
241 }
242 else
243 {
244 mCorrector[i] = enc->createSymbolModel(1<<bits_high);
245 }
246 }
247#endif
248 }
249
250 // certainly init the models
251 for (i = 0; i < contexts; i++)
252 {
253 enc->initSymbolModel(mBits[i]);
254 }
255#ifndef COMPRESS_ONLY_K
256 enc->initBitModel((ArithmeticBitModel*)mCorrector[0]);
257 for (i = 1; i <= corr_bits; i++)
258 {
259 enc->initSymbolModel(mCorrector[i]);
260 }
261#endif
262}
263
264void IntegerCompressor::compress(I32 pred, I32 real, U32 context)
265{

Callers 6

initMethod · 0.80
initMethod · 0.80
write_chunk_tableMethod · 0.80
write_waveformMethod · 0.80

Calls 4

createSymbolModelMethod · 0.45
createBitModelMethod · 0.45
initSymbolModelMethod · 0.45
initBitModelMethod · 0.45

Tested by

no test coverage detected