ntdsapi: Add DsMakeSpnA to the spec file.
[wine] / dlls / winemp3.acm / mpg123.h
1 /*
2  * Copyright (c) Michael Hipp and other authors of the mpglib project.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include        <stdio.h>
20 #include        <string.h>
21 #include        <signal.h>
22
23 #ifndef WIN32
24 #include        <sys/signal.h>
25 #include        <unistd.h>
26 #endif
27
28 #include        <math.h>
29
30 #ifdef _WIN32
31 # undef WIN32
32 # define WIN32
33
34 # define M_PI       3.14159265358979323846
35 # define M_SQRT2        1.41421356237309504880
36 # define REAL_IS_FLOAT
37 # define NEW_DCT9
38
39 # define random rand
40 # define srandom srand
41
42 #endif
43
44 #ifdef REAL_IS_FLOAT
45 #  define real float
46 #elif defined(REAL_IS_LONG_DOUBLE)
47 #  define real long double
48 #else
49 #  define real double
50 #endif
51
52 #ifdef __GNUC__
53 #define INLINE inline
54 #else
55 #define INLINE
56 #endif
57
58 /* AUDIOBUFSIZE = n*64 with n=1,2,3 ...  */
59 #define         AUDIOBUFSIZE            16384
60
61 #ifndef FALSE
62 #define         FALSE                   0
63 #endif
64 #ifndef FALSE
65 #define         TRUE                    1
66 #endif
67
68 #define         SBLIMIT                 32
69 #define         SSLIMIT                 18
70
71 #define         SCALE_BLOCK             12
72
73
74 #define         MPG_MD_STEREO           0
75 #define         MPG_MD_JOINT_STEREO     1
76 #define         MPG_MD_DUAL_CHANNEL     2
77 #define         MPG_MD_MONO             3
78
79 #define MAXFRAMESIZE 1792
80
81
82 /* Pre Shift fo 16 to 8 bit converter table */
83 #define AUSHIFT (3)
84
85 struct frame {
86     int stereo;
87     int jsbound;
88     int single;
89     int lsf;
90     int mpeg25;
91     int header_change;
92     int lay;
93     int error_protection;
94     int bitrate_index;
95     int sampling_frequency;
96     int padding;
97     int extension;
98     int mode;
99     int mode_ext;
100     int copyright;
101     int original;
102     int emphasis;
103     int framesize; /* computed framesize */
104
105     /* layer2 stuff */
106     int II_sblimit;
107     void *alloc;
108 };
109
110 struct parameter {
111         int quiet;      /* shut up! */
112         int tryresync;  /* resync stream after error */
113         int verbose;    /* verbose level */
114         int checkrange;
115 };
116
117 extern unsigned int   get1bit(void);
118 extern unsigned int   getbits(int);
119 extern unsigned int   getbits_fast(int);
120 extern int set_pointer(long);
121
122 extern unsigned char *wordpointer;
123 extern int bitindex;
124
125 extern void make_decode_tables(long scaleval);
126 extern int do_layer3(struct frame *fr,unsigned char *,int *);
127 extern int do_layer2(struct frame *fr,unsigned char *,int *);
128 extern int do_layer1(struct frame *fr,unsigned char *,int *);
129 extern int decode_header(struct frame *fr,unsigned long newhead);
130
131
132
133 struct gr_info_s {
134       int scfsi;
135       unsigned part2_3_length;
136       unsigned big_values;
137       unsigned scalefac_compress;
138       unsigned block_type;
139       unsigned mixed_block_flag;
140       unsigned table_select[3];
141       unsigned subblock_gain[3];
142       unsigned maxband[3];
143       unsigned maxbandl;
144       unsigned maxb;
145       unsigned region1start;
146       unsigned region2start;
147       unsigned preflag;
148       unsigned scalefac_scale;
149       unsigned count1table_select;
150       real *full_gain[3];
151       real *pow2gain;
152 };
153
154 struct III_sideinfo
155 {
156   unsigned main_data_begin;
157   unsigned private_bits;
158   struct {
159     struct gr_info_s gr[2];
160   } ch[2];
161 };
162
163 extern int synth_1to1 (real *,int,unsigned char *,int *);
164 extern int synth_1to1_8bit (real *,int,unsigned char *,int *);
165 extern int synth_1to1_mono (real *,unsigned char *,int *);
166 extern int synth_1to1_mono2stereo (real *,unsigned char *,int *);
167 extern int synth_1to1_8bit_mono (real *,unsigned char *,int *);
168 extern int synth_1to1_8bit_mono2stereo (real *,unsigned char *,int *);
169
170 extern int synth_2to1 (real *,int,unsigned char *,int *);
171 extern int synth_2to1_8bit (real *,int,unsigned char *,int *);
172 extern int synth_2to1_mono (real *,unsigned char *,int *);
173 extern int synth_2to1_mono2stereo (real *,unsigned char *,int *);
174 extern int synth_2to1_8bit_mono (real *,unsigned char *,int *);
175 extern int synth_2to1_8bit_mono2stereo (real *,unsigned char *,int *);
176
177 extern int synth_4to1 (real *,int,unsigned char *,int *);
178 extern int synth_4to1_8bit (real *,int,unsigned char *,int *);
179 extern int synth_4to1_mono (real *,unsigned char *,int *);
180 extern int synth_4to1_mono2stereo (real *,unsigned char *,int *);
181 extern int synth_4to1_8bit_mono (real *,unsigned char *,int *);
182 extern int synth_4to1_8bit_mono2stereo (real *,unsigned char *,int *);
183
184 extern int synth_ntom (real *,int,unsigned char *,int *);
185 extern int synth_ntom_8bit (real *,int,unsigned char *,int *);
186 extern int synth_ntom_mono (real *,unsigned char *,int *);
187 extern int synth_ntom_mono2stereo (real *,unsigned char *,int *);
188 extern int synth_ntom_8bit_mono (real *,unsigned char *,int *);
189 extern int synth_ntom_8bit_mono2stereo (real *,unsigned char *,int *);
190
191 extern void rewindNbits(int bits);
192 extern int  hsstell(void);
193 extern int get_songlen(struct frame *fr,int no);
194
195 extern void init_layer3(int);
196 extern void init_layer2(void);
197 extern void make_decode_tables(long scale);
198 extern void make_conv16to8_table(int);
199 extern void dct64(real *,real *,real *);
200
201 extern void synth_ntom_set_step(long,long);
202
203 extern unsigned char *conv16to8;
204 extern long freqs[9];
205 extern real muls[27][64];
206 extern real decwin[512+32];
207 extern real *pnts[5];
208
209 extern struct parameter param;