Commit 4729b529 authored by Michael Niedermayer's avatar Michael Niedermayer

swscale/x86/rgb2rgb: extend framework to also include AVX

This does not yet include any actual AVX code
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 94d7ca2b
...@@ -91,6 +91,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; ...@@ -91,6 +91,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL;
#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_AMD3DNOW 0 #define COMPILE_TEMPLATE_AMD3DNOW 0
#define COMPILE_TEMPLATE_SSE2 0 #define COMPILE_TEMPLATE_SSE2 0
#define COMPILE_TEMPLATE_AVX 0
//MMX versions //MMX versions
#undef RENAME #undef RENAME
...@@ -111,10 +112,18 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; ...@@ -111,10 +112,18 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL;
#define RENAME(a) a ## _SSE2 #define RENAME(a) a ## _SSE2
#include "rgb2rgb_template.c" #include "rgb2rgb_template.c"
//AVX versions
#undef RENAME
#undef COMPILE_TEMPLATE_AVX
#define COMPILE_TEMPLATE_AVX 1
#define RENAME(a) a ## _AVX
#include "rgb2rgb_template.c"
//3DNOW versions //3DNOW versions
#undef RENAME #undef RENAME
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
#undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_AVX
#undef COMPILE_TEMPLATE_AMD3DNOW #undef COMPILE_TEMPLATE_AMD3DNOW
#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 0 #define COMPILE_TEMPLATE_SSE2 0
...@@ -144,5 +153,7 @@ av_cold void rgb2rgb_init_x86(void) ...@@ -144,5 +153,7 @@ av_cold void rgb2rgb_init_x86(void)
rgb2rgb_init_MMXEXT(); rgb2rgb_init_MMXEXT();
if (INLINE_SSE2(cpu_flags)) if (INLINE_SSE2(cpu_flags))
rgb2rgb_init_SSE2(); rgb2rgb_init_SSE2();
if (INLINE_AVX(cpu_flags))
rgb2rgb_init_AVX();
#endif /* HAVE_INLINE_ASM */ #endif /* HAVE_INLINE_ASM */
} }
...@@ -1854,7 +1854,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ ...@@ -1854,7 +1854,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
#endif /* HAVE_7REGS */ #endif /* HAVE_7REGS */
#endif /* !COMPILE_TEMPLATE_SSE2 */ #endif /* !COMPILE_TEMPLATE_SSE2 */
#if !COMPILE_TEMPLATE_AMD3DNOW #if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest,
int width, int height, int src1Stride, int width, int height, int src1Stride,
int src2Stride, int dstStride) int src2Stride, int dstStride)
...@@ -2494,7 +2494,7 @@ static av_cold void RENAME(rgb2rgb_init)(void) ...@@ -2494,7 +2494,7 @@ static av_cold void RENAME(rgb2rgb_init)(void)
uyvytoyuv420 = RENAME(uyvytoyuv420); uyvytoyuv420 = RENAME(uyvytoyuv420);
#endif /* !COMPILE_TEMPLATE_SSE2 */ #endif /* !COMPILE_TEMPLATE_SSE2 */
#if !COMPILE_TEMPLATE_AMD3DNOW #if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX
interleaveBytes = RENAME(interleaveBytes); interleaveBytes = RENAME(interleaveBytes);
#endif /* !COMPILE_TEMPLATE_AMD3DNOW */ #endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX*/
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment