mirror of https://github.com/mpv-player/mpv
using af_softclip
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14624 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
f63682aedc
commit
4ec530c8a0
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue