[FFmpeg-cvslog] swr: pass context to swri_get_dither()

Michael Niedermayer git at videolan.org
Wed Apr 11 14:30:12 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Apr 11 13:44:15 2012 +0200| [a2c92e60639b132e291c97aff9a7e18d1a0ae049] | committer: Michael Niedermayer

swr: pass context to swri_get_dither()

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

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

 libswresample/dither.c              |    6 +++---
 libswresample/swresample.c          |    2 +-
 libswresample/swresample_internal.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libswresample/dither.c b/libswresample/dither.c
index 88f7880..8d5d0bc 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -21,7 +21,7 @@
 #include "libavutil/avassert.h"
 #include "swresample_internal.h"
 
-void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, enum SwrDitherType method) {
+void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt) {
     double scale = 0;
 #define TMP_EXTRA 2
     double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
@@ -40,7 +40,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
         double v;
         seed = seed* 1664525 + 1013904223;
 
-        switch(method){
+        switch(s->dither_method){
             case SWR_DITHER_RECTANGULAR: v= ((double)seed) / UINT_MAX - 0.5; break;
             case SWR_DITHER_TRIANGULAR :
             case SWR_DITHER_TRIANGULAR_HIGHPASS :
@@ -56,7 +56,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
     for(i=0; i<len; i++){
         double v;
 
-        switch(method){
+        switch(s->dither_method){
             case SWR_DITHER_RECTANGULAR:
             case SWR_DITHER_TRIANGULAR :
                 v = tmp[i];
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 78b0355..3078e87 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -527,7 +527,7 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
                 return ret;
             if(ret)
                 for(ch=0; ch<s->dither.ch_count; ch++)
-                    swri_get_dither(s->dither.ch[ch], s->dither.count, 12345678913579<<ch, s->out_sample_fmt, s->int_sample_fmt, s->dither_method);
+                    swri_get_dither(s, s->dither.ch[ch], s->dither.count, 12345678913579<<ch, s->out_sample_fmt, s->int_sample_fmt);
             av_assert0(s->dither.ch_count == preout->ch_count);
 
             if(s->dither_pos + out_count > s->dither.count)
diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h
index 68b5130..d2cb85b 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -94,6 +94,6 @@ int swri_rematrix_init(SwrContext *s);
 int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy);
 void swri_sum2(enum AVSampleFormat format, void *dst, const void *src0, const void *src1, float coef0, float coef1, int len);
 
-void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, enum SwrDitherType type);
+void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt);
 
 #endif



More information about the ffmpeg-cvslog mailing list