From 549ef1b03e9811018054aacf949f102ae02aea5e Mon Sep 17 00:00:00 2001 From: powturbo Date: Thu, 28 May 2015 16:35:16 +0200 Subject: [PATCH] . --- bitunpack.h | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/bitunpack.h b/bitunpack.h index bc572ff..501b8fb 100644 --- a/bitunpack.h +++ b/bitunpack.h @@ -1,7 +1,7 @@ /** - Copyright (C) powturbo 2013-2014 + Copyright (C) powturbo 2013-2015 GPL v2 License - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -16,23 +16,25 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - email : powturbo [AT] gmail.com - - github : https://github.com/powturbo - homepage : https://sites.google.com/site/powturbo/ + - github : https://github.com/powturbo - twitter : https://twitter.com/powturbo - - bitunpack.h - "Integer Compression" Binary Packing + - email : powturbo [_AT_] gmail [_DOT_] com **/ +// bitunpack.h - "Integer Compression" Binary Packing + #ifdef __cplusplus extern "C" { #endif +#include "conf.h" + // ---------------- Unpack a bit packed integer array -------------------------------------------------------------------------------------- // unpack a bitpacked integer array. Return value = end of packed buffer in -unsigned char *bitunpack32(unsigned char *__restrict in, unsigned n, unsigned b, unsigned *__restrict out); +unsigned char *bitunpack32(unsigned char *__restrict in, unsigned n, unsigned *__restrict out, unsigned b); // like bitunpack32 but for 16 bits integer array -unsigned char *bitunpack16(unsigned char *__restrict in, unsigned n, unsigned b, unsigned short *__restrict out); +unsigned char *bitunpack16(unsigned char *__restrict in, unsigned n, unsigned short *__restrict out, unsigned b); // ---------------- Direct Access to a single packed integer array entry -------------------------------------------------------------------- #ifdef __AVX2__ @@ -55,24 +57,31 @@ static ALWAYS_INLINE void bitsetx32(unsigned char *__restrict in, unsigned static ALWAYS_INLINE void bitsetx16(unsigned char *__restrict in, unsigned b, unsigned idx, unsigned v) { unsigned bidx = b*idx; unsigned *p = (unsigned *) in+(bidx>>4) ; *p = ( *p & ~(((1u <