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

Method readBits

LASzip/src/arithmeticdecoder.cpp:252–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252U32 ArithmeticDecoder::readBits(U32 bits)
253{
254 assert(bits && (bits <= 32));
255
256 if (bits > 19)
257 {
258 U32 tmp = readShort();
259 bits = bits - 16;
260 U32 tmp1 = readBits(bits) << 16;
261 return (tmp1|tmp);
262 }
263
264 U32 sym = value / (length >>= bits);// decode symbol, change length
265 value -= length * sym; // update interval
266
267 if (length < AC__MinLength) renorm_dec_interval(); // renormalization
268
269 if (sym >= (1u<<bits))
270 {
271 throw 4711;
272 }
273
274 return sym;
275}
276
277U8 ArithmeticDecoder::readByte()
278{

Callers 1

readCorrectorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected