History

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

Michael Niedermayer committed 12 years ago

Commit 6c8ee741 parent 161ec192 files · +3 −3Browse files

Unified · Split

2 files
  1. libswresample/resample_template.c +1 −1
  2. tests/fate/libswresample.mak +2 −2
libswresample/resample_template.c+1−1
@@ -104,7 +104,7 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int · 103 unmodified lines
104104 av_assert1(c->felem_size == sizeof(FELEM));
105105
106106 if(compensation_distance == 0 && c->filter_length == 1 && c->phase_shift==0){
107− int64_t index2= ((int64_t)index)<<32;
107+ int64_t index2= (1LL<<32)*c->frac/c->src_incr + (1LL<<32)*index;
108108 int64_t incr= (1LL<<32) * c->dst_incr / c->src_incr;
109109 dst_size= FFMIN(dst_size, (src_size-1-index) * (int64_t)c->src_incr / c->dst_incr);
110110
tests/fate/libswresample.mak+2−2
@@ -326,13 +326,13 @@ fate-swr-resample_nn-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav · 325 unmodified lines
326326 fate-swr-resample_nn-fltp-44100-8000: CMP_TARGET = 590.98
327327 fate-swr-resample_nn-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20486
328328
329−fate-swr-resample_nn-fltp-8000-44100: CMP_TARGET = 6330.39
329+fate-swr-resample_nn-fltp-8000-44100: CMP_TARGET = 3163.03
330330 fate-swr-resample_nn-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20480
331331
332332 fate-swr-resample_nn-s16p-44100-8000: CMP_TARGET = 590.97
333333 fate-swr-resample_nn-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20486
334334
335−fate-swr-resample_nn-s16p-8000-44100: CMP_TARGET = 6330.47
335+fate-swr-resample_nn-s16p-8000-44100: CMP_TARGET = 3163.10
336336 fate-swr-resample_nn-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20480
337337 endef
338338

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t