diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-10-20 19:06:29 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-10-20 19:06:29 +0000 |
commit | f25ba8b39380d3bbe1b58b6422062427d19b787c (patch) | |
tree | 95aeb8c51ecf596ea682e8cd47ef577819c8f5a2 /libavcodec/resample2.c | |
parent | 51a880208a3a21cb6cb12a3385b260ad33c2b2b7 (diff) | |
download | ffmpeg-f25ba8b39380d3bbe1b58b6422062427d19b787c.tar.gz |
optimization
Originally committed as revision 3616 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample2.c')
-rw-r--r-- | libavcodec/resample2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c index ad303a4498..22f787dc16 100644 --- a/libavcodec/resample2.c +++ b/libavcodec/resample2.c @@ -42,7 +42,7 @@ #define FELEM_MAX INT16_MAX #define FELEM_MIN INT16_MIN #else -#define FILTER_SHIFT 24 +#define FILTER_SHIFT 22 #define FELEM int32_t #define FELEM2 int64_t @@ -193,12 +193,12 @@ int av_resample(AVResampleContext *c, short *dst, short *src, int *consumed, int }else{ #ifdef LINEAR int64_t v=0; - int sub_phase= (frac<<12) / c->src_incr; + int sub_phase= (frac<<8) / c->src_incr; for(i=0; i<c->filter_length; i++){ - int64_t coeff= filter[i]*(FELEM2)(4096 - sub_phase) + filter[i + c->filter_length]*(FELEM2)sub_phase; + int64_t coeff= filter[i]*(256 - sub_phase) + filter[i + c->filter_length]*sub_phase; v += src[sample_index + i] * coeff; } - val= v>>12; + val= v>>8; #else for(i=0; i<c->filter_length; i++){ val += src[sample_index + i] * (FELEM2)filter[i]; |