swr: add a lowpass default so that each Resampler can have its own default.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Rob Sykes 2012-12-11 21:23:24 +01:00 committed by Michael Niedermayer
parent ae5a55e77a
commit 41049d07f2
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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"