Showing the changes to libavfilter (2 of 2 files). Show all
Unified · Split
| @@ -26,18 +26,22 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | %include "libavutil/x86/x86util.asm" |
| 28 | 28 | |
| 29 | −SECTION_RODATA | |
| 29 | +SECTION_RODATA 32 | |
| 30 | 30 | |
| 31 | −pw_coefhf: times 4 dw 1016, 5570 | |
| 32 | −pw_coefhf1: times 8 dw -3801 | |
| 33 | −pw_coefsp: times 4 dw 5077, -981 | |
| 34 | −pw_splfdif: times 4 dw -768, 768 | |
| 31 | +pw_coefhf: times 8 dw 1016, 5570 | |
| 32 | +pw_coefhf1: times 16 dw -3801 | |
| 33 | +pw_coefsp: times 8 dw 5077, -981 | |
| 34 | +pw_splfdif: times 8 dw -768, 768 | |
| 35 | 35 | |
| 36 | 36 | SECTION .text |
| 37 | 37 | |
| 38 | 38 | %macro LOAD8 2 |
| 39 | + %if mmsize == 32 | |
| 40 | + pmovzxbw %1, %2 | |
| 41 | + %else | |
| 39 | 42 | movh %1, %2 |
| 40 | 43 | punpcklbw %1, m7 |
| 44 | + %endif | |
| 41 | 45 | %endmacro |
| 42 | 46 | |
| 43 | 47 | %macro LOAD12 2 |
| @@ -45,8 +49,14 @@ SECTION .text · 1 unmodified line | ||
| 45 | 49 | %endmacro |
| 46 | 50 | |
| 47 | 51 | %macro DISP8 0 |
| 52 | + %if mmsize == 32 | |
| 53 | + vextracti128 xm1, m2, 1 | |
| 54 | + packuswb xm2, xm1 | |
| 55 | + movu [dstq], xm2 | |
| 56 | + %else | |
| 48 | 57 | packuswb m2, m2 |
| 49 | 58 | movh [dstq], m2 |
| 59 | + %endif | |
| 50 | 60 | %endmacro |
| 51 | 61 | |
| 52 | 62 | %macro DISP12 0 |
| @@ -244,8 +254,12 @@ cglobal bwdif_filter_line_12bit, 4, 9, 13, 0, dst, prev, cur, next, w, \ · 191 unmodified lines | ||
| 244 | 254 | prefs, mrefs, prefs2, mrefs2, \ |
| 245 | 255 | prefs3, mrefs3, prefs4, \ |
| 246 | 256 | mrefs4, parity, clip_max |
| 257 | + %if mmsize == 32 | |
| 258 | + vpbroadcastw m12, WORD clip_maxm | |
| 259 | + %else | |
| 247 | 260 | movd m12, DWORD clip_maxm |
| 248 | 261 | SPLATW m12, m12, 0 |
| 262 | + %endif | |
| 249 | 263 | %else |
| 250 | 264 | cglobal bwdif_filter_line_12bit, 4, 6, 8, 80, dst, prev, cur, next, w, \ |
| 251 | 265 | prefs, mrefs, prefs2, mrefs2, \ |
| @@ -264,3 +278,8 @@ INIT_XMM ssse3 · 12 unmodified lines | ||
| 264 | 278 | BWDIF |
| 265 | 279 | INIT_XMM sse2 |
| 266 | 280 | BWDIF |
| 281 | + | |
| 282 | +%if HAVE_AVX2_EXTERNAL && ARCH_X86_64 | |
| 283 | +INIT_YMM avx2 | |
| 284 | +BWDIF | |
| 285 | +%endif | |
| @@ -32,6 +32,10 @@ void ff_bwdif_filter_line_ssse3(void *dst, void *prev, void *cur, void *next, · 31 unmodified lines | ||
| 32 | 32 | int w, int prefs, int mrefs, int prefs2, |
| 33 | 33 | int mrefs2, int prefs3, int mrefs3, int prefs4, |
| 34 | 34 | int mrefs4, int parity, int clip_max); |
| 35 | +void ff_bwdif_filter_line_avx2(void *dst, void *prev, void *cur, 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); | |
| 35 | 39 | |
| 36 | 40 | void ff_bwdif_filter_line_12bit_sse2(void *dst, void *prev, void *cur, void *next, |
| 37 | 41 | int w, int prefs, int mrefs, int prefs2, |
| @@ -41,6 +45,10 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne · 3 unmodified lines | ||
| 41 | 45 | int w, int prefs, int mrefs, int prefs2, |
| 42 | 46 | int mrefs2, int prefs3, int mrefs3, int prefs4, |
| 43 | 47 | int mrefs4, int parity, int clip_max); |
| 48 | +void ff_bwdif_filter_line_12bit_avx2(void *dst, void *prev, void *cur, 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); | |
| 44 | 52 | |
| 45 | 53 | av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif, int bit_depth) |
| 46 | 54 | { |
| @@ -51,10 +59,14 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif, int bit_depth) · 4 unmodified lines | ||
| 51 | 59 | bwdif->filter_line = ff_bwdif_filter_line_sse2; |
| 52 | 60 | if (EXTERNAL_SSSE3(cpu_flags)) |
| 53 | 61 | bwdif->filter_line = ff_bwdif_filter_line_ssse3; |
| 62 | + if (ARCH_X86_64 && EXTERNAL_AVX2(cpu_flags)) | |
| 63 | + bwdif->filter_line = ff_bwdif_filter_line_avx2; | |
| 54 | 64 | } else if (bit_depth <= 12) { |
| 55 | 65 | if (EXTERNAL_SSE2(cpu_flags)) |
| 56 | 66 | bwdif->filter_line = ff_bwdif_filter_line_12bit_sse2; |
| 57 | 67 | if (EXTERNAL_SSSE3(cpu_flags)) |
| 58 | 68 | bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3; |
| 69 | + if (ARCH_X86_64 && EXTERNAL_AVX2(cpu_flags)) | |
| 70 | + bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2; | |
| 59 | 71 | } |
| 60 | 72 | } |