History

swscale/x86/rgb2rgb: add support for AVX

This does not yet include any actual AVX code

Michael Niedermayer committed 12 years ago

Commit 7597e6e1 parent 90474912 files · +15 −4Browse files

Unified · Split

2 files
  1. libswscale/x86/rgb2rgb.c +11 −0
  2. libswscale/x86/rgb2rgb_template.c +4 −4
libswscale/x86/rgb2rgb.c+11−0
@@ -89,6 +89,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; · 88 unmodified lines
89#define COMPILE_TEMPLATE_MMXEXT 089#define COMPILE_TEMPLATE_MMXEXT 0
90#define COMPILE_TEMPLATE_AMD3DNOW 090#define COMPILE_TEMPLATE_AMD3DNOW 0
91#define COMPILE_TEMPLATE_SSE2 091#define COMPILE_TEMPLATE_SSE2 0
92#define COMPILE_TEMPLATE_AVX 0
92 93
93//MMX versions94//MMX versions
94#undef RENAME95#undef RENAME
@@ -109,10 +110,18 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; · 14 unmodified lines
109#define RENAME(a) a ## _sse2110#define RENAME(a) a ## _sse2
110#include "rgb2rgb_template.c"111#include "rgb2rgb_template.c"
111 112
113//AVX versions
114#undef RENAME
115#undef COMPILE_TEMPLATE_AVX
116#define COMPILE_TEMPLATE_AVX 1
117#define RENAME(a) a ## _avx
118#include "rgb2rgb_template.c"
119
112//3DNOW versions120//3DNOW versions
113#undef RENAME121#undef RENAME
114#undef COMPILE_TEMPLATE_MMXEXT122#undef COMPILE_TEMPLATE_MMXEXT
115#undef COMPILE_TEMPLATE_SSE2123#undef COMPILE_TEMPLATE_SSE2
124#undef COMPILE_TEMPLATE_AVX
116#undef COMPILE_TEMPLATE_AMD3DNOW125#undef COMPILE_TEMPLATE_AMD3DNOW
117#define COMPILE_TEMPLATE_MMXEXT 0126#define COMPILE_TEMPLATE_MMXEXT 0
118#define COMPILE_TEMPLATE_SSE2 0127#define COMPILE_TEMPLATE_SSE2 0
@@ -142,5 +151,7 @@ av_cold void rgb2rgb_init_x86(void) · 23 unmodified lines
142 rgb2rgb_init_mmxext();151 rgb2rgb_init_mmxext();
143 if (INLINE_SSE2(cpu_flags))152 if (INLINE_SSE2(cpu_flags))
144 rgb2rgb_init_sse2();153 rgb2rgb_init_sse2();
154 if (INLINE_AVX(cpu_flags))
155 rgb2rgb_init_avx();
145#endif /* HAVE_INLINE_ASM */156#endif /* HAVE_INLINE_ASM */
146}157}
libswscale/x86/rgb2rgb_template.c+4−4
@@ -1871,7 +1871,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ · 1870 unmodified lines
1871}1871}
1872#endif /* !COMPILE_TEMPLATE_SSE2 */1872#endif /* !COMPILE_TEMPLATE_SSE2 */
1873 1873
1874#if !COMPILE_TEMPLATE_AMD3DNOW1874#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
1875static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,1875static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,
1876 int width, int height, int src1Stride,1876 int width, int height, int src1Stride,
1877 int src2Stride, int dstStride)1877 int src2Stride, int dstStride)
@@ -1941,7 +1941,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui · 63 unmodified lines
1941 ::: "memory"1941 ::: "memory"
1942 );1942 );
1943}1943}
1944#endif /* !COMPILE_TEMPLATE_AMD3DNOW */1944#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
1945 1945
1946#if !COMPILE_TEMPLATE_SSE21946#if !COMPILE_TEMPLATE_SSE2
1947#if !COMPILE_TEMPLATE_AMD3DNOW1947#if !COMPILE_TEMPLATE_AMD3DNOW
@@ -2509,7 +2509,7 @@ static av_cold void RENAME(rgb2rgb_init)(void) · 561 unmodified lines
2509 uyvytoyuv420 = RENAME(uyvytoyuv420);2509 uyvytoyuv420 = RENAME(uyvytoyuv420);
2510#endif /* !COMPILE_TEMPLATE_SSE2 */2510#endif /* !COMPILE_TEMPLATE_SSE2 */
2511 2511
2512#if !COMPILE_TEMPLATE_AMD3DNOW2512#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
2513 interleaveBytes = RENAME(interleaveBytes);2513 interleaveBytes = RENAME(interleaveBytes);
2514#endif /* !COMPILE_TEMPLATE_AMD3DNOW */2514#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
2515}2515}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t