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

Method createAndInitModelsAndCompressors

src/laswriteitemcompressed_v3.cpp:220–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220inline BOOL LASwriteItemCompressed_POINT14_v3::createAndInitModelsAndCompressors(U32 context, const U8* item)
221{
222 I32 i;
223
224 /* should only be called when context is unused */
225
226 assert(contexts[context].unused);
227
228 /* first create all entropy models and integer compressors (if needed) */
229
230 if (contexts[context].m_changed_values[0] == 0)
231 {
232 /* for the channel_returns_XY layer */
233
234 contexts[context].m_changed_values[0] = enc_channel_returns_XY->createSymbolModel(128);
235 contexts[context].m_changed_values[1] = enc_channel_returns_XY->createSymbolModel(128);
236 contexts[context].m_changed_values[2] = enc_channel_returns_XY->createSymbolModel(128);
237 contexts[context].m_changed_values[3] = enc_channel_returns_XY->createSymbolModel(128);
238 contexts[context].m_changed_values[4] = enc_channel_returns_XY->createSymbolModel(128);
239 contexts[context].m_changed_values[5] = enc_channel_returns_XY->createSymbolModel(128);
240 contexts[context].m_changed_values[6] = enc_channel_returns_XY->createSymbolModel(128);
241 contexts[context].m_changed_values[7] = enc_channel_returns_XY->createSymbolModel(128);
242 contexts[context].m_scanner_channel = enc_channel_returns_XY->createSymbolModel(3);
243 for (i = 0; i < 16; i++)
244 {
245 contexts[context].m_number_of_returns[i] = 0;
246 contexts[context].m_return_number[i] = 0;
247 }
248 contexts[context].m_return_number_gps_same = enc_channel_returns_XY->createSymbolModel(13);
249
250 contexts[context].ic_dX = new IntegerCompressor(enc_channel_returns_XY, 32, 2); // 32 bits, 2 context
251 contexts[context].ic_dY = new IntegerCompressor(enc_channel_returns_XY, 32, 22); // 32 bits, 22 contexts
252
253 /* for the Z layer */
254
255 contexts[context].ic_Z = new IntegerCompressor(enc_Z, 32, 20); // 32 bits, 20 contexts
256
257 /* for the classification layer */
258 /* for the flags layer */
259 /* for the user_data layer */
260
261 for (i = 0; i < 64; i++)
262 {
263 contexts[context].m_classification[i] = 0;
264 contexts[context].m_flags[i] = 0;
265 contexts[context].m_user_data[i] = 0;
266 }
267
268 /* for the intensity layer */
269
270 contexts[context].ic_intensity = new IntegerCompressor(enc_intensity, 16, 4);
271
272 /* for the scan_angle layer */
273
274 contexts[context].ic_scan_angle = new IntegerCompressor(enc_scan_angle, 16, 2);
275
276 /* for the point_source_ID layer */
277

Callers

nothing calls this directly

Calls 4

initCompressorMethod · 0.80
createSymbolModelMethod · 0.45
initSymbolModelMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected