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

Method writeBits

src/arithmeticencoder.cpp:257–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void ArithmeticEncoder::writeBits(U32 bits, U32 sym)
258{
259 assert(bits && (bits <= 32) && (sym < (1u<<bits)));
260
261 if (bits > 19)
262 {
263 writeShort(sym&U16_MAX);
264 sym = sym >> 16;
265 bits = bits - 16;
266 }
267
268 U32 init_base = base;
269 base += sym * (length >>= bits); // new interval base and length
270
271 if (init_base > base) propagate_carry(); // overflow = carry
272 if (length < AC__MinLength) renorm_enc_interval(); // renormalization
273}
274
275void ArithmeticEncoder::writeByte(U8 sym)
276{

Callers 1

writeCorrectorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected