annotate mp3lib/mpg123.h @ 1075:a981413af7cd

: No such... fix
author szabii
date Sat, 09 Jun 2001 17:30:40 +0000
parents 9bc104531aec
children 03b7e2955a20
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
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 # define M_PI 3.14159265358979323846
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 # define M_SQRT2 1.41421356237309504880
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 # define REAL_IS_FLOAT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 # define NEW_DCT9
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 #undef MPG123_REMOTE /* Get rid of this stuff for Win32 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 # define real float
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 # define real long double
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 # define real double
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 #include "audio.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 // #define AUDIOBUFSIZE 4096
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 #define FALSE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 #define TRUE 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 #define MAX_NAME_SIZE 81
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #define SBLIMIT 32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #define SCALE_BLOCK 12
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 #define SSLIMIT 18
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #define MPG_MD_STEREO 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #define MPG_MD_JOINT_STEREO 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 #define MPG_MD_DUAL_CHANNEL 2
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 #define MPG_MD_MONO 3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 /* #define MAXOUTBURST 32768 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 /* Pre Shift fo 16 to 8 bit converter table */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 #define AUSHIFT (3)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 struct al_table
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 short bits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 short d;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 struct frame {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 struct al_table *alloc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 int (*synth)(real *,int,unsigned char *,int *);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 int (*synth_mono)(real *,unsigned char *,int *);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 int stereo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 int jsbound;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 int single;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 int II_sblimit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 int down_sample_sblimit;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 int lsf;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 int mpeg25;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 int down_sample;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 int header_change;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 int lay;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 int error_protection;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 int bitrate_index;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 long sampling_frequency;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 int padding;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 int extension;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 int mode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 int mode_ext;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 int copyright;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 int original;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 int emphasis;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 long framesize; /* computed framesize */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 struct gr_info_s {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 int scfsi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 unsigned part2_3_length;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 unsigned big_values;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 unsigned scalefac_compress;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 unsigned block_type;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 unsigned mixed_block_flag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 unsigned table_select[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 unsigned subblock_gain[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 unsigned maxband[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 unsigned maxbandl;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 unsigned maxb;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 unsigned region1start;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 unsigned region2start;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 unsigned preflag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 unsigned scalefac_scale;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 unsigned count1table_select;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 int full_gain[3];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 int pow2gain;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 struct III_sideinfo
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 unsigned main_data_begin;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 unsigned private_bits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 struct gr_info_s gr[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 } ch[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 static long freqs[9];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 #ifdef HAVE_3DNOW
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 real decwin[2*(512+32)];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 #else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 real decwin[512+32];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 real *pnts[];
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
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 extern int synth_1to1_pent( real *,int,unsigned char * );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 extern void dct64(real *a,real *b,real *c);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 #ifdef HAVE_3DNOW
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 extern void dct64_3dnow( real *,real *, real * );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 extern void dct36_3dnow(real *,real *,real *,real *,real *);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 extern int synth_1to1_3dnow( real *,int,unsigned char * );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 #endif
736
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 1
diff changeset
126 #ifdef HAVE_3DNOWEX
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 1
diff changeset
127 extern void dct64_3dnowex( real *,real *, real * );
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 1
diff changeset
128 extern void dct36_3dnowex(real *,real *,real *,real *,real *);
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 1
diff changeset
129 extern int synth_1to1_3dnowex( real *,int,unsigned char * );
59b0a9ec8604 K7 3dnow-dsp support
nickols_k
parents: 1
diff changeset
130 #endif
787
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
131 #ifdef HAVE_SSE_MP3
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
132 // extern void dct64_3dnow( real *,real *, real * );
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
133 // extern void dct36_3dnow(real *,real *,real *,real *,real *);
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
134 extern int synth_1to1_sse( real *,int,unsigned char * );
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
135 #endif
9bc104531aec mp3lib sse support - disabled by default
arpi_esp
parents: 736
diff changeset
136