Mercurial > mplayer.hg
comparison libao2/pl_eq.c @ 7507:a2173bfdc133
Correction of spelling errors and removal of old code
author | anders |
---|---|
date | Thu, 26 Sep 2002 10:12:50 +0000 |
parents | a94cde7ef947 |
children | 9fc45fe0d444 |
comparison
equal
deleted
inserted
replaced
7506:c1cb94198e05 | 7507:a2173bfdc133 |
---|---|
41 #define CH 6 // Max number of channels | 41 #define CH 6 // Max number of channels |
42 #define L 2 // Storage for filter taps | 42 #define L 2 // Storage for filter taps |
43 #define KM 10 // Max number of octaves | 43 #define KM 10 // Max number of octaves |
44 | 44 |
45 #define Q 1.2247 /* Q value for band-pass filters 1.2247=(3/2)^(1/2) | 45 #define Q 1.2247 /* Q value for band-pass filters 1.2247=(3/2)^(1/2) |
46 gives 4db suppression @ Fc*2 and Fc/2 */ | 46 gives 4dB suppression @ Fc*2 and Fc/2 */ |
47 | 47 |
48 // Center frequencies for band-pass filters | 48 // Center frequencies for band-pass filters |
49 #define CF {31.25,62.5,125,250,500,1000,2000,4000,8000,16000} | 49 #define CF {31.25,62.5,125,250,500,1000,2000,4000,8000,16000} |
50 | 50 |
51 // local data | 51 // local data |
144 bp2(pl_eq.a[k],pl_eq.b[k],F[k]/((float)ao_plugin_data.rate),Q); | 144 bp2(pl_eq.a[k],pl_eq.b[k],F[k]/((float)ao_plugin_data.rate),Q); |
145 | 145 |
146 // Reset buffers | 146 // Reset buffers |
147 reset(); | 147 reset(); |
148 | 148 |
149 #if 0 | |
150 // Reset gain factors | |
151 for(c=0;c<pl_eq.channels;c++) | |
152 for(k=0;k<pl_eq.K;k++) | |
153 pl_eq.g[c][k]=0; | |
154 #endif | |
155 | |
156 // Tell ao_plugin how much this plugin adds to the overall time delay | 149 // Tell ao_plugin how much this plugin adds to the overall time delay |
157 ao_plugin_data.delay_fix-=2/((float)pl_eq.channels*(float)ao_plugin_data.rate); | 150 ao_plugin_data.delay_fix-=2/((float)pl_eq.channels*(float)ao_plugin_data.rate); |
158 // Print some cool remark of what the plugin does | 151 // Print some cool remark of what the plugin does |
159 printf("[pl_eq] Equalizer in use.\n"); | 152 printf("[pl_eq] Equalizer in use.\n"); |
160 return 1; | 153 return 1; |
177 int16_t* end = in+ao_plugin_data.len/2; // Block loop end | 170 int16_t* end = in+ao_plugin_data.len/2; // Block loop end |
178 | 171 |
179 while(in < end){ | 172 while(in < end){ |
180 register int16_t k = 0; // Frequency band index | 173 register int16_t k = 0; // Frequency band index |
181 register int32_t yt = 0; // Total output from filters | 174 register int32_t yt = 0; // Total output from filters |
182 register int16_t x = *in; /* Current input sample scale | 175 register int16_t x = *in; // Current input sample |
183 to prevent overflow in wq */ | |
184 in+=nch; | 176 in+=nch; |
185 | 177 |
186 // Run the filters | 178 // Run the filters |
187 for(;k<pl_eq.K;k++){ | 179 for(;k<pl_eq.K;k++){ |
188 // Pointer to circular buffer wq | 180 // Pointer to circular buffer wq |