Commit 31248865 authored by Ronald S. Bultje's avatar Ronald S. Bultje

lavfi: place x86 inline assembly under HAVE_INLINE_ASM.

This allows compiling this code using compilers that do not understand
gcc-style inline assembly.
parent 8d2e3fee
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include "libavutil/x86_cpu.h" #include "libavutil/x86_cpu.h"
#include "libavfilter/gradfun.h" #include "libavfilter/gradfun.h"
#if HAVE_INLINE_ASM
DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F}; DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F};
DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
...@@ -164,10 +166,13 @@ static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, ...@@ -164,10 +166,13 @@ static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1,
} }
#endif // HAVE_SSE #endif // HAVE_SSE
#endif /* HAVE_INLINE_ASM */
av_cold void ff_gradfun_init_x86(GradFunContext *gf) av_cold void ff_gradfun_init_x86(GradFunContext *gf)
{ {
int cpu_flags = av_get_cpu_flags(); int cpu_flags = av_get_cpu_flags();
#if HAVE_INLINE_ASM
#if HAVE_MMX2 #if HAVE_MMX2
if (cpu_flags & AV_CPU_FLAG_MMX2) if (cpu_flags & AV_CPU_FLAG_MMX2)
gf->filter_line = gradfun_filter_line_mmx2; gf->filter_line = gradfun_filter_line_mmx2;
...@@ -180,4 +185,5 @@ av_cold void ff_gradfun_init_x86(GradFunContext *gf) ...@@ -180,4 +185,5 @@ av_cold void ff_gradfun_init_x86(GradFunContext *gf)
if (cpu_flags & AV_CPU_FLAG_SSE2) if (cpu_flags & AV_CPU_FLAG_SSE2)
gf->blur_line = gradfun_blur_line_sse2; gf->blur_line = gradfun_blur_line_sse2;
#endif #endif
#endif /* HAVE_INLINE_ASM */
} }
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "libavcodec/x86/dsputil_mmx.h" #include "libavcodec/x86/dsputil_mmx.h"
#include "libavfilter/yadif.h" #include "libavfilter/yadif.h"
#if HAVE_INLINE_ASM
DECLARE_ASM_CONST(16, const xmm_reg, pb_1) = {0x0101010101010101ULL, 0x0101010101010101ULL}; DECLARE_ASM_CONST(16, const xmm_reg, pb_1) = {0x0101010101010101ULL, 0x0101010101010101ULL};
DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x0001000100010001ULL}; DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x0001000100010001ULL};
...@@ -49,10 +51,13 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010 ...@@ -49,10 +51,13 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#include "yadif_template.c" #include "yadif_template.c"
#endif #endif
#endif /* HAVE_INLINE_ASM */
av_cold void ff_yadif_init_x86(YADIFContext *yadif) av_cold void ff_yadif_init_x86(YADIFContext *yadif)
{ {
int cpu_flags = av_get_cpu_flags(); int cpu_flags = av_get_cpu_flags();
#if HAVE_INLINE_ASM
#if HAVE_MMX #if HAVE_MMX
if (cpu_flags & AV_CPU_FLAG_MMX) if (cpu_flags & AV_CPU_FLAG_MMX)
yadif->filter_line = yadif_filter_line_mmx; yadif->filter_line = yadif_filter_line_mmx;
...@@ -65,4 +70,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif) ...@@ -65,4 +70,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
if (cpu_flags & AV_CPU_FLAG_SSSE3) if (cpu_flags & AV_CPU_FLAG_SSSE3)
yadif->filter_line = yadif_filter_line_ssse3; yadif->filter_line = yadif_filter_line_ssse3;
#endif #endif
#endif /* HAVE_INLINE_ASM */
} }
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