diff options
author | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-11-12 12:33:56 +0000 |
---|---|---|
committer | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-11-12 12:33:56 +0000 |
commit | 66f4e56389d97b61a4a17325201643ef6bd87e37 (patch) | |
tree | 2f8fd12c1e876b7abaeed2d8bf2d34bd0fa37493 /libaf/af_equalizer.c | |
parent | 54a8a603fb418b675a08c6349dfc720939f6c37a (diff) | |
download | mpv-66f4e56389d97b61a4a17325201643ef6bd87e37.tar.bz2 mpv-66f4e56389d97b61a4a17325201643ef6bd87e37.tar.xz |
New features:
-- Support for runtime cpu detection
-- Stand alone compile of libaf
-- Unlimited number of channels (compiletime switch)
-- Sample format defined by bit-fields
-- New formats: float, A-Law and mu-law
-- Format conversion set in human readable format
i.e. format=4:us_be to set 32 bit unsigned big endian output
-- Format reporting in human readable format
-- Volume control has only one parameter for setting the volume
i.e. volume=-10.0:1:0:1 to set atenuation = -10dB
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8168 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af_equalizer.c')
-rw-r--r-- | libaf/af_equalizer.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libaf/af_equalizer.c b/libaf/af_equalizer.c index 8b6129df54..d33e84d47f 100644 --- a/libaf/af_equalizer.c +++ b/libaf/af_equalizer.c @@ -21,16 +21,12 @@ #include <inttypes.h> #include <math.h> -#include "../config.h" -#include "../mp_msg.h" -#include "../libao2/afmt.h" - #include "af.h" #include "equalizer.h" -#define NCH 6 // Max number of channels -#define L 2 // Storage for filter taps -#define KM 10 // Max number of bands +#define NCH AF_NCH // Number of channels +#define L 2 // Storage for filter taps +#define KM 10 // Max number of bands #define Q 1.2247449 /* Q value for band-pass filters 1.2247=(3/2)^(1/2) gives 4dB suppression @ Fc*2 and Fc/2 */ @@ -80,13 +76,16 @@ static int control(struct af_instance_s* af, int cmd, void* arg) af->data->rate = ((af_data_t*)arg)->rate; af->data->nch = ((af_data_t*)arg)->nch; - af->data->format = AFMT_S16_LE; + af->data->format = AF_FORMAT_NE | AF_FORMAT_SI; af->data->bps = 2; // Calculate number of active filters s->K=KM; - while(F[s->K-1] > (float)af->data->rate/2.0) + while(F[s->K-1] > (float)af->data->rate/2.2) s->K--; + + if(s->K != KM) + af_msg(AF_MSG_INFO,"Limiting the number of filters to %i due to low sample rate.\n",s->K); // Generate filter taps for(k=0;k<s->K;k++) @@ -95,7 +94,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg) // Calculate how much this plugin adds to the overall time delay af->delay += 2000.0/((float)af->data->rate); - // Only AFMT_S16_LE is supported + // Only signed 16 bit little endian is supported if(af->data->format != ((af_data_t*)arg)->format || af->data->bps != ((af_data_t*)arg)->bps) return AF_FALSE; |