dplayx: Tests for CreateGroup.
[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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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
38 #endif
39
40 #ifdef REAL_IS_FLOAT
41 #  define real float
42 #elif defined(REAL_IS_LONG_DOUBLE)
43 #  define real long double
44 #else
45 #  define real double
46 #endif
47
48 #ifdef __GNUC__
49 #define INLINE inline
50 #else
51 #define INLINE
52 #endif
53
54 #ifndef FALSE
55 #define         FALSE                   0
56 #endif
57 #ifndef TRUE
58 #define         TRUE                    1
59 #endif
60
61 #define         SBLIMIT                 32
62 #define         SSLIMIT                 18
63
64 #define         SCALE_BLOCK             12
65
66
67 #define         MPG_MD_STEREO           0
68 #define         MPG_MD_JOINT_STEREO     1
69 #define         MPG_MD_DUAL_CHANNEL     2
70 #define         MPG_MD_MONO             3
71
72 #define MAXFRAMESIZE 1792
73
74
75 struct frame {
76     int stereo;
77     int jsbound;
78     int single;
79     int lsf;
80     int mpeg25;
81     int header_change;
82     int lay;
83     int error_protection;
84     int bitrate_index;
85     int sampling_frequency;
86     int padding;
87     int extension;
88     int mode;
89     int mode_ext;
90     int copyright;
91     int original;
92     int emphasis;
93     int framesize; /* computed framesize */
94
95     /* layer2 stuff */
96     int II_sblimit;
97     const struct al_table *alloc;
98
99     struct mpstr *mp;
100 };
101
102 struct parameter {
103         int quiet;      /* shut up! */
104         int tryresync;  /* resync stream after error */
105         int verbose;    /* verbose level */
106         int checkrange;
107 };
108
109 extern unsigned int   get1bit(void);
110 extern unsigned int   getbits(int);
111 extern unsigned int   getbits_fast(int);
112 extern int set_pointer(struct mpstr *,long);
113
114 extern unsigned char *wordpointer;
115 extern int bitindex;
116
117 extern void make_decode_tables(long scaleval);
118 extern int do_layer3(struct frame *fr,unsigned char *,int *);
119 extern int do_layer2(struct frame *fr,unsigned char *,int *);
120 extern int do_layer1(struct frame *fr,unsigned char *,int *);
121 extern int decode_header(struct frame *fr,unsigned long newhead);
122
123
124
125 struct gr_info_s {
126       int scfsi;
127       unsigned part2_3_length;
128       unsigned big_values;
129       unsigned scalefac_compress;
130       unsigned block_type;
131       unsigned mixed_block_flag;
132       unsigned table_select[3];
133       unsigned subblock_gain[3];
134       unsigned maxband[3];
135       unsigned maxbandl;
136       unsigned maxb;
137       unsigned region1start;
138       unsigned region2start;
139       unsigned preflag;
140       unsigned scalefac_scale;
141       unsigned count1table_select;
142       real *full_gain[3];
143       real *pow2gain;
144 };
145
146 struct III_sideinfo
147 {
148   unsigned main_data_begin;
149   unsigned private_bits;
150   struct {
151     struct gr_info_s gr[2];
152   } ch[2];
153 };
154
155 extern int synth_1to1 (struct mpstr *,real *,int,unsigned char *,int *);
156 extern int synth_1to1_mono (struct mpstr *,real *,unsigned char *,int *);
157
158 extern void init_layer3(int);
159 extern void init_layer2(void);
160 extern void make_decode_tables(long scale);
161 extern void dct64(real *,real *,real *);
162
163 extern unsigned char *conv16to8;
164 extern const long freqs[9];
165 extern real muls[27][64];
166 extern real decwin[512+32];
167 extern real *pnts[5];
168
169 extern const struct parameter param;