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