aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/resample2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-03-22 00:16:41 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-03-22 00:16:41 +0000
commit14f887efc61e95fc5b983dbb799ad9e0be50cfe2 (patch)
tree18f8c379ce3d65dd15592162cead07182787da91 /libavcodec/resample2.c
parent20cf58c32bda10537960048f4218fc50b803a1e9 (diff)
downloadffmpeg-14f887efc61e95fc5b983dbb799ad9e0be50cfe2.tar.gz
select more sensible default windows (= attenuation beyond the dynamic range of your input is silly if it negatively affects other parameters)
Originally committed as revision 8473 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample2.c')
-rw-r--r--libavcodec/resample2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c
index 10e98e580e..ebda7e5a8b 100644
--- a/libavcodec/resample2.c
+++ b/libavcodec/resample2.c
@@ -37,6 +37,7 @@
#define FELEM2 int32_t
#define FELEM_MAX INT16_MAX
#define FELEM_MIN INT16_MIN
+#define WINDOW_TYPE 9
#else
#define FILTER_SHIFT 30
@@ -44,6 +45,7 @@
#define FELEM2 int64_t
#define FELEM_MAX INT32_MAX
#define FELEM_MIN INT32_MIN
+#define WINDOW_TYPE 12
#endif
@@ -177,7 +179,7 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size,
c->filter_length= FFMAX((int)ceil(filter_size/factor), 1);
c->filter_bank= av_mallocz(c->filter_length*(phase_count+1)*sizeof(FELEM));
- av_build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, 1);
+ av_build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, WINDOW_TYPE);
memcpy(&c->filter_bank[c->filter_length*phase_count+1], c->filter_bank, (c->filter_length-1)*sizeof(FELEM));
c->filter_bank[c->filter_length*phase_count]= c->filter_bank[c->filter_length - 1];