| 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 | void ff_bwdif_filter_line_avx512icl(void *dst, const void *prev, const void *cur, const void *next, | ||
| 40 | int w, int prefs, int mrefs, int prefs2, | ||
| 41 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
| 42 | int mrefs4, int parity, int clip_max); | ||
| 43 | |||
| 44 | void ff_bwdif_filter_line_12bit_sse2(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_ssse3(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 | void ff_bwdif_filter_line_12bit_avx2(void *dst, const void *prev, const void *cur, const void *next, | ||
| 53 | int w, int prefs, int mrefs, int prefs2, | ||
| 54 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
| 55 | int mrefs4, int parity, int clip_max); | ||
| 56 | void ff_bwdif_filter_line_12bit_avx512icl(void *dst, const void *prev, const void *cur, const void *next, | ||
| 57 | int w, int prefs, int mrefs, int prefs2, | ||
| 58 | int mrefs2, int prefs3, int mrefs3, int prefs4, | ||
| 59 | int mrefs4, int parity, int clip_max); | ||
| 60 | |||
| 61 | 29 | av_cold void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth) | |
| 62 | { | ||
| 63 | 29 | int cpu_flags = av_get_cpu_flags(); | |
| 64 | |||
| 65 |
2/2✓ Branch 0 taken 15 times.
✓ Branch 1 taken 14 times.
|
29 | if (bit_depth <= 8) { |
| 66 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 6 times.
|
15 | if (EXTERNAL_SSE2(cpu_flags)) |
| 67 | 9 | bwdif->filter_line = ff_bwdif_filter_line_sse2; | |
| 68 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 8 times.
|
15 | if (EXTERNAL_SSSE3(cpu_flags)) |
| 69 | 7 | bwdif->filter_line = ff_bwdif_filter_line_ssse3; | |
| 70 |
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)) |
| 71 | 1 | bwdif->filter_line = ff_bwdif_filter_line_avx2; | |
| 72 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
|
15 | if (ARCH_X86_64 && EXTERNAL_AVX512ICL(cpu_flags)) |
| 73 | ✗ | bwdif->filter_line = ff_bwdif_filter_line_avx512icl; | |
| 74 |
1/2✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
|
14 | } else if (bit_depth <= 12) { |
| 75 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 5 times.
|
14 | if (EXTERNAL_SSE2(cpu_flags)) |
| 76 | 9 | bwdif->filter_line = ff_bwdif_filter_line_12bit_sse2; | |
| 77 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 7 times.
|
14 | if (EXTERNAL_SSSE3(cpu_flags)) |
| 78 | 7 | bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3; | |
| 79 |
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)) |
| 80 | 1 | bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2; | |
| 81 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
|
14 | if (ARCH_X86_64 && EXTERNAL_AVX512ICL(cpu_flags)) |
| 82 | ✗ | bwdif->filter_line = ff_bwdif_filter_line_12bit_avx512icl; | |
| 83 | } | ||
| 84 | 29 | } | |
| 85 |