diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-11 20:24:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-11 20:38:38 +0200 |
commit | 65088b925a0dc2defdeaffbbc24963ef34af7834 (patch) | |
tree | cdfad73085dbe5a601bcbc3e464fb6385dbef720 /libavresample/resample_template.c | |
parent | 6d6bd16fce080bd7af1a3ef02c3354c360948e15 (diff) | |
parent | be394968c81019887ef996a78a526bdd85d1e216 (diff) | |
download | ffmpeg-65088b925a0dc2defdeaffbbc24963ef34af7834.tar.gz |
Merge commit 'be394968c81019887ef996a78a526bdd85d1e216'
* commit 'be394968c81019887ef996a78a526bdd85d1e216':
resample: add initial padding explicitly
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavresample/resample_template.c')
-rw-r--r-- | libavresample/resample_template.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavresample/resample_template.c b/libavresample/resample_template.c index 314eaa03f1..a9bbdae3f2 100644 --- a/libavresample/resample_template.c +++ b/libavresample/resample_template.c @@ -54,7 +54,7 @@ #define DBL_TO_FELEM(d, v) d = av_clip_int16(lrint(v * (1 << 15))) #endif -static void SET_TYPE(resample_nearest)(void *dst0, int dst_index, const void *src0, int index) +static void SET_TYPE(resample_nearest)(void *dst0, int dst_index, const void *src0, unsigned int index) { FELEM *dst = dst0; const FELEM *src = src0; @@ -63,21 +63,17 @@ static void SET_TYPE(resample_nearest)(void *dst0, int dst_index, const void *sr static void SET_TYPE(resample_one)(ResampleContext *c, void *dst0, int dst_index, const void *src0, - int src_size, int index, int frac) + unsigned int index, int frac) { FELEM *dst = dst0; const FELEM *src = src0; int i; - int sample_index = index >> c->phase_shift; + unsigned int sample_index = index >> c->phase_shift; FELEM2 val = 0; FELEM *filter = ((FELEM *)c->filter_bank) + c->filter_length * (index & c->phase_mask); - if (sample_index < 0) { - for (i = 0; i < c->filter_length; i++) - val += src[FFABS(sample_index + i) % src_size] * - (FELEM2)filter[i]; - } else if (c->linear) { + if (c->linear) { FELEM2 v2 = 0; for (i = 0; i < c->filter_length; i++) { val += src[sample_index + i] * (FELEM2)filter[i]; |