src/slz.c
/* enqueue code x of <xbits> bits (LSB aligned, at most 16) and copy complete
 * bytes into out buf. X must not contain non-zero bits above xbits. Prefer
 * enqueue8() when xbits is known for being 8 or less.
 */
enqueue code x of  bits (LSB aligned, at most 16) and copy complete
bytes into out buf. X must not contain non-zero bits above xbits. Prefer
enqueue8() when xbits is known for being 8 or less.
enqueue code x of bits ( LSB aligned at most 16 ) and copy complete bytes into out buf . X must not contain non - zero bits above xbits . Prefer enqueue8 () when xbits is known for being 8 or less .
static void enqueue16(struct slz_stream *strm, uint32_t x, uint32_t xbits)
{
	uint32_t queue = strm->queue + (x << strm->qbits);
	uint32_t qbits = strm->qbits + xbits;
	if (__builtin_expect(qbits < 16, 1)) {
		if (qbits >= 8) {
			qbits -= 8;
			*strm->outbuf++ = queue;
			queue >>= 8;
		}
		strm->qbits = qbits;
		strm->queue = queue;
		return;
	}
#ifndef UNALIGNED_LE_OK
	strm->outbuf[0] = queue;
	strm->outbuf[1] = queue >> 8;
#else
	*(uint16_t *)strm->outbuf = queue;
#endif
	strm->outbuf += 2;
	queue >>= 16;
	qbits -= 16;
	strm->qbits = qbits;
	strm->queue = queue;
}
static void enqueue16 ( struct slz_stream * strm , uint32_t x , uint32_t xbits ) { uint32_t queue = strm -> queue + ( x << strm -> qbits ) ; uint32_t qbits = strm -> qbits + xbits ; if ( __builtin_expect ( qbits < 16 , 1 ) ) { if ( qbits >= 8 ) { qbits -= 8 ; * strm -> outbuf ++ = queue ; queue >>= 8 ; } strm -> qbits = qbits ; strm -> queue = queue ; return ; } #ifndef UNALIGNED_LE_OK strm -> outbuf [ 0 ] = queue ; strm -> outbuf [ 1 ] = queue >> 8 ; #else * ( uint16_t * ) strm -> outbuf = queue ; #endif strm -> outbuf += 2 ; queue >>= 16 ; qbits -= 16 ; strm -> qbits = qbits ; strm -> queue = queue ; }
enqueue code x of <xbits> bits (LSB aligned, at most 16) and copy complete
 bytes into out buf.
enqueue code x of <xbits > bits ( LSB aligned at most 16 ) and copy complete bytes into out buf .
/* usual case */ /* case where we queue large codes after small ones, eg: 7 then 9 */