diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-03 16:13:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-03 16:15:13 +0200 |
commit | bc4e7985628134496104e32f37f811aab4f68c55 (patch) | |
tree | 3d7b40fdf3bb99ed28551d324785f624d0ff449e /libavdevice | |
parent | d6fd1242f31849e1d69ff758d2a63ebff6d121b4 (diff) | |
download | ffmpeg-bc4e7985628134496104e32f37f811aab4f68c55.tar.gz |
avdevice/timefilter: 2nd try at avoiding rounding issues
This hopefully fixes fate-timefilter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/timefilter.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c index ea64c6d148..424e4929bd 100644 --- a/libavdevice/timefilter.c +++ b/libavdevice/timefilter.c @@ -101,7 +101,7 @@ int main(void) for (n0 = 0; n0 < 40; n0 = 2 * n0 + 1) { for (n1 = 0; n1 < 10; n1 = 2 * n1 + 1) { double best_error = 1000000000; - double bestpar0 = 1; + double bestpar0 = n0 ? 1 : 100000; double bestpar1 = 1; int better, i; @@ -118,8 +118,7 @@ int main(void) double par0, par1; better = 0; for (par0 = bestpar0 * 0.8; par0 <= bestpar0 * 1.21; par0 += bestpar0 * 0.05) { - double range = n0 ? 0.8 : 1.0; - for (par1 = bestpar1 * range; par1 <= bestpar1 * (2.01 - range); par1 += bestpar1 * 0.05) { + for (par1 = bestpar1 * 0.8; par1 <= bestpar1 * 1.21; par1 += bestpar1 * 0.05) { double error = 0; TimeFilter *tf = ff_timefilter_new(1, par0, par1); for (i = 0; i < SAMPLES; i++) { |