]> git.sesse.net Git - vlc/commitdiff
compressor: really use single precision
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 13 Aug 2014 20:03:06 +0000 (23:03 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 13 Aug 2014 20:22:43 +0000 (23:22 +0300)
modules/audio_filter/compressor.c

index 29f819cb63f926e41563750560d7a9a583c49c13..e154fb5e1ee08ce7943a8298a5587916307bf3c5 100644 (file)
@@ -549,8 +549,8 @@ static void RoundToZero( float *pf_x )
 static float Max( float f_x, float f_a )
 {
     f_x -= f_a;
-    f_x += fabs( f_x );
-    f_x *= 0.5;
+    f_x += fabsf( f_x );
+    f_x *= 0.5f;
     f_x += f_a;
 
     return f_x;
@@ -558,12 +558,12 @@ static float Max( float f_x, float f_a )
 
 static float Clamp( float f_x, float f_a, float f_b )
 {
-    const float f_x1 = fabs( f_x - f_a );
-    const float f_x2 = fabs( f_x - f_b );
+    const float f_x1 = fabsf( f_x - f_a );
+    const float f_x2 = fabsf( f_x - f_b );
 
     f_x = f_x1 + f_a + f_b;
     f_x -= f_x2;
-    f_x *= 0.5;
+    f_x *= 0.5f;
 
     return f_x;
 }
@@ -589,7 +589,7 @@ static float RmsEnvProcess( rms_env * p_r, const float f_x )
     p_r->f_sum += f_x;
 
     /* If the sum is small enough, make it zero */
-    if( p_r->f_sum < 1.0e-6 )
+    if( p_r->f_sum < 1.0e-6f )
     {
         p_r->f_sum = 0.0f;
     }