diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-18 11:52:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-18 11:52:11 +0200 |
commit | 30b2611ed3102c53a8aa96c71acf5dadb69997c8 (patch) | |
tree | 85aff1f741c3d7901c25657ebb8f0a1045fcef55 /libswresample/dither.c | |
parent | 946acacdcdff7eb9ac6430691ac6121516da9083 (diff) |
swresample: Skip over dither steps if dithering scale is 0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswresample/dither.c')
-rw-r--r-- | libswresample/dither.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c index 76f8ccf2c6..64068d35b6 100644 --- a/libswresample/dither.c +++ b/libswresample/dither.c @@ -102,6 +102,11 @@ av_cold int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AV if (out_fmt == AV_SAMPLE_FMT_S32 && s->dither.output_sample_bits) scale *= 1<<(32-s->dither.output_sample_bits); + if (scale == 0) { + s->dither.method = 0; + return 0; + } + s->dither.ns_pos = 0; s->dither.noise_scale= scale; s->dither.ns_scale = scale; |