aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample/dither.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-11 13:44:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-11 13:44:48 +0200
commitc1d404b9e400d15b1b29fb05303278be0859eb7a (patch)
treec496e0dcc7ed8c8109a3903921b694c19ea190f9 /libswresample/dither.c
parenta2c92e60639b132e291c97aff9a7e18d1a0ae049 (diff)
downloadffmpeg-c1d404b9e400d15b1b29fb05303278be0859eb7a.tar.gz
swr: add a dither_scale parameter to tune the amplitude of the dither.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/dither.c')
-rw-r--r--libswresample/dither.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c
index 8d5d0bcca9..a340733610 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -36,6 +36,8 @@ void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSa
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<24;
if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<8;
+ scale *= s->dither_scale;
+
for(i=0; i<len + TMP_EXTRA; i++){
double v;
seed = seed* 1664525 + 1013904223;