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/asm.h" | ||
24 | #include "libavutil/x86/cpu.h" | ||
25 | #include "libavfilter/bwdifdsp.h" | ||
26 | |||
27 | void ff_bwdif_filter_line_sse2(void *dst, const void *prev, const void *cur, const void *next, | ||
28 | int w, int prefs, int mrefs, int prefs2, | ||
29 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
30 | int mrefs4, int parity, int clip_max); | ||
31 | void ff_bwdif_filter_line_ssse3(void *dst, const void *prev, const void *cur, const void *next, | ||
32 | int w, int prefs, int mrefs, int prefs2, | ||
33 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
34 | int mrefs4, int parity, int clip_max); | ||
35 | void ff_bwdif_filter_line_avx2(void *dst, const void *prev, const void *cur, const void *next, | ||
36 | int w, int prefs, int mrefs, int prefs2, | ||
37 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
38 | int mrefs4, int parity, int clip_max); | ||
39 | |||
40 | void ff_bwdif_filter_line_12bit_sse2(void *dst, const void *prev, const void *cur, const void *next, | ||
41 | int w, int prefs, int mrefs, int prefs2, | ||
42 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
43 | int mrefs4, int parity, int clip_max); | ||
44 | void ff_bwdif_filter_line_12bit_ssse3(void *dst, const void *prev, const void *cur, const void *next, | ||
45 | int w, int prefs, int mrefs, int prefs2, | ||
46 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
47 | int mrefs4, int parity, int clip_max); | ||
48 | void ff_bwdif_filter_line_12bit_avx2(void *dst, const void *prev, const void *cur, const void *next, | ||
49 | int w, int prefs, int mrefs, int prefs2, | ||
50 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
51 | int mrefs4, int parity, int clip_max); | ||
52 | |||
53 | 29 | av_cold void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth) | |
54 | { | ||
55 | 29 | int cpu_flags = av_get_cpu_flags(); | |
56 | |||
57 |
2/2✓ Branch 0 taken 15 times.
✓ Branch 1 taken 14 times.
|
29 | if (bit_depth <= 8) { |
58 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 6 times.
|
15 | if (EXTERNAL_SSE2(cpu_flags)) |
59 | 9 | bwdif->filter_line = ff_bwdif_filter_line_sse2; | |
60 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 8 times.
|
15 | if (EXTERNAL_SSSE3(cpu_flags)) |
61 | 7 | bwdif->filter_line = ff_bwdif_filter_line_ssse3; | |
62 |
3/4✓ Branch 0 taken 1 times.
✓ Branch 1 taken 14 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
15 | if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags)) |
63 | 1 | bwdif->filter_line = ff_bwdif_filter_line_avx2; | |
64 |
1/2✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
|
14 | } else if (bit_depth <= 12) { |
65 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 5 times.
|
14 | if (EXTERNAL_SSE2(cpu_flags)) |
66 | 9 | bwdif->filter_line = ff_bwdif_filter_line_12bit_sse2; | |
67 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 7 times.
|
14 | if (EXTERNAL_SSSE3(cpu_flags)) |
68 | 7 | bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3; | |
69 |
3/4✓ Branch 0 taken 1 times.
✓ Branch 1 taken 13 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
14 | if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags)) |
70 | 1 | bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2; | |
71 | } | ||
72 | 29 | } | |
73 |