0
|
1
|
|
2 /*
|
|
3 * This does the same as getbits.c but with defines to
|
|
4 * force inlining
|
|
5 */
|
|
6
|
|
7 #define mpg123_backbits(nob) \
|
|
8 do { \
|
|
9 bsi.bitindex -= nob; \
|
|
10 bsi.wordpointer += (bsi.bitindex >> 3); \
|
|
11 bsi.bitindex &= 0x7; \
|
|
12 } while (0)
|
|
13
|
|
14 #define mpg123_getbitoffset() ((-bsi.bitindex) & 0x7)
|
|
15 #define mpg123_getbyte() (*bsi.wordpointer++)
|
|
16
|
|
17 #define mpg123_getbits(nob) \
|
|
18 (rval = bsi.wordpointer[0], \
|
|
19 rval <<= 8, \
|
|
20 rval |= bsi.wordpointer[1], \
|
|
21 rval <<= 8, \
|
|
22 rval |= bsi.wordpointer[2], \
|
|
23 rval <<= bsi.bitindex, \
|
|
24 rval &= 0xffffff, \
|
|
25 bsi.bitindex += (nob), \
|
|
26 rval >>= (24-(nob)), \
|
|
27 bsi.wordpointer += (bsi.bitindex>>3), \
|
|
28 bsi.bitindex &= 7, \
|
|
29 rval)
|
|
30
|
|
31 #define mpg123_getbits_fast(nob) \
|
|
32 (rval = (unsigned char) (bsi.wordpointer[0] << bsi.bitindex), \
|
|
33 rval |= ((unsigned long) bsi.wordpointer[1] << bsi.bitindex) >> 8, \
|
|
34 rval <<= (nob), \
|
|
35 rval >>= 8, \
|
|
36 bsi.bitindex += (nob), \
|
|
37 bsi.wordpointer += (bsi.bitindex >> 3), \
|
|
38 bsi.bitindex &= 7, \
|
|
39 rval)
|
|
40
|
|
41 #define mpg123_get1bit() \
|
|
42 (rval_uc = *bsi.wordpointer << bsi.bitindex, \
|
|
43 bsi.bitindex++, \
|
|
44 bsi.wordpointer += (bsi.bitindex>>3), \
|
|
45 bsi.bitindex &= 7, \
|
|
46 rval_uc >> 7)
|