push 337eb2e2d902d84a5d689451984c5832d7e04fc4
[wine/hacks.git] / dlls / winemp3.acm / mpg123.h
bloba798eb759e88639fa0e9101c4cff3ac1e280e902
1 /*
2 * Copyright (c) Michael Hipp and other authors of the mpglib project.
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.
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.
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
19 #include <stdio.h>
20 #include <string.h>
21 #include <signal.h>
23 #ifndef WIN32
24 #include <sys/signal.h>
25 #include <unistd.h>
26 #endif
28 #include <math.h>
30 #ifdef _WIN32
31 # undef WIN32
32 # define WIN32
34 # define M_PI 3.14159265358979323846
35 # define M_SQRT2 1.41421356237309504880
36 # define REAL_IS_FLOAT
38 #endif
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
48 #ifdef __GNUC__
49 #define INLINE inline
50 #else
51 #define INLINE
52 #endif
54 #ifndef FALSE
55 #define FALSE 0
56 #endif
57 #ifndef TRUE
58 #define TRUE 1
59 #endif
61 #define SBLIMIT 32
62 #define SSLIMIT 18
64 #define SCALE_BLOCK 12
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
72 #define MAXFRAMESIZE 1792
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 */
95 /* layer2 stuff */
96 int II_sblimit;
97 const struct al_table *alloc;
99 struct mpstr *mp;
102 struct parameter {
103 int quiet; /* shut up! */
104 int tryresync; /* resync stream after error */
105 int verbose; /* verbose level */
106 int checkrange;
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);
114 extern unsigned char *wordpointer;
115 extern int bitindex;
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);
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;
146 struct III_sideinfo
148 unsigned main_data_begin;
149 unsigned private_bits;
150 struct {
151 struct gr_info_s gr[2];
152 } ch[2];
155 extern int synth_1to1 (struct mpstr *,real *,int,unsigned char *,int *);
156 extern int synth_1to1_mono (struct mpstr *,real *,unsigned char *,int *);
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 *);
163 extern unsigned char *conv16to8;
164 extern real muls[27][64];
165 extern real decwin[512+32];
166 extern real *pnts[5];