From 6908ded20e8040a48f6e281e665aabd6b1066a9e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 9 Jan 2013 23:20:24 +0100 Subject: swr: fix the noise sample type for noise shaping Signed-off-by: Michael Niedermayer --- libswresample/dither.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'libswresample/dither.c') diff --git a/libswresample/dither.c b/libswresample/dither.c index 05c75fc0f1..d7cb8a134a 100644 --- a/libswresample/dither.c +++ b/libswresample/dither.c @@ -23,15 +23,12 @@ #include "noise_shaping_data.c" -void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt) { +void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) { double scale = s->dither.ns_scale; #define TMP_EXTRA 2 double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double)); int i; - out_fmt = av_get_packed_sample_fmt(out_fmt); - in_fmt = av_get_packed_sample_fmt( in_fmt); - for(i=0; idither.noise = s->preout; + if (s->dither.method > SWR_DITHER_NS) { + s->dither.noise.bps = 4; + s->dither.noise.fmt = AV_SAMPLE_FMT_FLTP; + } return 0; } -- cgit v1.2.3