[FFmpeg-cvslog] swresample/resample: Fix fractional part of index in the filter_size = 1 filters = 1 case

Michael Niedermayer git at videolan.org
Mon Apr 14 02:34:26 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Apr 14 02:20:33 2014 +0200| [6c8ee74af2af032267b6dd109a829d8ea0e7090d] | committer: Michael Niedermayer

swresample/resample: Fix fractional part of index in the filter_size = 1 filters = 1 case

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c8ee74af2af032267b6dd109a829d8ea0e7090d
---

 libswresample/resample_template.c |    2 +-
 tests/fate/libswresample.mak      |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libswresample/resample_template.c b/libswresample/resample_template.c
index 396b4e3..9269fea 100644
--- a/libswresample/resample_template.c
+++ b/libswresample/resample_template.c
@@ -104,7 +104,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
     av_assert1(c->felem_size == sizeof(FELEM));
 
     if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){
-        int64_t index2= ((int64_t)index)<<32;
+        int64_t index2= (1LL<<32)*c->frac/c->src_incr + (1LL<<32)*index;
         int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr;
         dst_size= FFMIN(dst_size, (src_size-1-index) * (int64_t)c->src_incr / c->dst_incr);
 
diff --git a/tests/fate/libswresample.mak b/tests/fate/libswresample.mak
index e32bd91..cc9dd76 100644
--- a/tests/fate/libswresample.mak
+++ b/tests/fate/libswresample.mak
@@ -326,13 +326,13 @@ fate-swr-resample_nn-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav
 fate-swr-resample_nn-fltp-44100-8000: CMP_TARGET = 590.98
 fate-swr-resample_nn-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20486
 
-fate-swr-resample_nn-fltp-8000-44100: CMP_TARGET = 6330.39
+fate-swr-resample_nn-fltp-8000-44100: CMP_TARGET = 3163.03
 fate-swr-resample_nn-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20480
 
 fate-swr-resample_nn-s16p-44100-8000: CMP_TARGET = 590.97
 fate-swr-resample_nn-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20486
 
-fate-swr-resample_nn-s16p-8000-44100: CMP_TARGET = 6330.47
+fate-swr-resample_nn-s16p-8000-44100: CMP_TARGET = 3163.10
 fate-swr-resample_nn-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20480
 endef
 



More information about the ffmpeg-cvslog mailing list