using af_softclip

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14624 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2005-01-31 11:43:36 +00:00
parent f63682aedc
commit 4ec530c8a0
1 changed files with 2 additions and 8 deletions

View File

@ -177,14 +177,8 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
s->pow[ch] = t*s->pow[ch] + pow*s->time; // LP filter
/* Soft clipping, the sound of a dream, thanks to Jon Wattes
post to Musicdsp.org */
if(s->soft){
if (x >= M_PI/2)
x = 1.0;
else if(x <= -M_PI/2)
x = -1.0;
else
x = sin(x);
}
if(s->soft)
x=af_softclip(x);
// Hard clipping
else
x=clamp(x,-1.0,1.0);