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

Method RangeModel

LASzip/unused/rangemodel.cpp:58–84  ·  view source on GitHub ↗

initialisation of model */ n number of symbols in that model */ compress set to 1 on compression, 0 on decompression */ targetrescale desired rescaling interval, should be < 1<<(lg_totf+1) */ lg_totf base2 log of total frequency count */

Source from the content-addressed store, hash-verified

56/* targetrescale desired rescaling interval, should be < 1<<(lg_totf+1) */
57/* lg_totf base2 log of total frequency count */
58RangeModel::RangeModel(U32 n, BOOL compress, I32 targetrescale, I32 lg_totf)
59{
60 this->n = n;
61 this->targetrescale = targetrescale;
62 this->lg_totf = lg_totf;
63 cf = new U16[n+1];
64 newf = new U16[n+1];
65 if (lg_totf == 16)
66 {
67 cf[n] = 65535;
68 }
69 else
70 {
71 cf[n] = (1<<lg_totf);
72 }
73 cf[0] = 0;
74 if (compress)
75 {
76 search = NULL;
77 }
78 else
79 {
80 searchshift = lg_totf - TBLSHIFT;
81 search = new U16[(1<<TBLSHIFT)+1];
82 search[1<<TBLSHIFT] = n-1;
83 }
84}
85
86/* deletion */
87RangeModel::~RangeModel()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected