sonic: use M_SQRT2
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 4 May 2011 15:20:49 +0000 (17:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 10 Dec 2013 13:38:38 +0000 (14:38 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/sonic.c

index 31bbe46..3824c1f 100644 (file)
@@ -701,7 +701,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         }
 
         energy2 = sqrt(energy2/(s->channels*s->block_align));
-        energy1 = sqrt(2.0)*energy1/(s->channels*s->block_align);
+        energy1 = M_SQRT2*energy1/(s->channels*s->block_align);
 
         // increase bitrate when samples are like a gaussian distribution
         // reduce bitrate when samples are like a two-tailed exponential distribution