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

Method createAndInitModelsAndCompressors

src/laswriteitemcompressed_v4.cpp:217–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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