]> git.sesse.net Git - vlc/commitdiff
pow(x, 2) => x * x
authorRafaël Carré <funman@videolan.org>
Wed, 16 Apr 2014 12:12:52 +0000 (14:12 +0200)
committerRafaël Carré <funman@videolan.org>
Wed, 16 Apr 2014 12:13:58 +0000 (14:13 +0200)
modules/audio_filter/audiobargraph_a.c
modules/audio_filter/normvol.c

index 77ef8a558a8bbd3cba6353d4a2b5e08f6aaa8db5..b34f6b5b07c3ba1bf110b912ac20fd94fdee5184 100644 (file)
@@ -167,7 +167,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
                 max = ch;
         }
     }
-    max = powf( max, 2 );
+    max *= max;
 
     if (p_sys->silence) {
         /* 2 - store the new value */
index 68f8d62adfa69a02a22abf63a07495a2e743f8c5..6bcacdb55b30f6850f96c81ffe043746b4b85d39 100644 (file)
@@ -156,8 +156,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
         for( i_chan = 0; i_chan < i_channels; i_chan++ )
         {
             float f_sample = p_in[i_chan];
-            float f_square = pow( f_sample, 2 );
-            pf_sum[i_chan] += f_square;
+            pf_sum[i_chan] += f_sample * f_sample;
         }
         p_in += i_channels;
     }