summaryrefslogtreecommitdiff
path: root/libswscale/x86/yuv2rgb_template.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-05-24 10:03:26 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2011-05-24 10:03:26 -0400
commite66149e714006d099d1ebfcca3f22ca74fc7dcf4 (patch)
tree4be376903a92797c2c9f3c7e560a7c21247ace19 /libswscale/x86/yuv2rgb_template.c
parent75abcdb3915e3abb2dc6b5f7d101c177dcfdb626 (diff)
swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*.
Diffstat (limited to 'libswscale/x86/yuv2rgb_template.c')
-rw-r--r--libswscale/x86/yuv2rgb_template.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/libswscale/x86/yuv2rgb_template.c b/libswscale/x86/yuv2rgb_template.c
index cf8f0d3cfb..5d1fa5b309 100644
--- a/libswscale/x86/yuv2rgb_template.c
+++ b/libswscale/x86/yuv2rgb_template.c
@@ -25,14 +25,7 @@
#undef EMMS
#undef SFENCE
-#if HAVE_AMD3DNOW
-/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
-#define EMMS "femms"
-#else
-#define EMMS "emms"
-#endif
-
-#if HAVE_MMX2
+#if COMPILE_TEMPLATE_MMX2
#define MOVNTQ "movntq"
#define SFENCE "sfence"
#else
@@ -159,7 +152,8 @@
} \
#define YUV2RGB_ENDFUNC \
- __asm__ volatile (SFENCE"\n\t"EMMS); \
+ __asm__ volatile (SFENCE"\n\t" \
+ "emms \n\t"); \
return srcSliceH; \
#define IF0(x)
@@ -188,6 +182,7 @@
"paddusb "GREEN_DITHER"(%4), %%mm2\n\t" \
"paddusb "RED_DITHER"(%4), %%mm1\n\t" \
+#if !COMPILE_TEMPLATE_MMX2
static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t *src[],
int srcStride[],
int srcSliceY, int srcSliceH,
@@ -243,6 +238,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[],
YUV2RGB_OPERANDS
YUV2RGB_ENDFUNC
}
+#endif /* !COMPILE_TEMPLATE_MMX2 */
#define RGB_PACK24(blue, red)\
"packuswb %%mm3, %%mm0 \n" /* R0 R2 R4 R6 R1 R3 R5 R7 */\
@@ -259,7 +255,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[],
"punpckhwd %%mm6, %%mm5 \n" /* R4 G4 B4 R5 R6 G6 B6 R7 */\
RGB_PACK24_B
-#if HAVE_MMX2
+#if COMPILE_TEMPLATE_MMX2
DECLARE_ASM_CONST(8, int16_t, mask1101[4]) = {-1,-1, 0,-1};
DECLARE_ASM_CONST(8, int16_t, mask0010[4]) = { 0, 0,-1, 0};
DECLARE_ASM_CONST(8, int16_t, mask0110[4]) = { 0,-1,-1, 0};
@@ -366,6 +362,7 @@ static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[],
MOVNTQ " %%mm5, 16(%1)\n\t" \
MOVNTQ " %%mm"alpha", 24(%1)\n\t" \
+#if !COMPILE_TEMPLATE_MMX2
static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t *src[],
int srcStride[],
int srcSliceY, int srcSliceH,
@@ -386,12 +383,12 @@ static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t *src[],
YUV2RGB_ENDFUNC
}
+#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
static inline int RENAME(yuva420_rgb32)(SwsContext *c, const uint8_t *src[],
int srcStride[],
int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
-#if HAVE_7REGS
int y, h_size;
YUV2RGB_LOOP(4)
@@ -406,10 +403,8 @@ static inline int RENAME(yuva420_rgb32)(SwsContext *c, const uint8_t *src[],
YUV2RGB_ENDLOOP(4)
YUV2RGB_OPERANDS_ALPHA
YUV2RGB_ENDFUNC
-#else
- return 0;
-#endif
}
+#endif
static inline int RENAME(yuv420_bgr32)(SwsContext *c, const uint8_t *src[],
int srcStride[],
@@ -431,12 +426,12 @@ static inline int RENAME(yuv420_bgr32)(SwsContext *c, const uint8_t *src[],
YUV2RGB_ENDFUNC
}
+#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[],
int srcStride[],
int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
-#if HAVE_7REGS
int y, h_size;
YUV2RGB_LOOP(4)
@@ -451,7 +446,7 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[],
YUV2RGB_ENDLOOP(4)
YUV2RGB_OPERANDS_ALPHA
YUV2RGB_ENDFUNC
-#else
- return 0;
-#endif
}
+#endif
+
+#endif /* !COMPILE_TEMPLATE_MMX2 */