[FFmpeg-cvslog] swr: scale data down in noise shaping to avoid cliping

Michael Niedermayer git at videolan.org
Thu Jan 10 02:02:54 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 10 01:28:24 2013 +0100| [2672b2c1d2d48af94c59c198287fae1c7a785710] | committer: Michael Niedermayer

swr: scale data down in noise shaping to avoid cliping

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2672b2c1d2d48af94c59c198287fae1c7a785710
---

 libswresample/dither.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libswresample/dither.c b/libswresample/dither.c
index 66bf184..d7a5b6b 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -106,6 +106,7 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
             s->dither.ns_taps = f->len;
             for (j=0; j<f->len; j++)
                 s->dither.ns_coeffs[j] = f->coefs[j];
+            s->dither.ns_scale_1 *= 1 - exp(f->gain_cB * M_LN10 * 0.005) * 2 / (1<<(8*av_get_bytes_per_sample(out_fmt)));
             break;
         }
     }



More information about the ffmpeg-cvslog mailing list