x86: swscale: Place inline assembly code under appropriate #ifdefs

Fixes compilation for compilers that do not support gcc inline assembly.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
pull/28/head
Ronald S. Bultje 13 years ago committed by Diego Biurrun
parent 5354a904fe
commit b2668c85e9
  1. 6
      libswscale/x86/rgb2rgb.c
  2. 6
      libswscale/x86/swscale_mmx.c
  3. 6
      libswscale/x86/yuv2rgb_mmx.c

@ -33,6 +33,8 @@
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#if HAVE_INLINE_ASM
DECLARE_ASM_CONST(8, uint64_t, mmx_ff) = 0x00000000000000FFULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_one) = 0xFFFFFFFFFFFFFFFFULL;
@ -123,8 +125,11 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
32-bit C version, and and&add trick by Michael Niedermayer
*/
#endif /* HAVE_INLINE_ASM */
void rgb2rgb_init_x86(void)
{
#if HAVE_INLINE_ASM
int cpu_flags = av_get_cpu_flags();
if (cpu_flags & AV_CPU_FLAG_MMX)
@ -135,4 +140,5 @@ void rgb2rgb_init_x86(void)
rgb2rgb_init_MMX2();
if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
rgb2rgb_init_SSE2();
#endif /* HAVE_INLINE_ASM */
}

@ -27,6 +27,8 @@
#include "libavutil/cpu.h"
#include "libavutil/pixdesc.h"
#if HAVE_INLINE_ASM
#define DITHER1XBPP
DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL;
@ -199,6 +201,8 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI
}
}
#endif /* HAVE_INLINE_ASM */
#define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
extern void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
SwsContext *c, int16_t *data, \
@ -300,12 +304,14 @@ void ff_sws_init_swScale_mmx(SwsContext *c)
{
int cpu_flags = av_get_cpu_flags();
#if HAVE_INLINE_ASM
if (cpu_flags & AV_CPU_FLAG_MMX)
sws_init_swScale_MMX(c);
#if HAVE_MMX2
if (cpu_flags & AV_CPU_FLAG_MMX2)
sws_init_swScale_MMX2(c);
#endif
#endif /* HAVE_INLINE_ASM */
#if HAVE_YASM
#define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \

@ -36,6 +36,8 @@
#include "libavutil/x86_cpu.h"
#include "libavutil/cpu.h"
#if HAVE_INLINE_ASM
#define DITHER1XBPP // only for MMX
/* hope these constant values are cache line aligned */
@ -64,8 +66,11 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
#include "yuv2rgb_template.c"
#endif /* HAVE_MMX2 */
#endif /* HAVE_INLINE_ASM */
SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
{
#if HAVE_INLINE_ASM
int cpu_flags = av_get_cpu_flags();
if (c->srcFormat != PIX_FMT_YUV420P &&
@ -103,6 +108,7 @@ SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
case PIX_FMT_RGB555: return yuv420_rgb15_MMX;
}
}
#endif /* HAVE_INLINE_ASM */
return NULL;
}

Loading…
Cancel
Save