[MPlayer-cvslog] CVS: main/libaf af_tools.c,1.3,1.4

Alex Beregszaszi syncmail at mplayerhq.hu
Mon Jan 31 12:34:51 CET 2005


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv21304

Modified Files:
	af_tools.c 
Log Message:
af_softclip

Index: af_tools.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_tools.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- af_tools.c	31 Dec 2002 05:42:20 -0000	1.3
+++ af_tools.c	31 Jan 2005 11:34:49 -0000	1.4
@@ -78,3 +78,15 @@
   }
   return AF_OK;
 }
+
+/* Soft clipping, the sound of a dream, thanks to Jon Wattes
+   post to Musicdsp.org */
+inline float af_softclip(float a)
+{
+    if (a >= M_PI/2)
+	return 1.0;
+    else if (a <= -M_PI/2)
+	return -1.0;
+    else
+	return sin(a);
+}




More information about the MPlayer-cvslog mailing list