summaryrefslogtreecommitdiffstats
path: root/mpg123_artsplugin/mpg123/getbits.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /mpg123_artsplugin/mpg123/getbits.h
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'mpg123_artsplugin/mpg123/getbits.h')
-rw-r--r--mpg123_artsplugin/mpg123/getbits.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/mpg123_artsplugin/mpg123/getbits.h b/mpg123_artsplugin/mpg123/getbits.h
new file mode 100644
index 00000000..65e3e745
--- /dev/null
+++ b/mpg123_artsplugin/mpg123/getbits.h
@@ -0,0 +1,33 @@
+
+/* that's the same file as getits.c but with defines to
+ force inlining */
+
+static unsigned long rval;
+static unsigned char rval_uc;
+
+#define backbits(bitbuf,nob) ((void)( \
+ (*(bitbuf)).bitindex -= (nob), \
+ (*(bitbuf)).wordpointer += ((*(bitbuf)).bitindex>>3), \
+ (*(bitbuf)).bitindex &= 0x7 ))
+
+#define getbitoffset(bitbuf) ((-(*(bitbuf)).bitindex)&0x7)
+#define getbyte(bitbuf) (*(*(bitbuf)).wordpointer++)
+
+#define getbits(bitbuf,nob) ( \
+ rval = (*(bitbuf)).wordpointer[0], rval <<= 8, rval |= (*(bitbuf)).wordpointer[1], \
+ rval <<= 8, rval |= (*(bitbuf)).wordpointer[2], rval <<= (*(bitbuf)).bitindex, \
+ rval &= 0xffffff, (*(bitbuf)).bitindex += (nob), \
+ rval >>= (24-(nob)), (*(bitbuf)).wordpointer += ((*(bitbuf)).bitindex>>3), \
+ (*(bitbuf)).bitindex &= 7,rval)
+
+#define getbits_fast(bitbuf,nob) ( \
+ rval = (unsigned char) ((*(bitbuf)).wordpointer[0] << (*(bitbuf)).bitindex), \
+ rval |= ((unsigned long) (*(bitbuf)).wordpointer[1]<<(*(bitbuf)).bitindex)>>8, \
+ rval <<= (nob), rval >>= 8, \
+ (*(bitbuf)).bitindex += (nob), (*(bitbuf)).wordpointer += ((*(bitbuf)).bitindex>>3), \
+ (*(bitbuf)).bitindex &= 7, rval )
+
+#define get1bit(bitbuf) ( \
+ rval_uc = *(*(bitbuf)).wordpointer << (*(bitbuf)).bitindex, (*(bitbuf)).bitindex++, \
+ (*(bitbuf)).wordpointer += ((*(bitbuf)).bitindex>>3), (*(bitbuf)).bitindex &= 7, rval_uc>>7 )
+