summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-03 16:13:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-03 16:15:13 +0200
commitbc4e7985628134496104e32f37f811aab4f68c55 (patch)
tree3d7b40fdf3bb99ed28551d324785f624d0ff449e
parentd6fd1242f31849e1d69ff758d2a63ebff6d121b4 (diff)
downloadffmpeg-bc4e7985628134496104e32f37f811aab4f68c55.tar.gz
avdevice/timefilter: 2nd try at avoiding rounding issues
This hopefully fixes fate-timefilter Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavdevice/timefilter.c5
-rw-r--r--tests/ref/fate/timefilter2
2 files changed, 3 insertions, 4 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++) {
diff --git a/tests/ref/fate/timefilter b/tests/ref/fate/timefilter
index efd9a81bc6..2fa88c9b3b 100644
--- a/tests/ref/fate/timefilter
+++ b/tests/ref/fate/timefilter
@@ -1,4 +1,4 @@
- [ 0.800000 1.000000 0.000000] [ 1689.810931 1.000000 0.000000] [ 2480.175715 1.000000 0.000000] [ 3323.672664 1.000000 0.000000]
+ [80000.000000 0.800000 0.000000] [80000.000000 0.800000 0.000000] [80000.000000 0.800000 0.000000] [80000.000000 0.800000 0.000000]
[ 1688.672234 0.000000 0.018551] [ 21.026792 0.000401 0.068856] [ 1.162481 0.008576 0.121287] [ 0.803356 0.016078 0.153518]
[ 1218.378235 0.000000 0.167011] [ 12.908626 0.000281 0.296858] [ 21.026792 0.000401 0.619608] [ 2.064064 0.004760 1.020336]
[ 1218.378235 0.000000 0.909282] [ 10.047626 0.000191 0.873495] [ 14.909464 0.000297 1.935407] [ 21.026792 0.000401 3.373312]