FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/tests/checkasm/vf_pp7.c
Date: 2026-07-16 17:05:34
Exec Total Coverage
Lines: 16 17 94.1%
Functions: 2 2 100.0%
Branches: 8 26 30.8%

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 <assert.h>
20 #include <stddef.h>
21 #include <stdint.h>
22
23 #include "checkasm.h"
24 #include "libavfilter/vf_pp7dsp.h"
25 #include "libavutil/intreadwrite.h"
26 #include "libavutil/mem_internal.h"
27
28 #define randomize_buffer(buf) \
29 do { \
30 static_assert(!(sizeof(buf) % 4), "Tail handling needed"); \
31 for (size_t k = 0; k < sizeof(buf); k += 4) { \
32 AV_WN32A((char*)buf + k, rnd()); \
33 } \
34 } while (0)
35
36 14 static void check_dctB(const PP7DSPContext *const pp7dsp)
37 {
38 14 declare_func(void, int16_t *dst, const int16_t *src);
39
40
2/2
✓ Branch 1 taken 12 times.
✓ Branch 2 taken 2 times.
14 if (!check_func(pp7dsp->dctB, "dctB"))
41 12 return;
42
43 DECLARE_ALIGNED(8, int16_t, src)[7 * 4];
44 DECLARE_ALIGNED(8, int16_t, dst_ref)[6 * 4];
45 DECLARE_ALIGNED(8, int16_t, dst_new)[6 * 4];
46
47
2/2
✓ Branch 1 taken 28 times.
✓ Branch 2 taken 2 times.
30 randomize_buffer(src);
48
2/2
✓ Branch 1 taken 24 times.
✓ Branch 2 taken 2 times.
26 randomize_buffer(dst_ref);
49 2 memcpy(dst_new, dst_ref, sizeof(dst_new));
50 2 call_ref(dst_ref, src);
51 2 call_new(dst_new, src);
52
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (memcmp(dst_new, dst_ref, sizeof(dst_new)))
53 fail();
54
55
1/18
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
2 bench_new(dst_new, src);
56 }
57
58 14 void checkasm_check_vf_pp7(void)
59 {
60 PP7DSPContext pp7dsp;
61
62 14 ff_pp7dsp_init(&pp7dsp);
63
64 14 check_dctB(&pp7dsp);
65 14 report("dctB");
66 14 }
67