Commit 539ff40c authored by Ramiro Polla's avatar Ramiro Polla
Browse files

rgb2rgb: build SSE2 codepath

Originally committed as revision 32068 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent ccf22d3e
......@@ -49,6 +49,7 @@ static const AVOption options[] = {
{ "accurate_rnd", "accurate rounding", 0, FF_OPT_TYPE_CONST, SWS_ACCURATE_RND, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "mmx", "MMX SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_MMX, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "mmx2", "MMX2 SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_MMX2, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "sse2", "SSE2 SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_SSE2, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "3dnow", "3DNOW SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_3DNOW, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "altivec", "AltiVec SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_ALTIVEC, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "bfin", "Blackfin SIMD acceleration", 0, FF_OPT_TYPE_CONST, SWS_CPU_CAPS_BFIN, INT_MIN, INT_MAX, VE, "sws_flags" },
......
......@@ -175,11 +175,20 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
#define RENAME(a) a ## _MMX2
#include "rgb2rgb_template.c"
//SSE2 versions
#undef RENAME
#undef HAVE_SSE2
#define HAVE_SSE2 1
#define RENAME(a) a ## _SSE2
#include "rgb2rgb_template.c"
//3DNOW versions
#undef RENAME
#undef HAVE_MMX2
#undef HAVE_SSE2
#undef HAVE_AMD3DNOW
#define HAVE_MMX2 0
#define HAVE_SSE2 0
#define HAVE_AMD3DNOW 1
#define RENAME(a) a ## _3DNOW
#include "rgb2rgb_template.c"
......@@ -196,7 +205,9 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
void sws_rgb2rgb_init(int flags)
{
#if HAVE_MMX2 || HAVE_AMD3DNOW || HAVE_MMX
if (flags & SWS_CPU_CAPS_MMX2)
if (flags & SWS_CPU_CAPS_SSE2)
rgb2rgb_init_SSE2();
else if (flags & SWS_CPU_CAPS_MMX2)
rgb2rgb_init_MMX2();
else if (flags & SWS_CPU_CAPS_3DNOW)
rgb2rgb_init_3DNOW();
......
......@@ -92,6 +92,7 @@ const char *swscale_license(void);
#define SWS_CPU_CAPS_3DNOW 0x40000000
#define SWS_CPU_CAPS_ALTIVEC 0x10000000
#define SWS_CPU_CAPS_BFIN 0x01000000
#define SWS_CPU_CAPS_SSE2 0x02000000
#define SWS_MAX_REDUCE_CUTOFF 0.002
......
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