[FFmpeg-cvslog] swr: add noise_scale field to seperate it from the noise shaping scales

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


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 10 00:25:09 2013 +0100| [ead3a2a37e67de617cad33b7e9bdb8ade6ed220f] | committer: Michael Niedermayer

swr: add noise_scale field to seperate it from the noise shaping scales

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

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

 libswresample/dither.c              |    3 ++-
 libswresample/swresample_internal.h |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libswresample/dither.c b/libswresample/dither.c
index d7cb8a1..c3bb560 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -24,7 +24,7 @@
 #include "noise_shaping_data.c"
 
 void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) {
-    double scale = s->dither.ns_scale;
+    double scale = s->dither.noise_scale;
 #define TMP_EXTRA 2
     double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
     int i;
@@ -95,6 +95,7 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
     scale *= s->dither.scale;
 
     s->dither.ns_pos = 0;
+    s->dither.noise_scale=   scale;
     s->dither.ns_scale   =   scale;
     s->dither.ns_scale_1 = 1/scale;
     memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h
index 5236098..8423c3a 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -54,6 +54,7 @@ struct DitherContext {
     enum SwrDitherType method;
     int dither_pos;
     float scale;
+    float noise_scale;                              ///< Noise scale
     int ns_taps;                                    ///< Noise shaping dither taps
     float ns_scale;                                 ///< Noise shaping dither scale
     float ns_scale_1;                               ///< Noise shaping dither scale^-1



More information about the ffmpeg-cvslog mailing list