diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-23 01:25:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-23 01:35:34 +0200 |
commit | 730e07f10b972aaf63e3aeb04d6f179c5640fd6f (patch) | |
tree | 4face9bb2a0a6b8e6b487fc1be75cb476595f3bc /libavcodec/sonic.c | |
parent | 4ec7ef56bd03e9c5bc51ba1923ee535a8f1b3fd0 (diff) | |
download | ffmpeg-730e07f10b972aaf63e3aeb04d6f179c5640fd6f.tar.gz |
sonic: avoid float sqrt() for integer input & output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/sonic.c')
-rw-r--r-- | libavcodec/sonic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 85248b1579..787cd552f3 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -545,7 +545,7 @@ static av_cold int sonic_encode_init(AVCodecContext *avctx) // generate taps s->tap_quant = av_calloc(s->num_taps, sizeof(*s->tap_quant)); for (i = 0; i < s->num_taps; i++) - s->tap_quant[i] = (int)(sqrt(i+1)); + s->tap_quant[i] = ff_sqrt(i+1); s->channels = avctx->channels; s->samplerate = avctx->sample_rate; @@ -820,7 +820,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx) // generate taps s->tap_quant = av_calloc(s->num_taps, sizeof(*s->tap_quant)); for (i = 0; i < s->num_taps; i++) - s->tap_quant[i] = (int)(sqrt(i+1)); + s->tap_quant[i] = ff_sqrt(i+1); s->predictor_k = av_calloc(s->num_taps, sizeof(*s->predictor_k)); |