[FFmpeg-cvslog] swr: add a lowpass default so that each Resampler can have its own default.
Rob Sykes
git at videolan.org
Tue Dec 11 22:17:28 CET 2012
ffmpeg | branch: master | Rob Sykes <aquegg at yahoo.co.uk> | Tue Dec 11 21:23:24 2012 +0100| [41049d07f2e8f304895a12b6e27400fbc72cc797] | committer: Michael Niedermayer
swr: add a lowpass default so that each Resampler can have its own default.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41049d07f2e8f304895a12b6e27400fbc72cc797
---
libswresample/resample.c | 3 ++-
libswresample/swresample.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 9599421..7256fcf 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -196,7 +196,8 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
}
static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
- double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta){
+ double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta){
+ double cutoff = cutoff0? cutoff0 : 0.8;
double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
int phase_count= 1<<phase_shift;
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index d80c0ff..207abb4 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -83,7 +83,7 @@ static const AVOption options[]={
{"filter_size" , "set resampling filter size" , OFFSET(filter_size) , AV_OPT_TYPE_INT , {.i64=16 }, 0 , INT_MAX , PARAM },
{"phase_shift" , "set resampling phase shift" , OFFSET(phase_shift) , AV_OPT_TYPE_INT , {.i64=10 }, 0 , 30 , PARAM },
{"linear_interp" , "enable linear interpolation" , OFFSET(linear_interp) , AV_OPT_TYPE_INT , {.i64=0 }, 0 , 1 , PARAM },
-{"cutoff" , "set cutoff frequency ratio" , OFFSET(cutoff) , AV_OPT_TYPE_DOUBLE,{.dbl=0.8 }, 0 , 1 , PARAM },
+{"cutoff" , "set cutoff frequency ratio" , OFFSET(cutoff) , AV_OPT_TYPE_DOUBLE,{.dbl=0. }, 0 , 1 , PARAM },
{"resampler" , "set resampling Engine" , OFFSET(engine) , AV_OPT_TYPE_INT , {.i64=0 }, 0 , SWR_ENGINE_NB-1, PARAM, "resampler"},
{"swr" , "select SW Resampler" , 0 , AV_OPT_TYPE_CONST, {.i64=SWR_ENGINE_SWR }, INT_MIN, INT_MAX , PARAM, "resampler"},
{"min_comp" , "set minimum difference between timestamps and audio data (in seconds) below which no timestamp compensation of either kind is applied"
More information about the ffmpeg-cvslog
mailing list