Commit 75a24bef authored by Mans Rullgard's avatar Mans Rullgard
Browse files

iirfilter: add fate test



Change the test program to output text instead of binary files so
it can be compared easily in FATE.
Signed-off-by: default avatarMans Rullgard <mans@mansr.com>
parent 66e2dd11
......@@ -311,6 +311,9 @@ av_cold void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs)
}
#ifdef TEST
#undef printf
#include <stdio.h>
#define FILT_ORDER 4
#define SIZE 1024
int main(void)
......@@ -320,7 +323,6 @@ int main(void)
float cutoff_coeff = 0.4;
int16_t x[SIZE], y[SIZE];
int i;
FILE* fd;
fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH,
FF_FILTER_MODE_LOWPASS, FILT_ORDER,
......@@ -333,13 +335,8 @@ int main(void)
ff_iir_filter(fcoeffs, fstate, SIZE, x, 1, y, 1);
fd = fopen("in.bin", "w");
fwrite(x, sizeof(x[0]), SIZE, fd);
fclose(fd);
fd = fopen("out.bin", "w");
fwrite(y, sizeof(y[0]), SIZE, fd);
fclose(fd);
for (i = 0; i < SIZE; i++)
printf("%6d %6d\n", x[i], y[i]);
ff_iir_filter_free_coeffs(fcoeffs);
ff_iir_filter_free_state(fstate);
......
......@@ -218,3 +218,7 @@ fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc
fate-musepack7: CMP = oneoff
fate-musepack7: REF = $(SAMPLES)/musepack/inside-mp7.pcm
fate-musepack7: FUZZ = 1
FATE_TESTS += fate-iirfilter
fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
fate-iirfilter: CMD = run libavcodec/iirfilter-test
0 0
38 2
151 15
339 65
603 182
942 381
1356 664
1845 1021
2409 1450
3046 1953
3755 2530
4535 3182
5384 3907
6300 4700
7278 5563
8315 6491
9405 7481
10541 8529
11717 9629
12924 10773
14151 11956
15385 13167
16615 14396
17825 15630
18997 16857
20114 18060
21156 19222
22102 20325
22929 21349
23613 22273
24132 23073
24461 23726
24575 24208
24453 24495
24073 24564
23416 24392
22467 23959
21213 23245
19649 22236
17773 20922
15590 19296
13116 17360
10371 15119
7386 12591
4201 9797
867 6771
-2559 3554
-6008 199
-9405 -3235
-12667 -6678
-15707 -10053
-18435 -13277
-20762 -16261
-22602 -18916
-23875 -21153
-24511 -22887
-24457 -24040
-23675 -24546
-22151 -24352
-19895 -23428
-16946 -21762
-13370 -19370
-9265 -16296
-4757 -12613
0 -8423
4831 -3858
9544 923
13934 5743
17799 10406
20942 14708
23189 18447
24395 21430
24457 23488
23323 24483
21001 24321
17563 22963
13148 20426
7959 16795
2259 12223
-3643 6922
-9405 1166
-14670 -4731
-19092 -10421
-22359 -15550
-24213 -19777
-24481 -22797
-23087 -24368
-20071 -24334
-15590 -22639
-9924 -19343
-3457 -14629
3345 -8793
9959 -2236
15851 4563
20517 11078
23528 16779
24575 21171
23506 23846
20349 24522
15327 23076
8845 19572
1469 14264
-6117 7589
-13180 135
-18997 -7403
-22942 -14289
-24553 -19814
-23592 -23377
-20092 -24551
-14366 -23145
-6989 -19239
1244 -13192
9405 -5620
16532 2656
21744 10697
24357 17548
23978 22356
20579 24483
14518 23593
6518 19723
-2409 13293
-11083 5078
-18310 -3876
-23048 -12378
-24568 -19252
-22573 -23500
-17270 -24458
-9370 -21908
0 -16140
9439 -7935
17484 1526
22832 10824
24568 18508
22327 23330
16392 24452
7673 21608
-2409 15181
-12146 6168
-19828 -3955
-24050 -13466
-23978 -20689
-19535 -24292
-11451 -23552
-1168 -18512
9405 -10015
18234 416
23560 10836
24257 19234
20092 23929
11817 23916
1055 19105
-9993 10379
-18997 -540
-23986 -11413
-23802 -19939
-18385 -24246
-8845 -23318
2746 -17260
13778 -7325
21691 4319
24575 15045
21656 22357
13528 24482
2071 20823
-9959 12152
-19581 484
-24331 -11367
-22915 -20460
-15590 -24459
-4164 -22257
8421 -14315
18828 -2603
24213 9857
23022 19756
15474 24383
3569 22388
-9405 14211
-19761 2031
-24471 -10785
-22069 -20591
-13148 -24512
-264 -21311
12763 -11818
21968 1241
24457 13990
19351 22545
8137 24211
-5715 18362
-17799 6720
-24167 -7108
-22646 -18722
-13622 -24326
0 -21995
13685 -12382
22762 1409
24035 14788
16946 23188
3867 23644
-10643 15884
-21401 2514
-24457 -11806
-18584 -21960
-5825 -24220
9160 -17649
20762 -4546
24527 10303
18901 21343
5935 24337
-9405 18028
-21098 4727
-24442 -10470
-17979 -21608
-4201 -24206
11351 -17110
22280 -3064
23970 12287
15590 22636
565 23615
-14760 14693
-23773 -479
-22467 -15504
-11284 -23907
4942 -21954
19021 -10373
24575 5837
18973 19502
4646 24445
-11883 18316
-22929 3786
-23226 -12541
-12505 -23090
4239 -22841
18997 -11784
24567 4932
18107 19331
2671 24403
-14151 17558
-23919 2036
-21602 -14549
-8244 -23897
9405 -21206
22232 -7710
23473 9785
12342 22272
-5384 23186
-20286 11920
-24287 -5693
-15090 -20319
2409 -24060
18633 -14771
24538 2613
16698 18608
-603 24329
-17616 16471
-24575 -682
-17351 -17495
0 -24355
17404 -17211
24575 -65
17136 17163
-603 24334
-18031 17094
-24538 -374
-16023 -17660
2409 -24287
19397 -16108
24287 1992
13872 18902
-5384 24066
-21251 14131
-23473 -4761
-10473 -20664
9405 -23351
23151 -10967
21602 8573
5642 22543
-14151 21682
-24430 6431
-18107 -13147
641 -23920
18997 -18514
24207 -475
12505 17922
-8030 23970
-22929 13357
-21511 -6625
-4646 -21972
15619 -21758
24575 -6009
15561 14083
-4942 24019
-21831 16485
-22467 -3138
-6227 -20474
14760 -22641
24569 -7904
15590 12791
-5421 23839
-22280 16760
-21797 -3160
-4201 -20666
16754 -22169
24442 -6381
12602 14430
-9405 23865
-23848 14348
-18901 -6644
1545 -22308
20762 -19937
22804 -1339
5825 18365
-16080 22954
-24457 8529
-12080 -13009
10643 -23650
24269 -14353
16946 7119
-5127 22521
-22762 18602
-20413 -1370
0 -20152
20454 -21342
22646 -3797
4461 17096
-17799 22804
-23902 8148
-8137 -13817
15149 -23296
24457 -11618
11016 10660
-12763 23135
-24574 14243
-13148 -7861
10813 -22608
24471 -16124
14609 5565
-9405 21949
-24315 17379
-15474 -3849
8598 -21336
24213 -18120
15793 2745
-8421 20885
-24220 18429
-15590 -2263
8880 -20663
24331 -18359
14851 2398
-9959 20685
-24488 17917
-13528 -3137
11618 -20918
24575 -17075
11551 4460
-13778 21286
-24421 15770
-8845 -6328
16307 -21661
23802 -13916
5348 8671
-18997 21868
-22452 11421
-1055 -11371
21548 -21685
20092 -8212
-3941 14242
-23560 20853
-16476 4267
9405 -17009
24547 -19106
11451 343
-14911 19309
-23978 16208
-5053 -5409
19828 -20699
21364 -12016
-2409 10553
-23347 20700
-16392 6559
10268 -15211
24568 -18879
9090 -118
-17484 18664
-22690 14969
0 -6714
22719 -20134
17270 -9014
-9717 13022
-24568 18943
-8527 1506
18310 -17662
21934 -14749
-2409 6538
-23695 19463
-14518 7789
13433 -13633
23978 -17566
3270 935
-21744 18075
-18184 11812
9405 -9654
24544 -18394
6989 -3082
-19939 16117
-20092 13945
6881 -6613
24553 -18196
8809 -5437
-18997 14458
-20742 14731
6117 -4859
24531 -17657
8845 -6307
-19210 13526
-20349 14588
7170 -4444
24575 -17109
7098 -5874
-20517 13412
-18780 13691
9959 -5272
24347 -16558
3457 -4241
-22482 13949
-15590 11979
14181 -7142
23087 -15723
-2146 -1459
-24213 14726
-10200 9228
19092 -9692
19717 -14108
-9405 2343
-24304 15085
-2259 5221
23251 -12286
13148 -11127
-17190 6746
-21001 14161
7745 2
24457 -13938
2971 -6372
-23189 10842
-12860 11094
17799 -5795
20243 -13421
-9544 -30
-24096 13184
0 5498
24110 -10713
9265 -9718
-20620 6673
-16946 12155
14427 -1883
22151 -12653
-6591 -2861
-24457 11378
-1770 6908
23875 -8726
9648 -9817
-20762 5209
-16251 11385
15707 -1358
21059 -11610
-9405 -2353
-23830 10656
2559 5560
24560 -8789
4201 -8028
-23439 6314
-10371 9643
20783 -3542
15590 -10404
-16973 742
-19649 10386
12407 1870
22467 -9720
-7458 -4144
-24073 8562
2446 5991
24575 -7072
2371 -7375
-24132 5398
-6808 8306
22929 -3667
10745 -8824
-21156 1980
-14120 8987
18997 -408
16918 -8863
-16615 -1001
-19163 8521
14151 2220
20902 -8027
-11717 -3241
-22200 7441
9405 4071
23126 -6811
-7278 -4722
-23754 6177
5384 5213
24153 -5571
-3755 -5566
-24386 5013
2409 5801
24506 -4521
-1356 -5939
-24557 4104
603 5999
24573 -3765
-151 -5994
-24575 3508
0 5937
24575 -3331
-151 -5835
-24573 3232
603 5694
24557 -3205
-1356 -5517
-24506 3244
2409 5303
24386 -3343
-3755 -5049
-24153 3494
5384 4752
23754 -3685
-7278 -4407
-23126 3906
9405 4007
22200 -4143
-11717 -3547
-20902 4380
14151 3025
19163 -4598
-16615 -2434
-16918 4778
18997 1780
14120 -4898
-21156 -1066
-10745 4934
22929 304
6808 -4862
-24132 489
-2371 4664
24575 -1288
-2446 -4320
-24073 2060
7458 3820
22467 -2767
-12407 -3162
-19649 3365
16973 2357
15590 -3808
-20783 -1429
-10371 4050
23439 419
4201 -4055
-24560 616
2559 3795
23830 -1607
-9405 -3266
-21059 2473
15707 2486
16251 -3130
-20762 -1499
-9648 3505
23875 386
1770 -3539
-24457 754
6591 3205
22151 -1798
-14427 -2518
-16946 2618
20620 1540
9265 -3101
-24110 -381
0 3162
24096 -809
-9544 -2775
-20243 1859
17799 1978
12860 -2598
-23189 -879
-2971 2893
24457 -344
-7745 -2674
-21001 1478
17190 1966
13148 -2304
-23251 -890
-2259 2647
24304 -341
-9405 -2421
-19717 1467
19092 1662
10200 -2229
-24213 -535
2146 2434
23087 -692
-14181 -2022
-15590 1706
22482 1090
3457 -2230
-24347 115
9959 2111
18780 -1251
-20517 -1374
-7098 1975
24575 238
-7170 -2057
-20349 938
19210 1464
8845 -1763
-24531 -392
6117 1949
20742 -783
-18997 -1425
-8809 1630
24553 385