annotate mp3lib/mpg123.h @ 5160:a0e5f66a162c

fix
author gabucino
date Sun, 17 Mar 2002 09:42:20 +0000
parents a738eae695cc
children 1320f1b3229d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * mpg123 defines
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 * used source: musicout.h from mpegaudio package
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 #include "../config.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7
1256
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
8 #ifndef M_PI
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
9 #define M_PI 3.141592653589793238462
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
10 #endif
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
11 #ifndef M_SQRT2
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
12 #define M_SQRT2 1.414213562373095048802
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
13 #endif
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
14 #define REAL_IS_FLOAT
a738eae695cc #ifndef M_PI and M_SQRT2 added while fearing from redefining :)
alex
parents: 1245
diff changeset
15 #define NEW_DCT9
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 #undef MPG123_REMOTE /* Get rid of this stuff for Win32 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 # define real float
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 # define real long double
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 # define real double
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 #include "audio.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 // #define AUDIOBUFSIZE 4096
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #define FALSE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #define TRUE 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 #define MAX_NAME_SIZE 81
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #define SBLIMIT 32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #define SCALE_BLOCK 12
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 #define SSLIMIT 18
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 #define MPG_MD_STEREO 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 #define MPG_MD_JOINT_STEREO 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 #define MPG_MD_DUAL_CHANNEL 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #define MPG_MD_MONO 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 /* #define MAXOUTBURST 32768 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 /* Pre Shift fo 16 to 8 bit converter table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 #define AUSHIFT (3)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 struct al_table
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 short bits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 short d;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 struct frame {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 struct al_table *alloc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 int (*synth)(real *,int,unsigned char *,int *);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 int (*synth_mono)(real *,unsigned char *,int *);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 int stereo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 int jsbound;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 int single;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 int II_sblimit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 int down_sample_sblimit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 int lsf;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 int mpeg25;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 int down_sample;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 int header_change;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 int lay;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 int error_protection;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 int bitrate_index;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 long sampling_frequency;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 int padding;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 int extension;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 int mode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 int mode_ext;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 int copyright;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 int original;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 int emphasis;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 long framesize; /* computed framesize */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 struct gr_info_s {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 int scfsi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 unsigned part2_3_length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 unsigned big_values;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 unsigned scalefac_compress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 unsigned block_type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 unsigned mixed_block_flag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 unsigned table_select[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 unsigned subblock_gain[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 unsigned maxband[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 unsigned maxbandl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 unsigned maxb;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 unsigned region1start;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 unsigned region2start;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 unsigned preflag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 unsigned scalefac_scale;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 unsigned count1table_select;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 int full_gain[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 int pow2gain;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 struct III_sideinfo
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 unsigned main_data_begin;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 unsigned private_bits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 struct gr_info_s gr[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 } ch[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 static long freqs[9];
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
111 extern real decwin[(512+32)];
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
112 extern real *pnts[];
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 static int do_layer2(struct frame *fr,int single);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 static int do_layer3(struct frame *fr,int single);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
118 extern int synth_1to1_pent( real *,int,short * );
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
119 extern void make_decode_tables_MMX(long scaleval);
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
120 extern int synth_1to1_MMX( real *,int,short * );
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
121 extern int synth_1to1_MMX_s(real *, int, short *, short *, int *);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 extern void dct64(real *a,real *b,real *c);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
124 extern void dct36_3dnow(real *,real *,real *,real *,real *);
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
125 extern void dct36_3dnowex(real *,real *,real *,real *,real *);
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
126 extern void dct36_sse(real *,real *,real *,real *,real *);
787
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
127
1245
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
128 typedef int (*synth_func_t)( real *,int,short * );
03b7e2955a20 Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
nick
parents: 787
diff changeset
129 typedef void (*dct36_func_t)(real *,real *,real *,real *,real *);