FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavfilter/x86/vf_bwdif_init.c
Date: 2026-09-04 04:29:05
Exec Total Coverage
Lines: 19 21 90.5%
Functions: 1 1 100.0%
Branches: 19 24 79.2%

Line Branch Exec Source
1 /*
2 * Copyright (C) 2016 Thomas Mundt <loudmax@yahoo.de>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "libavutil/attributes.h"
22 #include "libavutil/cpu.h"
23 #include "libavutil/x86/cpu.h"
24 #include "libavfilter/bwdifdsp.h"
25
26 void ff_bwdif_filter_line_sse2(void *dst, const void *prev, const void *cur, const void *next,
27 int w, int prefs, int mrefs, int prefs2,
28 int mrefs2, int prefs3, int mrefs3, int prefs4,
29 int mrefs4, int parity, int clip_max);
30 void ff_bwdif_filter_line_ssse3(void *dst, const void *prev, const void *cur, const void *next,
31 int w, int prefs, int mrefs, int prefs2,
32 int mrefs2, int prefs3, int mrefs3, int prefs4,
33 int mrefs4, int parity, int clip_max);
34 void ff_bwdif_filter_line_avx2(void *dst, const void *prev, const void *cur, const void *next,
35 int w, int prefs, int mrefs, int prefs2,
36 int mrefs2, int prefs3, int mrefs3, int prefs4,
37 int mrefs4, int parity, int clip_max);
38 void ff_bwdif_filter_line_avx512icl(void *dst, const void *prev, const void *cur, const void *next,
39 int w, int prefs, int mrefs, int prefs2,
40 int mrefs2, int prefs3, int mrefs3, int prefs4,
41 int mrefs4, int parity, int clip_max);
42
43 void ff_bwdif_filter_line_12bit_sse2(void *dst, const void *prev, const void *cur, const void *next,
44 int w, int prefs, int mrefs, int prefs2,
45 int mrefs2, int prefs3, int mrefs3, int prefs4,
46 int mrefs4, int parity, int clip_max);
47 void ff_bwdif_filter_line_12bit_ssse3(void *dst, const void *prev, const void *cur, const void *next,
48 int w, int prefs, int mrefs, int prefs2,
49 int mrefs2, int prefs3, int mrefs3, int prefs4,
50 int mrefs4, int parity, int clip_max);
51 void ff_bwdif_filter_line_12bit_avx2(void *dst, const void *prev, const void *cur, const void *next,
52 int w, int prefs, int mrefs, int prefs2,
53 int mrefs2, int prefs3, int mrefs3, int prefs4,
54 int mrefs4, int parity, int clip_max);
55 void ff_bwdif_filter_line_12bit_avx512icl(void *dst, const void *prev, const void *cur, const void *next,
56 int w, int prefs, int mrefs, int prefs2,
57 int mrefs2, int prefs3, int mrefs3, int prefs4,
58 int mrefs4, int parity, int clip_max);
59
60 31 av_cold void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth)
61 {
62 31 int cpu_flags = av_get_cpu_flags();
63
64
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 15 times.
31 if (bit_depth <= 8) {
65
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 6 times.
16 if (EXTERNAL_SSE2(cpu_flags))
66 10 bwdif->filter_line = ff_bwdif_filter_line_sse2;
67
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 8 times.
16 if (EXTERNAL_SSSE3(cpu_flags))
68 8 bwdif->filter_line = ff_bwdif_filter_line_ssse3;
69 #if ARCH_X86_64
70
3/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 15 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
16 if (EXTERNAL_AVX2_FAST(cpu_flags))
71 1 bwdif->filter_line = ff_bwdif_filter_line_avx2;
72
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
16 if (EXTERNAL_AVX512ICL(cpu_flags))
73 bwdif->filter_line = ff_bwdif_filter_line_avx512icl;
74 #endif
75
1/2
✓ Branch 0 taken 15 times.
✗ Branch 1 not taken.
15 } else if (bit_depth <= 12) {
76
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 5 times.
15 if (EXTERNAL_SSE2(cpu_flags))
77 10 bwdif->filter_line = ff_bwdif_filter_line_12bit_sse2;
78
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 7 times.
15 if (EXTERNAL_SSSE3(cpu_flags))
79 8 bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3;
80 #if ARCH_X86_64
81
3/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 14 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
15 if (EXTERNAL_AVX2_FAST(cpu_flags))
82 1 bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2;
83
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
15 if (EXTERNAL_AVX512ICL(cpu_flags))
84 bwdif->filter_line = ff_bwdif_filter_line_12bit_avx512icl;
85 #endif
86 }
87 31 }
88