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
8989 #define COMPILE_TEMPLATE_MMXEXT 0
9090 #define COMPILE_TEMPLATE_AMD3DNOW 0
9191 #define COMPILE_TEMPLATE_SSE2 0
92+#define COMPILE_TEMPLATE_AVX 0
9293
9394 //MMX versions
9495 #undef RENAME
@@ -109,10 +110,18 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; · 14 unmodified lines
109110 #define RENAME(a) a ## _sse2
110111 #include "rgb2rgb_template.c"
111112
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+
112120 //3DNOW versions
113121 #undef RENAME
114122 #undef COMPILE_TEMPLATE_MMXEXT
115123 #undef COMPILE_TEMPLATE_SSE2
124+#undef COMPILE_TEMPLATE_AVX
116125 #undef COMPILE_TEMPLATE_AMD3DNOW
117126 #define COMPILE_TEMPLATE_MMXEXT 0
118127 #define COMPILE_TEMPLATE_SSE2 0
@@ -142,5 +151,7 @@ av_cold void rgb2rgb_init_x86(void) · 23 unmodified lines
142151 rgb2rgb_init_mmxext();
143152 if (INLINE_SSE2(cpu_flags))
144153 rgb2rgb_init_sse2();
154+ if (INLINE_AVX(cpu_flags))
155+ rgb2rgb_init_avx();
145156 #endif /* HAVE_INLINE_ASM */
146157 }
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
18711871 }
18721872 #endif /* !COMPILE_TEMPLATE_SSE2 */
18731873
1874−#if !COMPILE_TEMPLATE_AMD3DNOW
1874+#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
18751875 static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,
18761876 int width, int height, int src1Stride,
18771877 int src2Stride, int dstStride)
@@ -1941,7 +1941,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui · 63 unmodified lines
19411941 ::: "memory"
19421942 );
19431943 }
1944−#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
1944+#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
19451945
19461946 #if !COMPILE_TEMPLATE_SSE2
19471947 #if !COMPILE_TEMPLATE_AMD3DNOW
@@ -2509,7 +2509,7 @@ static av_cold void RENAME(rgb2rgb_init)(void) · 561 unmodified lines
25092509 uyvytoyuv420 = RENAME(uyvytoyuv420);
25102510 #endif /* !COMPILE_TEMPLATE_SSE2 */
25112511
2512−#if !COMPILE_TEMPLATE_AMD3DNOW
2512+#if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
25132513 interleaveBytes = RENAME(interleaveBytes);
2514−#endif /* !COMPILE_TEMPLATE_AMD3DNOW */
2514+#endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */
25152515 }

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