../../../ffmpeg/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
27 / 33
81.8%
Branches:
8 / 28
28.6%
Functions:
2 / 2
100.0%

tests/checkasm/vorbisdsp.c
Line Branch Exec Source
1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #include <float.h>
20 #include <stdio.h>
21 #include <string.h>
22
23 #include "libavutil/mem_internal.h"
24
25 #include "libavcodec/vorbisdsp.h"
26
27 #include "checkasm.h"
28
29 #define LEN 512
30
31 2 static void test_inverse_coupling(void)
32 {
33 2 LOCAL_ALIGNED_16(float, src0, [LEN]);
34 2 LOCAL_ALIGNED_16(float, src1, [LEN]);
35 2 LOCAL_ALIGNED_16(float, cdst, [LEN]);
36 2 LOCAL_ALIGNED_16(float, odst, [LEN]);
37 2 LOCAL_ALIGNED_16(float, cdst1, [LEN]);
38 2 LOCAL_ALIGNED_16(float, odst1, [LEN]);
39
40 2 declare_func(void, float *restrict mag, float *restrict ang,
41 ptrdiff_t blocksize);
42
43 2 randomize_stddev(src0, LEN, 10.0);
44 2 randomize_stddev(src1, LEN, 10.0);
45
46 2 memcpy(cdst, src0, LEN * sizeof(*src0));
47 2 memcpy(cdst1, src1, LEN * sizeof(*src1));
48 2 memcpy(odst, src0, LEN * sizeof(*src0));
49 2 memcpy(odst1, src1, LEN * sizeof(*src1));
50
51
1/2
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 8 taken 2 times.
2 call_ref(cdst, cdst1, LEN);
52 2 call_new(odst, odst1, LEN);
53
2/2
✓ Branch 22 → 13 taken 1024 times.
✓ Branch 22 → 23 taken 2 times.
1026 for (int i = 0; i < LEN; i++) {
54
2/4
✓ Branch 14 → 15 taken 1024 times.
✗ Branch 14 → 17 not taken.
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 21 taken 1024 times.
2048 if (!float_near_abs_eps(cdst[i], odst[i], FLT_EPSILON) ||
55 1024 !float_near_abs_eps(cdst1[i], odst1[i], FLT_EPSILON)) {
56 ✗ fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n",
57 ✗ i, cdst[i], odst[i], cdst[i] - odst[i]);
58 ✗ fprintf(stderr, "%d: %- .12f - %- .12f = % .12g\n",
59 ✗ i, cdst1[i], odst1[i], cdst1[i] - odst1[i]);
60 ✗ fail();
61 ✗ break;
62 }
63 }
64
1/18
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 83 taken 2 times.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 70 not taken.
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 67 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 67 not taken.
✗ Branch 68 → 29 not taken.
✗ Branch 68 → 69 not taken.
✗ Branch 74 → 72 not taken.
✗ Branch 74 → 75 not taken.
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 78 not taken.
✗ Branch 80 → 26 not taken.
✗ Branch 80 → 81 not taken.
2 bench_new(src0, src1, LEN);
65 2 }
66
67 14 void checkasm_check_vorbisdsp(void)
68 {
69 VorbisDSPContext dsp;
70
71 14 ff_vorbisdsp_init(&dsp);
72
73
2/2
✓ Branch 4 → 5 taken 2 times.
✓ Branch 4 → 6 taken 12 times.
14 if (check_func(dsp.vorbis_inverse_coupling, "inverse_coupling"))
74 2 test_inverse_coupling();
75 14 report("inverse_coupling");
76 14 }
77