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