Commit 2b58c9c9 authored by Michael Niedermayer's avatar Michael Niedermayer

swresample/resample_template: try to consider src_size more exactly

This should avoid slight differences in the output causes by input
size alignment differences between archs
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0bf25c7b
...@@ -106,7 +106,9 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int ...@@ -106,7 +106,9 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){ if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){
int64_t index2= (1LL<<32)*c->frac/c->src_incr + (1LL<<32)*index; int64_t index2= (1LL<<32)*c->frac/c->src_incr + (1LL<<32)*index;
int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr; 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); int new_size = (src_size * (int64_t)c->src_incr - frac + c->dst_incr - 1) / c->dst_incr;
dst_size= FFMIN(dst_size, new_size);
for(dst_index=0; dst_index < dst_size; dst_index++){ for(dst_index=0; dst_index < dst_size; dst_index++){
dst[dst_index] = src[index2>>32]; dst[dst_index] = src[index2>>32];
......
...@@ -326,13 +326,13 @@ fate-swr-resample_nn-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav ...@@ -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: CMP_TARGET = 590.98
fate-swr-resample_nn-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20486 fate-swr-resample_nn-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20486
fate-swr-resample_nn-fltp-8000-44100: CMP_TARGET = 3163.03 fate-swr-resample_nn-fltp-8000-44100: CMP_TARGET = 3163.32
fate-swr-resample_nn-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20480 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: CMP_TARGET = 590.97
fate-swr-resample_nn-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20486 fate-swr-resample_nn-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20486
fate-swr-resample_nn-s16p-8000-44100: CMP_TARGET = 3163.10 fate-swr-resample_nn-s16p-8000-44100: CMP_TARGET = 3163.39
fate-swr-resample_nn-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20480 fate-swr-resample_nn-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20480
endef endef
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment