FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/tests/checkasm/vf_idet.c
Date: 2026-04-24 19:58:39
Exec Total Coverage
Lines: 22 24 91.7%
Functions: 2 2 100.0%
Branches: 6 14 42.9%

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 "checkasm.h"
20
21 #include "libavfilter/vf_idetdsp.h"
22 #include "libavutil/mem_internal.h"
23
24 #define WIDTH 512
25
26 28 static void check_idet(int depth)
27 {
28 IDETDSPContext dsp;
29
30 28 LOCAL_ALIGNED_32(uint8_t, in0, [WIDTH]);
31 28 LOCAL_ALIGNED_32(uint8_t, in1, [WIDTH]);
32 28 LOCAL_ALIGNED_32(uint8_t, in2, [WIDTH]);
33
34 28 declare_func(int, const uint8_t *a, const uint8_t *b,
35 const uint8_t *c, int w);
36
37 28 ff_idet_dsp_init(&dsp, depth > 8);
38
39
2/2
✓ Branch 0 taken 14336 times.
✓ Branch 1 taken 28 times.
14364 for (int x = 0; x < WIDTH; x++) {
40 14336 in0[x] = rnd() & 0xFF;
41 14336 in1[x] = rnd() & 0xFF;
42 14336 in2[x] = rnd() & 0xFF;
43 }
44
45
2/2
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 22 times.
28 if (check_func(dsp.filter_line, "idet%d", depth)) {
46 /* Ensure odd tail is handled correctly */
47 6 int res_ref = call_ref(in0, in1, in2, WIDTH - 8);
48 6 int res_new = call_new(in0, in1, in2, WIDTH - 8);
49
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
6 if (res_ref != res_new) {
50 fprintf(stderr, "idet%d: result mismatch: %u != %u\n",
51 depth, res_ref, res_new);
52 fail();
53 }
54
1/8
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
6 bench_new(in0, in1, in2, WIDTH);
55 }
56 28 }
57
58 14 void checkasm_check_idet(void)
59 {
60 14 check_idet(8);
61 14 report("idet8");
62
63 14 check_idet(16);
64 14 report("idet16");
65 14 }
66