diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-26 01:35:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-26 01:35:22 +0200 |
commit | da9587952a855db0e03f90f1f0d86f60318acc24 (patch) | |
tree | d2756ddf90028d51710cbd50150485d8a2e6bc2f /libswresample/swresample.c | |
parent | a522e03754943ee7d8c898ee1afd10aa107ca7f2 (diff) | |
download | ffmpeg-da9587952a855db0e03f90f1f0d86f60318acc24.tar.gz |
swr: pass resample parameters from the user to the resampler.
doxy and names stolen from avr
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/swresample.c')
-rw-r--r-- | libswresample/swresample.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index d8ead573f3..414d84cafb 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -72,6 +72,10 @@ static const AVOption options[]={ {"rectangular" , "Rectangular Dither" , 0 , AV_OPT_TYPE_CONST, {.dbl=SWR_DITHER_RECTANGULAR}, INT_MIN, INT_MAX , PARAM, "dither_method"}, {"triangular" , "Triangular Dither" , 0 , AV_OPT_TYPE_CONST, {.dbl=SWR_DITHER_TRIANGULAR }, INT_MIN, INT_MAX , PARAM, "dither_method"}, {"triangular_hp" , "Triangular Dither With High Pass" , 0 , AV_OPT_TYPE_CONST, {.dbl=SWR_DITHER_TRIANGULAR_HIGHPASS }, INT_MIN, INT_MAX, PARAM, "dither_method"}, +{"filter_size" , "Resampling Filter Size" , OFFSET(filter_size) , AV_OPT_TYPE_INT , {.dbl=16 }, 0 , INT_MAX , PARAM }, +{"phase_shift" , "Resampling Phase Shift" , OFFSET(phase_shift) , AV_OPT_TYPE_INT , {.dbl=10 }, 0 , 30 , PARAM }, +{"linear_interp" , "Use Linear Interpolation" , OFFSET(linear_interp) , AV_OPT_TYPE_INT , {.dbl=0 }, 0 , 1 , PARAM }, +{"cutoff" , "Cutoff Frequency Ratio" , OFFSET(cutoff) , AV_OPT_TYPE_DOUBLE,{.dbl=0.8 }, 0 , 1 , PARAM }, {0} }; @@ -215,7 +219,7 @@ int swr_init(struct SwrContext *s){ } if (s->out_sample_rate!=s->in_sample_rate || (s->flags & SWR_FLAG_RESAMPLE)){ - s->resample = swri_resample_init(s->resample, s->out_sample_rate, s->in_sample_rate, 16, 10, 0, 0.8, s->int_sample_fmt); + s->resample = swri_resample_init(s->resample, s->out_sample_rate, s->in_sample_rate, s->filter_size, s->phase_shift, s->linear_interp, s->cutoff, s->int_sample_fmt); }else swri_resample_free(&s->resample); if( s->int_sample_fmt != AV_SAMPLE_FMT_S16 |