comparison Plugins/Input/mpg123/getbits.c @ 1098:b5ae09a6c2f1 trunk

[svn] - prepare to split audacious code away from the actual decoder and use a highlevel API
author nenolod
date Mon, 22 May 2006 17:22:34 -0700
parents 05d824e30afd
children
comparison
equal deleted inserted replaced
1097:03dbf5494d40 1098:b5ae09a6c2f1
1 #include "mpg123.h" 1 #include "mpg123.h"
2 #include "common.h" 2 #include "common.h"
3 3
4 void mpg123_backbits(struct bitstream_info *bitbuf,int number_of_bits) 4 void mpgdec_backbits(struct bitstream_info *bitbuf,int number_of_bits)
5 { 5 {
6 bitbuf->bitindex -= number_of_bits; 6 bitbuf->bitindex -= number_of_bits;
7 bitbuf->wordpointer += (bitbuf->bitindex>>3); 7 bitbuf->wordpointer += (bitbuf->bitindex>>3);
8 bitbuf->bitindex &= 0x7; 8 bitbuf->bitindex &= 0x7;
9 } 9 }
10 10
11 int mpg123_getbitoffset(struct bitstream_info *bitbuf) 11 int mpgdec_getbitoffset(struct bitstream_info *bitbuf)
12 { 12 {
13 return (-bitbuf->bitindex)&0x7; 13 return (-bitbuf->bitindex)&0x7;
14 } 14 }
15 15
16 int mpg123_getbyte(struct bitstream_info *bitbuf) 16 int mpgdec_getbyte(struct bitstream_info *bitbuf)
17 { 17 {
18 #ifdef DEBUG_GETBITS 18 #ifdef DEBUG_GETBITS
19 if(bitbuf->bitindex) 19 if(bitbuf->bitindex)
20 fprintf(stderr,"getbyte called unsynched!\n"); 20 fprintf(stderr,"getbyte called unsynched!\n");
21 #endif 21 #endif
22 return *bitbuf->wordpointer++; 22 return *bitbuf->wordpointer++;
23 } 23 }
24 24
25 unsigned int mpg123_getbits(struct bitstream_info *bitbuf,int number_of_bits) 25 unsigned int mpgdec_getbits(struct bitstream_info *bitbuf,int number_of_bits)
26 { 26 {
27 unsigned long rval; 27 unsigned long rval;
28 28
29 #ifdef DEBUG_GETBITS 29 #ifdef DEBUG_GETBITS
30 fprintf(stderr,"g%d",number_of_bits); 30 fprintf(stderr,"g%d",number_of_bits);
60 #endif 60 #endif
61 61
62 return rval; 62 return rval;
63 } 63 }
64 64
65 unsigned int mpg123_getbits_fast(struct bitstream_info *bitbuf,int number_of_bits) 65 unsigned int mpgdec_getbits_fast(struct bitstream_info *bitbuf,int number_of_bits)
66 { 66 {
67 unsigned int rval; 67 unsigned int rval;
68 #ifdef DEBUG_GETBITS 68 #ifdef DEBUG_GETBITS
69 fprintf(stderr,"g%d",number_of_bits); 69 fprintf(stderr,"g%d",number_of_bits);
70 #endif 70 #endif
87 fprintf(stderr,":%x ",rval); 87 fprintf(stderr,":%x ",rval);
88 #endif 88 #endif
89 return rval; 89 return rval;
90 } 90 }
91 91
92 unsigned int mpg123_get1bit(struct bitstream_info *bitbuf) 92 unsigned int mpgdec_get1bit(struct bitstream_info *bitbuf)
93 { 93 {
94 unsigned char rval; 94 unsigned char rval;
95 95
96 #ifdef DEBUG_GETBITS 96 #ifdef DEBUG_GETBITS
97 fprintf(stderr,"g%d",1); 97 fprintf(stderr,"g%d",1);