summaryrefslogtreecommitdiff
path: root/libswresample/dither.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-08-23 16:31:12 -0400
committerMichael Niedermayer <michael@niedermayer.cc>2015-08-23 23:19:31 +0200
commit24e6729a049e476414ed677b97950421ab86c673 (patch)
tree3e7fc5e92d7b91b9964372e166dba6423a09fb59 /libswresample/dither.c
parent9aaac0410767a1e45a60c535b10e913690b0fcc1 (diff)
downloadffmpeg-24e6729a049e476414ed677b97950421ab86c673.tar.gz
swresample/dither: use integer arithmetic
This fixes a -Wabsolute-value reported by clang 3.5+ complaining about misuse of fabs() for integer absolute value. An additional benefit is the removal of floating point calculations. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswresample/dither.c')
-rw-r--r--libswresample/dither.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c
index 248062aab8..08c793d4cf 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -109,7 +109,7 @@ av_cold int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AV
memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
for (i=0; filters[i].coefs; i++) {
const filter_t *f = &filters[i];
- if (fabs(s->out_sample_rate - f->rate) / f->rate <= .05 && f->name == s->dither.method) {
+ if (llabs(s->out_sample_rate - f->rate)*20 <= f->rate && f->name == s->dither.method) {
int j;
s->dither.ns_taps = f->len;
for (j=0; j<f->len; j++)