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

Method initDecompressor

src/integercompressor.cpp:275–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void IntegerCompressor::initDecompressor()
276{
277 U32 i;
278
279 assert(dec);
280
281 // maybe create the models
282 if (mBits == 0)
283 {
284 mBits = new ArithmeticModel*[contexts];
285 for (i = 0; i < contexts; i++)
286 {
287 mBits[i] = dec->createSymbolModel(corr_bits+1);
288 }
289#ifndef COMPRESS_ONLY_K
290 mCorrector = new ArithmeticModel*[corr_bits+1];
291 mCorrector[0] = (ArithmeticModel*)dec->createBitModel();
292 for (i = 1; i <= corr_bits; i++)
293 {
294 if (i <= bits_high)
295 {
296 mCorrector[i] = dec->createSymbolModel(1<<i);
297 }
298 else
299 {
300 mCorrector[i] = dec->createSymbolModel(1<<bits_high);
301 }
302 }
303#endif
304 }
305
306 // certainly init the models
307 for (i = 0; i < contexts; i++)
308 {
309 dec->initSymbolModel(mBits[i]);
310 }
311#ifndef COMPRESS_ONLY_K
312 dec->initBitModel((ArithmeticBitModel*)mCorrector[0]);
313 for (i = 1; i <= corr_bits; i++)
314 {
315 dec->initSymbolModel(mCorrector[i]);
316 }
317#endif
318}
319
320I32 IntegerCompressor::decompress(I32 pred, U32 context)
321{

Callers 5

read_chunk_tableMethod · 0.80
initMethod · 0.80
initMethod · 0.80

Calls 4

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

Tested by

no test coverage detected