From 8dbb65363ea5a8af922e854b3c111091363457fa Mon Sep 17 00:00:00 2001 From: x Date: Fri, 6 Jan 2017 18:10:03 +0100 Subject: [PATCH] BitUtil: Delta, ZigZag, NumBits, Floating Point,... --- bitutil.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bitutil.c b/bitutil.c index b834c9d..c070b24 100644 --- a/bitutil.c +++ b/bitutil.c @@ -96,6 +96,12 @@ unsigned bitdelta64(uint64_t *in, unsigned n, uint64_t *out, uint64_t start, uns return bsr64(b); } +unsigned bitdelta16(unsigned short *in, unsigned n, unsigned short *out, unsigned short start, unsigned inc) { + typeof(in[0]) b = 0,*op = out; + BITDELTA(in, n, inc, start, b |= _x; *op++ = _x); + return bsr16(b); +} + unsigned bit32(unsigned *in, unsigned n) { typeof(in[0]) b; BITSIZE32(in, n, b);