Browse Source

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>
tags/n2.8
Ganesh Ajjanagadde Michael Niedermayer 10 years ago
parent
commit
24e6729a04
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libswresample/dither.c

+ 1
- 1
libswresample/dither.c View File

@@ -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++)


Loading…
Cancel
Save