Commit 17337f54 authored by Diego Biurrun's avatar Diego Biurrun

x86: Split inline and external assembly #ifdefs

parent 43b73d59
...@@ -85,7 +85,7 @@ static const struct algo fdct_tab[] = { ...@@ -85,7 +85,7 @@ static const struct algo fdct_tab[] = {
{ "IJG-AAN-INT", ff_fdct_ifast, SCALE_PERM }, { "IJG-AAN-INT", ff_fdct_ifast, SCALE_PERM },
{ "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM }, { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM },
#if HAVE_MMX && HAVE_INLINE_ASM #if HAVE_MMX_INLINE
{ "MMX", ff_fdct_mmx, NO_PERM, AV_CPU_FLAG_MMX }, { "MMX", ff_fdct_mmx, NO_PERM, AV_CPU_FLAG_MMX },
{ "MMXEXT", ff_fdct_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT }, { "MMXEXT", ff_fdct_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT },
{ "SSE2", ff_fdct_sse2, NO_PERM, AV_CPU_FLAG_SSE2 }, { "SSE2", ff_fdct_sse2, NO_PERM, AV_CPU_FLAG_SSE2 },
...@@ -108,7 +108,7 @@ static const struct algo idct_tab[] = { ...@@ -108,7 +108,7 @@ static const struct algo idct_tab[] = {
{ "INT", ff_j_rev_dct, MMX_PERM }, { "INT", ff_j_rev_dct, MMX_PERM },
{ "SIMPLE-C", ff_simple_idct_8, NO_PERM }, { "SIMPLE-C", ff_simple_idct_8, NO_PERM },
#if HAVE_MMX && HAVE_INLINE_ASM #if HAVE_MMX_INLINE
{ "SIMPLE-MMX", ff_simple_idct_mmx, MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX }, { "SIMPLE-MMX", ff_simple_idct_mmx, MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX },
{ "XVID-MMX", ff_idct_xvid_mmx, NO_PERM, AV_CPU_FLAG_MMX, 1 }, { "XVID-MMX", ff_idct_xvid_mmx, NO_PERM, AV_CPU_FLAG_MMX, 1 },
{ "XVID-MMXEXT", ff_idct_xvid_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT, 1 }, { "XVID-MMXEXT", ff_idct_xvid_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT, 1 },
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#if HAVE_MMX && HAVE_YASM #if HAVE_MMX_EXTERNAL
#include "x86/dsputil_mmx.h" #include "x86/dsputil_mmx.h"
#endif #endif
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#define FF_PIXEL_PACKED 1 /**< only one components containing all the channels */ #define FF_PIXEL_PACKED 1 /**< only one components containing all the channels */
#define FF_PIXEL_PALETTE 2 /**< one components containing indexes for a palette */ #define FF_PIXEL_PALETTE 2 /**< one components containing indexes for a palette */
#if HAVE_MMX && HAVE_YASM #if HAVE_MMX_EXTERNAL
#define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx #define deinterlace_line_inplace ff_deinterlace_line_inplace_mmx
#define deinterlace_line ff_deinterlace_line_mmx #define deinterlace_line ff_deinterlace_line_mmx
#else #else
...@@ -877,7 +877,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, ...@@ -877,7 +877,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
return 0; return 0;
} }
#if !(HAVE_MMX && HAVE_YASM) #if !HAVE_MMX_EXTERNAL
/* filter parameters: [-1 4 2 4 -1] // 8 */ /* filter parameters: [-1 4 2 4 -1] // 8 */
static void deinterlace_line_c(uint8_t *dst, static void deinterlace_line_c(uint8_t *dst,
const uint8_t *lum_m4, const uint8_t *lum_m3, const uint8_t *lum_m4, const uint8_t *lum_m3,
...@@ -926,7 +926,7 @@ static void deinterlace_line_inplace_c(uint8_t *lum_m4, uint8_t *lum_m3, ...@@ -926,7 +926,7 @@ static void deinterlace_line_inplace_c(uint8_t *lum_m4, uint8_t *lum_m3,
lum++; lum++;
} }
} }
#endif #endif /* !HAVE_MMX_EXTERNAL */
/* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The /* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The
top field is copied as is, but the bottom field is deinterlaced top field is copied as is, but the bottom field is deinterlaced
......
...@@ -73,7 +73,7 @@ AC3_EXPONENT_MIN mmx ...@@ -73,7 +73,7 @@ AC3_EXPONENT_MIN mmx
%define LOOP_ALIGN ALIGN 16 %define LOOP_ALIGN ALIGN 16
AC3_EXPONENT_MIN mmxext AC3_EXPONENT_MIN mmxext
%endif %endif
%if HAVE_SSE %if HAVE_SSE2_EXTERNAL
INIT_XMM INIT_XMM
AC3_EXPONENT_MIN sse2 AC3_EXPONENT_MIN sse2
%endif %endif
...@@ -385,7 +385,7 @@ cglobal ac3_compute_mantissa_size_sse2, 1,2,4, mant_cnt, sum ...@@ -385,7 +385,7 @@ cglobal ac3_compute_mantissa_size_sse2, 1,2,4, mant_cnt, sum
pabsd %1, %1 pabsd %1, %1
%endmacro %endmacro
%if HAVE_AMD3DNOW %if HAVE_AMD3DNOW_EXTERNAL
INIT_MMX INIT_MMX
cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len
add expq, lenq add expq, lenq
...@@ -453,11 +453,11 @@ cglobal ac3_extract_exponents_%1, 3,3,4, exp, coef, len ...@@ -453,11 +453,11 @@ cglobal ac3_extract_exponents_%1, 3,3,4, exp, coef, len
REP_RET REP_RET
%endmacro %endmacro
%if HAVE_SSE %if HAVE_SSE2_EXTERNAL
INIT_XMM INIT_XMM
%define PABSD PABSD_MMX %define PABSD PABSD_MMX
AC3_EXTRACT_EXPONENTS sse2 AC3_EXTRACT_EXPONENTS sse2
%if HAVE_SSSE3 %if HAVE_SSSE3_EXTERNAL
%define PABSD PABSD_SSSE3 %define PABSD PABSD_SSSE3
AC3_EXTRACT_EXPONENTS ssse3 AC3_EXTRACT_EXPONENTS ssse3
%endif %endif
......
...@@ -193,7 +193,7 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000 ...@@ -193,7 +193,7 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000
INIT_YMM avx INIT_YMM avx
SECTION_TEXT SECTION_TEXT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in) ; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in)
cglobal dct32_float, 2,3,8, out, in, tmp cglobal dct32_float, 2,3,8, out, in, tmp
; pass 1 ; pass 1
......
...@@ -1169,7 +1169,7 @@ ALIGN 16 ...@@ -1169,7 +1169,7 @@ ALIGN 16
INIT_XMM sse INIT_XMM sse
VECTOR_FMUL_REVERSE VECTOR_FMUL_REVERSE
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
VECTOR_FMUL_REVERSE VECTOR_FMUL_REVERSE
%endif %endif
...@@ -1199,7 +1199,7 @@ ALIGN 16 ...@@ -1199,7 +1199,7 @@ ALIGN 16
INIT_XMM sse INIT_XMM sse
VECTOR_FMUL_ADD VECTOR_FMUL_ADD
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
VECTOR_FMUL_ADD VECTOR_FMUL_ADD
%endif %endif
...@@ -1245,7 +1245,7 @@ cglobal butterflies_float_interleave, 4,4,3, dst, src0, src1, len ...@@ -1245,7 +1245,7 @@ cglobal butterflies_float_interleave, 4,4,3, dst, src0, src1, len
INIT_XMM sse INIT_XMM sse
BUTTERFLIES_FLOAT_INTERLEAVE BUTTERFLIES_FLOAT_INTERLEAVE
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
BUTTERFLIES_FLOAT_INTERLEAVE BUTTERFLIES_FLOAT_INTERLEAVE
%endif %endif
......
...@@ -2812,7 +2812,7 @@ static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx, ...@@ -2812,7 +2812,7 @@ static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx,
static void dsputil_init_3dnowext(DSPContext *c, AVCodecContext *avctx, static void dsputil_init_3dnowext(DSPContext *c, AVCodecContext *avctx,
int mm_flags) int mm_flags)
{ {
#if HAVE_6REGS && HAVE_INLINE_ASM #if HAVE_AMD3DNOWEXT_INLINE && HAVE_6REGS
c->vector_fmul_window = vector_fmul_window_3dnowext; c->vector_fmul_window = vector_fmul_window_3dnowext;
#endif #endif
} }
...@@ -2926,11 +2926,10 @@ static void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx, ...@@ -2926,11 +2926,10 @@ static void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
int mm_flags) int mm_flags)
{ {
#if HAVE_SSSE3
const int high_bit_depth = avctx->bits_per_raw_sample > 8; const int high_bit_depth = avctx->bits_per_raw_sample > 8;
const int bit_depth = avctx->bits_per_raw_sample; const int bit_depth = avctx->bits_per_raw_sample;
#if HAVE_INLINE_ASM #if HAVE_SSSE3_INLINE
if (!high_bit_depth && CONFIG_H264QPEL) { if (!high_bit_depth && CONFIG_H264QPEL) {
H264_QPEL_FUNCS(1, 0, ssse3); H264_QPEL_FUNCS(1, 0, ssse3);
H264_QPEL_FUNCS(1, 1, ssse3); H264_QPEL_FUNCS(1, 1, ssse3);
...@@ -2945,8 +2944,9 @@ static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, ...@@ -2945,8 +2944,9 @@ static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
H264_QPEL_FUNCS(3, 2, ssse3); H264_QPEL_FUNCS(3, 2, ssse3);
H264_QPEL_FUNCS(3, 3, ssse3); H264_QPEL_FUNCS(3, 3, ssse3);
} }
#endif /* HAVE_INLINE_ASM */ #endif /* HAVE_SSSE3_INLINE */
#if HAVE_YASM
#if HAVE_SSSE3_EXTERNAL
if (bit_depth == 10 && CONFIG_H264QPEL) { if (bit_depth == 10 && CONFIG_H264QPEL) {
H264_QPEL_FUNCS_10(1, 0, ssse3_cache64); H264_QPEL_FUNCS_10(1, 0, ssse3_cache64);
H264_QPEL_FUNCS_10(2, 0, ssse3_cache64); H264_QPEL_FUNCS_10(2, 0, ssse3_cache64);
...@@ -2969,21 +2969,20 @@ static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, ...@@ -2969,21 +2969,20 @@ static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
if (!(mm_flags & (AV_CPU_FLAG_SSE42|AV_CPU_FLAG_3DNOW))) // cachesplit if (!(mm_flags & (AV_CPU_FLAG_SSE42|AV_CPU_FLAG_3DNOW))) // cachesplit
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3; c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
c->bswap_buf = ff_bswap32_buf_ssse3; c->bswap_buf = ff_bswap32_buf_ssse3;
#endif #endif /* HAVE_SSSE3_EXTERNAL */
#endif
} }
static void dsputil_init_sse4(DSPContext *c, AVCodecContext *avctx, static void dsputil_init_sse4(DSPContext *c, AVCodecContext *avctx,
int mm_flags) int mm_flags)
{ {
#if HAVE_YASM #if HAVE_SSE4_EXTERNAL
c->vector_clip_int32 = ff_vector_clip_int32_sse4; c->vector_clip_int32 = ff_vector_clip_int32_sse4;
#endif #endif /* HAVE_SSE4_EXTERNAL */
} }
static void dsputil_init_avx(DSPContext *c, AVCodecContext *avctx, int mm_flags) static void dsputil_init_avx(DSPContext *c, AVCodecContext *avctx, int mm_flags)
{ {
#if HAVE_AVX && HAVE_YASM #if HAVE_AVX_EXTERNAL
const int bit_depth = avctx->bits_per_raw_sample; const int bit_depth = avctx->bits_per_raw_sample;
if (bit_depth == 10) { if (bit_depth == 10) {
...@@ -3003,7 +3002,7 @@ static void dsputil_init_avx(DSPContext *c, AVCodecContext *avctx, int mm_flags) ...@@ -3003,7 +3002,7 @@ static void dsputil_init_avx(DSPContext *c, AVCodecContext *avctx, int mm_flags)
c->butterflies_float_interleave = ff_butterflies_float_interleave_avx; c->butterflies_float_interleave = ff_butterflies_float_interleave_avx;
c->vector_fmul_reverse = ff_vector_fmul_reverse_avx; c->vector_fmul_reverse = ff_vector_fmul_reverse_avx;
c->vector_fmul_add = ff_vector_fmul_add_avx; c->vector_fmul_add = ff_vector_fmul_add_avx;
#endif #endif /* HAVE_AVX_EXTERNAL */
} }
void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx) void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx)
......
...@@ -982,7 +982,7 @@ DCT_SAD_FUNC(mmx2) ...@@ -982,7 +982,7 @@ DCT_SAD_FUNC(mmx2)
DCT_SAD_FUNC(sse2) DCT_SAD_FUNC(sse2)
#undef MMABS #undef MMABS
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
#define MMABS(a,z) MMABS_SSSE3(a,z) #define MMABS(a,z) MMABS_SSSE3(a,z)
DCT_SAD_FUNC(ssse3) DCT_SAD_FUNC(ssse3)
#undef MMABS #undef MMABS
...@@ -1062,7 +1062,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si ...@@ -1062,7 +1062,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
#undef SCALE_OFFSET #undef SCALE_OFFSET
#undef PMULHRW #undef PMULHRW
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
#undef PHADDD #undef PHADDD
#define DEF(x) x ## _ssse3 #define DEF(x) x ## _ssse3
#define SET_RND(x) #define SET_RND(x)
...@@ -1081,7 +1081,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si ...@@ -1081,7 +1081,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
#undef SCALE_OFFSET #undef SCALE_OFFSET
#undef PMULHRW #undef PMULHRW
#undef PHADDD #undef PHADDD
#endif //HAVE_SSSE3 #endif /* HAVE_SSSE3_INLINE */
#endif /* HAVE_INLINE_ASM */ #endif /* HAVE_INLINE_ASM */
...@@ -1161,7 +1161,7 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -1161,7 +1161,7 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->sum_abs_dctelem= sum_abs_dctelem_sse2; c->sum_abs_dctelem= sum_abs_dctelem_sse2;
} }
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
if(mm_flags & AV_CPU_FLAG_SSSE3){ if(mm_flags & AV_CPU_FLAG_SSSE3){
if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
c->try_8x8basis= try_8x8basis_ssse3; c->try_8x8basis= try_8x8basis_ssse3;
......
...@@ -305,7 +305,7 @@ IF%1 mova Z(1), m5 ...@@ -305,7 +305,7 @@ IF%1 mova Z(1), m5
INIT_YMM avx INIT_YMM avx
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
align 16 align 16
fft8_avx: fft8_avx:
mova m0, Z(0) mova m0, Z(0)
...@@ -552,7 +552,7 @@ DEFINE_ARGS zc, w, n, o1, o3 ...@@ -552,7 +552,7 @@ DEFINE_ARGS zc, w, n, o1, o3
INIT_YMM avx INIT_YMM avx
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
%macro INTERL_AVX 5 %macro INTERL_AVX 5
vunpckhps %3, %2, %1 vunpckhps %3, %2, %1
vunpcklps %2, %2, %1 vunpcklps %2, %2, %1
...@@ -793,7 +793,7 @@ align 8 ...@@ -793,7 +793,7 @@ align 8
dispatch_tab %+ fullsuffix: pointer list_of_fft dispatch_tab %+ fullsuffix: pointer list_of_fft
%endmacro ; DECL_FFT %endmacro ; DECL_FFT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
DECL_FFT 6 DECL_FFT 6
DECL_FFT 6, _interleave DECL_FFT 6, _interleave
...@@ -1100,6 +1100,6 @@ DECL_IMDCT POSROTATESHUF_3DNOW ...@@ -1100,6 +1100,6 @@ DECL_IMDCT POSROTATESHUF_3DNOW
INIT_YMM avx INIT_YMM avx
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
DECL_IMDCT POSROTATESHUF_AVX DECL_IMDCT POSROTATESHUF_AVX
%endif %endif
...@@ -252,7 +252,7 @@ cglobal %1_h264_chroma_mc2_10, 6,7 ...@@ -252,7 +252,7 @@ cglobal %1_h264_chroma_mc2_10, 6,7
%define CHROMAMC_AVG NOTHING %define CHROMAMC_AVG NOTHING
INIT_XMM sse2 INIT_XMM sse2
CHROMA_MC8 put CHROMA_MC8 put
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CHROMA_MC8 put CHROMA_MC8 put
%endif %endif
...@@ -264,7 +264,7 @@ CHROMA_MC2 put ...@@ -264,7 +264,7 @@ CHROMA_MC2 put
%define PAVG pavgw %define PAVG pavgw
INIT_XMM sse2 INIT_XMM sse2
CHROMA_MC8 avg CHROMA_MC8 avg
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CHROMA_MC8 avg CHROMA_MC8 avg
%endif %endif
......
...@@ -80,7 +80,7 @@ cglobal h264_idct_add_10, 3,3 ...@@ -80,7 +80,7 @@ cglobal h264_idct_add_10, 3,3
INIT_XMM sse2 INIT_XMM sse2
IDCT_ADD_10 IDCT_ADD_10
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT_ADD_10 IDCT_ADD_10
%endif %endif
...@@ -110,7 +110,7 @@ add4x4_idct %+ SUFFIX: ...@@ -110,7 +110,7 @@ add4x4_idct %+ SUFFIX:
INIT_XMM sse2 INIT_XMM sse2
ALIGN 16 ALIGN 16
ADD4x4IDCT ADD4x4IDCT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
ALIGN 16 ALIGN 16
ADD4x4IDCT ADD4x4IDCT
...@@ -150,7 +150,7 @@ cglobal h264_idct_add16_10, 5,6 ...@@ -150,7 +150,7 @@ cglobal h264_idct_add16_10, 5,6
INIT_XMM sse2 INIT_XMM sse2
IDCT_ADD16_10 IDCT_ADD16_10
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT_ADD16_10 IDCT_ADD16_10
%endif %endif
...@@ -216,7 +216,7 @@ cglobal h264_idct8_dc_add_10,3,3,7 ...@@ -216,7 +216,7 @@ cglobal h264_idct8_dc_add_10,3,3,7
INIT_XMM sse2 INIT_XMM sse2
IDCT8_DC_ADD IDCT8_DC_ADD
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT8_DC_ADD IDCT8_DC_ADD
%endif %endif
...@@ -287,7 +287,7 @@ cglobal h264_idct_add16intra_10,5,7,8 ...@@ -287,7 +287,7 @@ cglobal h264_idct_add16intra_10,5,7,8
INIT_XMM sse2 INIT_XMM sse2
IDCT_ADD16INTRA_10 IDCT_ADD16INTRA_10
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT_ADD16INTRA_10 IDCT_ADD16INTRA_10
%endif %endif
...@@ -324,7 +324,7 @@ cglobal h264_idct_add8_10,5,8,7 ...@@ -324,7 +324,7 @@ cglobal h264_idct_add8_10,5,8,7
INIT_XMM sse2 INIT_XMM sse2
IDCT_ADD8 IDCT_ADD8
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT_ADD8 IDCT_ADD8
%endif %endif
...@@ -501,7 +501,7 @@ h264_idct8_add1_10 %+ SUFFIX: ...@@ -501,7 +501,7 @@ h264_idct8_add1_10 %+ SUFFIX:
INIT_XMM sse2 INIT_XMM sse2
IDCT8_ADD IDCT8_ADD
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT8_ADD IDCT8_ADD
%endif %endif
...@@ -541,7 +541,7 @@ cglobal h264_idct8_add4_10, 0,7,16 ...@@ -541,7 +541,7 @@ cglobal h264_idct8_add4_10, 0,7,16
INIT_XMM sse2 INIT_XMM sse2
IDCT8_ADD4 IDCT8_ADD4
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
IDCT8_ADD4 IDCT8_ADD4
%endif %endif
...@@ -84,7 +84,7 @@ INIT_XMM ...@@ -84,7 +84,7 @@ INIT_XMM
PRED4x4_DR sse2 PRED4x4_DR sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED4x4_DR ssse3 PRED4x4_DR ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED4x4_DR avx PRED4x4_DR avx
%endif %endif
...@@ -124,7 +124,7 @@ INIT_XMM ...@@ -124,7 +124,7 @@ INIT_XMM
PRED4x4_VR sse2 PRED4x4_VR sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED4x4_VR ssse3 PRED4x4_VR ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED4x4_VR avx PRED4x4_VR avx
%endif %endif
...@@ -167,7 +167,7 @@ INIT_XMM ...@@ -167,7 +167,7 @@ INIT_XMM
PRED4x4_HD sse2 PRED4x4_HD sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED4x4_HD ssse3 PRED4x4_HD ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED4x4_HD avx PRED4x4_HD avx
%endif %endif
...@@ -238,7 +238,7 @@ cglobal pred4x4_down_left_10_%1, 3,3 ...@@ -238,7 +238,7 @@ cglobal pred4x4_down_left_10_%1, 3,3
INIT_XMM INIT_XMM
PRED4x4_DL sse2 PRED4x4_DL sse2
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED4x4_DL avx PRED4x4_DL avx
%endif %endif
...@@ -267,7 +267,7 @@ cglobal pred4x4_vertical_left_10_%1, 3,3 ...@@ -267,7 +267,7 @@ cglobal pred4x4_vertical_left_10_%1, 3,3
INIT_XMM INIT_XMM
PRED4x4_VL sse2 PRED4x4_VL sse2
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED4x4_VL avx PRED4x4_VL avx
%endif %endif
...@@ -577,7 +577,7 @@ cglobal pred8x8l_top_dc_10_%1, 4,4,6 ...@@ -577,7 +577,7 @@ cglobal pred8x8l_top_dc_10_%1, 4,4,6
INIT_XMM INIT_XMM
PRED8x8L_TOP_DC sse2 PRED8x8L_TOP_DC sse2
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_TOP_DC avx PRED8x8L_TOP_DC avx
%endif %endif
...@@ -636,7 +636,7 @@ cglobal pred8x8l_dc_10_%1, 4,6,6 ...@@ -636,7 +636,7 @@ cglobal pred8x8l_dc_10_%1, 4,6,6
INIT_XMM INIT_XMM
PRED8x8L_DC sse2 PRED8x8L_DC sse2
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_DC avx PRED8x8L_DC avx
%endif %endif
...@@ -671,7 +671,7 @@ cglobal pred8x8l_vertical_10_%1, 4,4,6 ...@@ -671,7 +671,7 @@ cglobal pred8x8l_vertical_10_%1, 4,4,6
INIT_XMM INIT_XMM
PRED8x8L_VERTICAL sse2 PRED8x8L_VERTICAL sse2
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_VERTICAL avx PRED8x8L_VERTICAL avx
%endif %endif
...@@ -728,7 +728,7 @@ INIT_XMM ...@@ -728,7 +728,7 @@ INIT_XMM
PRED8x8L_HORIZONTAL sse2 PRED8x8L_HORIZONTAL sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL ssse3 PRED8x8L_HORIZONTAL ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_HORIZONTAL avx PRED8x8L_HORIZONTAL avx
%endif %endif
...@@ -797,7 +797,7 @@ INIT_XMM ...@@ -797,7 +797,7 @@ INIT_XMM
PRED8x8L_DOWN_LEFT sse2 PRED8x8L_DOWN_LEFT sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED8x8L_DOWN_LEFT ssse3 PRED8x8L_DOWN_LEFT ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_DOWN_LEFT avx PRED8x8L_DOWN_LEFT avx
%endif %endif
...@@ -872,7 +872,7 @@ INIT_XMM ...@@ -872,7 +872,7 @@ INIT_XMM
PRED8x8L_DOWN_RIGHT sse2 PRED8x8L_DOWN_RIGHT sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED8x8L_DOWN_RIGHT ssse3 PRED8x8L_DOWN_RIGHT ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_DOWN_RIGHT avx PRED8x8L_DOWN_RIGHT avx
%endif %endif
...@@ -943,7 +943,7 @@ INIT_XMM ...@@ -943,7 +943,7 @@ INIT_XMM
PRED8x8L_VERTICAL_RIGHT sse2 PRED8x8L_VERTICAL_RIGHT sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED8x8L_VERTICAL_RIGHT ssse3 PRED8x8L_VERTICAL_RIGHT ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_VERTICAL_RIGHT avx PRED8x8L_VERTICAL_RIGHT avx
%endif %endif
...@@ -1005,7 +1005,7 @@ INIT_XMM ...@@ -1005,7 +1005,7 @@ INIT_XMM
PRED8x8L_HORIZONTAL_UP sse2 PRED8x8L_HORIZONTAL_UP sse2
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
PRED8x8L_HORIZONTAL_UP ssse3 PRED8x8L_HORIZONTAL_UP ssse3
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_AVX INIT_AVX
PRED8x8L_HORIZONTAL_UP avx PRED8x8L_HORIZONTAL_UP avx
%endif %endif
......
...@@ -1174,7 +1174,7 @@ QPEL_H264_V_XMM(put_, PUT_OP, sse2) ...@@ -1174,7 +1174,7 @@ QPEL_H264_V_XMM(put_, PUT_OP, sse2)
QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2) QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2)
QPEL_H264_HV_XMM(put_, PUT_OP, sse2) QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, sse2) QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, sse2)
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
QPEL_H264_H_XMM(put_, PUT_OP, ssse3) QPEL_H264_H_XMM(put_, PUT_OP, ssse3)
QPEL_H264_H_XMM(avg_, AVG_MMX2_OP, ssse3) QPEL_H264_H_XMM(avg_, AVG_MMX2_OP, ssse3)
QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3) QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3)
...@@ -1188,7 +1188,7 @@ H264_MC_4816(3dnow) ...@@ -1188,7 +1188,7 @@ H264_MC_4816(3dnow)
H264_MC_4816(mmx2) H264_MC_4816(mmx2)
H264_MC_816(H264_MC_V, sse2) H264_MC_816(H264_MC_V, sse2)
H264_MC_816(H264_MC_HV, sse2) H264_MC_816(H264_MC_HV, sse2)
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
H264_MC_816(H264_MC_H, ssse3) H264_MC_816(H264_MC_H, ssse3)
H264_MC_816(H264_MC_HV, ssse3) H264_MC_816(H264_MC_HV, ssse3)
#endif #endif
......
...@@ -39,7 +39,7 @@ IDCT_ADD_FUNC(8_dc, 10, sse2) ...@@ -39,7 +39,7 @@ IDCT_ADD_FUNC(8_dc, 10, sse2)
IDCT_ADD_FUNC(8, 8, mmx) IDCT_ADD_FUNC(8, 8, mmx)
IDCT_ADD_FUNC(8, 8, sse2) IDCT_ADD_FUNC(8, 8, sse2)
IDCT_ADD_FUNC(8, 10, sse2) IDCT_ADD_FUNC(8, 10, sse2)
#if HAVE_AVX #if HAVE_AVX_EXTERNAL
IDCT_ADD_FUNC(, 10, avx) IDCT_ADD_FUNC(, 10, avx)
IDCT_ADD_FUNC(8_dc, 10, avx) IDCT_ADD_FUNC(8_dc, 10, avx)
IDCT_ADD_FUNC(8, 10, avx) IDCT_ADD_FUNC(8, 10, avx)
...@@ -64,7 +64,7 @@ IDCT_ADD_REP_FUNC(, 16intra, 8, mmx) ...@@ -64,7 +64,7 @@ IDCT_ADD_REP_FUNC(, 16intra, 8, mmx)
IDCT_ADD_REP_FUNC(, 16intra, 8, mmx2) IDCT_ADD_REP_FUNC(, 16intra, 8, mmx2)
IDCT_ADD_REP_FUNC(, 16intra, 8, sse2) IDCT_ADD_REP_FUNC(, 16intra, 8, sse2)
IDCT_ADD_REP_FUNC(, 16intra, 10, sse2) IDCT_ADD_REP_FUNC(, 16intra, 10, sse2)
#if HAVE_AVX #if HAVE_AVX_EXTERNAL
IDCT_ADD_REP_FUNC(, 16, 10, avx) IDCT_ADD_REP_FUNC(, 16, 10, avx)
IDCT_ADD_REP_FUNC(, 16intra, 10, avx) IDCT_ADD_REP_FUNC(, 16intra, 10, avx)
#endif #endif
...@@ -79,7 +79,7 @@ IDCT_ADD_REP_FUNC2(, 8, 8, mmx) ...@@ -79,7 +79,7 @@ IDCT_ADD_REP_FUNC2(, 8, 8, mmx)
IDCT_ADD_REP_FUNC2(, 8, 8, mmx2) IDCT_ADD_REP_FUNC2(, 8, 8, mmx2)
IDCT_ADD_REP_FUNC2(, 8, 8, sse2) IDCT_ADD_REP_FUNC2(, 8, 8, sse2)
IDCT_ADD_REP_FUNC2(, 8, 10, sse2) IDCT_ADD_REP_FUNC2(, 8, 10, sse2)
#if HAVE_AVX #if HAVE_AVX_EXTERNAL
IDCT_ADD_REP_FUNC2(, 8, 10, avx) IDCT_ADD_REP_FUNC2(, 8, 10, avx)
#endif #endif
...@@ -353,7 +353,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, ...@@ -353,7 +353,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4; c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4;
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4; c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4;
} }
#if HAVE_AVX #if HAVE_AVX_EXTERNAL
if (mm_flags & AV_CPU_FLAG_AVX) { if (mm_flags & AV_CPU_FLAG_AVX) {
c->h264_idct_dc_add = c->h264_idct_dc_add =
c->h264_idct_add = ff_h264_idct_add_10_avx; c->h264_idct_add = ff_h264_idct_add_10_avx;
...@@ -377,7 +377,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, ...@@ -377,7 +377,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_avx; c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_avx;
#endif /* HAVE_ALIGNED_STACK */ #endif /* HAVE_ALIGNED_STACK */
} }
#endif /* HAVE_AVX */ #endif /* HAVE_AVX_EXTERNAL */
} }
} }
} }
......
...@@ -26,20 +26,18 @@ ...@@ -26,20 +26,18 @@
#include "libavcodec/mpegvideo.h" #include "libavcodec/mpegvideo.h"
#include "dsputil_mmx.h" #include "dsputil_mmx.h"
#if HAVE_INLINE_ASM
extern uint16_t ff_inv_zigzag_direct16[64]; extern uint16_t ff_inv_zigzag_direct16[64];
#if HAVE_MMX #if HAVE_MMX_INLINE
#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_MMXEXT 0
#define COMPILE_TEMPLATE_SSE2 0 #define COMPILE_TEMPLATE_SSE2 0
#define COMPILE_TEMPLATE_SSSE3 0 #define COMPILE_TEMPLATE_SSSE3 0
#define RENAME(a) a ## _MMX #define RENAME(a) a ## _MMX
#define RENAMEl(a) a ## _mmx #define RENAMEl(a) a ## _mmx
#include "mpegvideoenc_template.c" #include "mpegvideoenc_template.c"
#endif /* HAVE_MMX */ #endif /* HAVE_MMX_INLINE */
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
#undef COMPILE_TEMPLATE_SSSE3 #undef COMPILE_TEMPLATE_SSSE3
#undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
...@@ -51,9 +49,9 @@ extern uint16_t ff_inv_zigzag_direct16[64]; ...@@ -51,9 +49,9 @@ extern uint16_t ff_inv_zigzag_direct16[64];
#define RENAME(a) a ## _MMX2 #define RENAME(a) a ## _MMX2
#define RENAMEl(a) a ## _mmx2 #define RENAMEl(a) a ## _mmx2
#include "mpegvideoenc_template.c" #include "mpegvideoenc_template.c"
#endif /* HAVE_MMXEXT */ #endif /* HAVE_MMXEXT_INLINE */
#if HAVE_SSE2 #if HAVE_SSE2_INLINE
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
#undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_SSSE3 #undef COMPILE_TEMPLATE_SSSE3
...@@ -65,9 +63,9 @@ extern uint16_t ff_inv_zigzag_direct16[64]; ...@@ -65,9 +63,9 @@ extern uint16_t ff_inv_zigzag_direct16[64];
#define RENAME(a) a ## _SSE2 #define RENAME(a) a ## _SSE2
#define RENAMEl(a) a ## _sse2 #define RENAMEl(a) a ## _sse2
#include "mpegvideoenc_template.c" #include "mpegvideoenc_template.c"
#endif /* HAVE_SSE2 */ #endif /* HAVE_SSE2_INLINE */
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
#undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_SSSE3 #undef COMPILE_TEMPLATE_SSSE3
...@@ -79,33 +77,29 @@ extern uint16_t ff_inv_zigzag_direct16[64]; ...@@ -79,33 +77,29 @@ extern uint16_t ff_inv_zigzag_direct16[64];
#define RENAME(a) a ## _SSSE3 #define RENAME(a) a ## _SSSE3
#define RENAMEl(a) a ## _sse2 #define RENAMEl(a) a ## _sse2
#include "mpegvideoenc_template.c" #include "mpegvideoenc_template.c"
#endif /* HAVE_SSSE3 */ #endif /* HAVE_SSSE3_INLINE */
#endif /* HAVE_INLINE_ASM */
void ff_MPV_encode_init_x86(MpegEncContext *s) void ff_MPV_encode_init_x86(MpegEncContext *s)
{ {
#if HAVE_INLINE_ASM
int mm_flags = av_get_cpu_flags(); int mm_flags = av_get_cpu_flags();
const int dct_algo = s->avctx->dct_algo; const int dct_algo = s->avctx->dct_algo;
if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) { if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
#if HAVE_MMX #if HAVE_MMX_INLINE
if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX) if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX)
s->dct_quantize = dct_quantize_MMX; s->dct_quantize = dct_quantize_MMX;
#endif #endif
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT) if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT)
s->dct_quantize = dct_quantize_MMX2; s->dct_quantize = dct_quantize_MMX2;
#endif #endif
#if HAVE_SSE2 #if HAVE_SSE2_INLINE
if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE2) if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE2)
s->dct_quantize = dct_quantize_SSE2; s->dct_quantize = dct_quantize_SSE2;
#endif #endif
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
if (mm_flags & AV_CPU_FLAG_SSSE3) if (mm_flags & AV_CPU_FLAG_SSSE3)
s->dct_quantize = dct_quantize_SSSE3; s->dct_quantize = dct_quantize_SSSE3;
#endif #endif
} }
#endif /* HAVE_INLINE_ASM */
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
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};
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
static void gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers) static void gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
{ {
intptr_t x; intptr_t x;
...@@ -77,7 +77,7 @@ static void gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, i ...@@ -77,7 +77,7 @@ static void gradfun_filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc, i
} }
#endif #endif
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
static void gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers) static void gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
{ {
intptr_t x; intptr_t x;
...@@ -122,9 +122,9 @@ static void gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc, ...@@ -122,9 +122,9 @@ static void gradfun_filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc,
:"memory" :"memory"
); );
} }
#endif // HAVE_SSSE3 #endif /* HAVE_SSSE3_INLINE */
#if HAVE_SSE #if HAVE_SSE2_INLINE
static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width) static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, uint8_t *src, int src_linesize, int width)
{ {
#define BLURV(load)\ #define BLURV(load)\
...@@ -165,7 +165,7 @@ static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1, ...@@ -165,7 +165,7 @@ static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1,
BLURV("movdqa"); BLURV("movdqa");
} }
} }
#endif // HAVE_SSE #endif /* HAVE_SSE2_INLINE */
#endif /* HAVE_INLINE_ASM */ #endif /* HAVE_INLINE_ASM */
...@@ -173,18 +173,16 @@ av_cold void ff_gradfun_init_x86(GradFunContext *gf) ...@@ -173,18 +173,16 @@ 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_MMXEXT_INLINE
#if HAVE_MMXEXT
if (cpu_flags & AV_CPU_FLAG_MMXEXT) if (cpu_flags & AV_CPU_FLAG_MMXEXT)
gf->filter_line = gradfun_filter_line_mmx2; gf->filter_line = gradfun_filter_line_mmx2;
#endif #endif
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
if (cpu_flags & AV_CPU_FLAG_SSSE3) if (cpu_flags & AV_CPU_FLAG_SSSE3)
gf->filter_line = gradfun_filter_line_ssse3; gf->filter_line = gradfun_filter_line_ssse3;
#endif #endif
#if HAVE_SSE #if HAVE_SSE2_INLINE
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 */
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
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};
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
#define COMPILE_TEMPLATE_SSE2 1 #define COMPILE_TEMPLATE_SSE2 1
#define COMPILE_TEMPLATE_SSSE3 1 #define COMPILE_TEMPLATE_SSSE3 1
#undef RENAME #undef RENAME
...@@ -40,14 +40,14 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010 ...@@ -40,14 +40,14 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#undef COMPILE_TEMPLATE_SSSE3 #undef COMPILE_TEMPLATE_SSSE3
#endif #endif
#if HAVE_SSE #if HAVE_SSE2_INLINE
#undef RENAME #undef RENAME
#define RENAME(a) a ## _sse2 #define RENAME(a) a ## _sse2
#include "yadif_template.c" #include "yadif_template.c"
#undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_SSE2
#endif #endif
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
#undef RENAME #undef RENAME
#define RENAME(a) a ## _mmx2 #define RENAME(a) a ## _mmx2
#include "yadif_template.c" #include "yadif_template.c"
...@@ -59,18 +59,16 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif) ...@@ -59,18 +59,16 @@ 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_MMXEXT_INLINE
#if HAVE_MMXEXT
if (cpu_flags & AV_CPU_FLAG_MMXEXT) if (cpu_flags & AV_CPU_FLAG_MMXEXT)
yadif->filter_line = yadif_filter_line_mmx2; yadif->filter_line = yadif_filter_line_mmx2;
#endif #endif
#if HAVE_SSE #if HAVE_SSE2_INLINE
if (cpu_flags & AV_CPU_FLAG_SSE2) if (cpu_flags & AV_CPU_FLAG_SSE2)
yadif->filter_line = yadif_filter_line_sse2; yadif->filter_line = yadif_filter_line_sse2;
#endif #endif
#if HAVE_SSSE3 #if HAVE_SSSE3_INLINE
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 */
} }
...@@ -155,7 +155,7 @@ cglobal conv_s32_to_flt, 3,3,3, dst, src, len ...@@ -155,7 +155,7 @@ cglobal conv_s32_to_flt, 3,3,3, dst, src, len
INIT_XMM sse2 INIT_XMM sse2
CONV_S32_TO_FLT CONV_S32_TO_FLT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
CONV_S32_TO_FLT CONV_S32_TO_FLT
%endif %endif
...@@ -223,7 +223,7 @@ cglobal conv_flt_to_s32, 3,3,5, dst, src, len ...@@ -223,7 +223,7 @@ cglobal conv_flt_to_s32, 3,3,5, dst, src, len
INIT_XMM sse2 INIT_XMM sse2
CONV_FLT_TO_S32 CONV_FLT_TO_S32
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
CONV_FLT_TO_S32 CONV_FLT_TO_S32
%endif %endif
...@@ -260,7 +260,7 @@ cglobal conv_s16p_to_s16_2ch, 3,4,5, dst, src0, len, src1 ...@@ -260,7 +260,7 @@ cglobal conv_s16p_to_s16_2ch, 3,4,5, dst, src0, len, src1
INIT_XMM sse2 INIT_XMM sse2
CONV_S16P_TO_S16_2CH CONV_S16P_TO_S16_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16P_TO_S16_2CH CONV_S16P_TO_S16_2CH
%endif %endif
...@@ -383,7 +383,7 @@ INIT_XMM sse2 ...@@ -383,7 +383,7 @@ INIT_XMM sse2
CONV_S16P_TO_S16_6CH CONV_S16P_TO_S16_6CH
INIT_XMM sse2slow INIT_XMM sse2slow
CONV_S16P_TO_S16_6CH CONV_S16P_TO_S16_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16P_TO_S16_6CH CONV_S16P_TO_S16_6CH
%endif %endif
...@@ -432,7 +432,7 @@ cglobal conv_s16p_to_flt_2ch, 3,4,6, dst, src0, len, src1 ...@@ -432,7 +432,7 @@ cglobal conv_s16p_to_flt_2ch, 3,4,6, dst, src0, len, src1
INIT_XMM sse2 INIT_XMM sse2
CONV_S16P_TO_FLT_2CH CONV_S16P_TO_FLT_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16P_TO_FLT_2CH CONV_S16P_TO_FLT_2CH
%endif %endif
...@@ -536,7 +536,7 @@ INIT_XMM sse2 ...@@ -536,7 +536,7 @@ INIT_XMM sse2
CONV_S16P_TO_FLT_6CH CONV_S16P_TO_FLT_6CH
INIT_XMM ssse3 INIT_XMM ssse3
CONV_S16P_TO_FLT_6CH CONV_S16P_TO_FLT_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16P_TO_FLT_6CH CONV_S16P_TO_FLT_6CH
%endif %endif
...@@ -692,7 +692,7 @@ INIT_MMX sse ...@@ -692,7 +692,7 @@ INIT_MMX sse
CONV_FLTP_TO_S16_6CH CONV_FLTP_TO_S16_6CH
INIT_XMM sse2 INIT_XMM sse2
CONV_FLTP_TO_S16_6CH CONV_FLTP_TO_S16_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLTP_TO_S16_6CH CONV_FLTP_TO_S16_6CH
%endif %endif
...@@ -729,7 +729,7 @@ cglobal conv_fltp_to_flt_2ch, 3,4,5, dst, src0, len, src1 ...@@ -729,7 +729,7 @@ cglobal conv_fltp_to_flt_2ch, 3,4,5, dst, src0, len, src1
INIT_XMM sse INIT_XMM sse
CONV_FLTP_TO_FLT_2CH CONV_FLTP_TO_FLT_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLTP_TO_FLT_2CH CONV_FLTP_TO_FLT_2CH
%endif %endif
...@@ -810,7 +810,7 @@ INIT_MMX mmx ...@@ -810,7 +810,7 @@ INIT_MMX mmx
CONV_FLTP_TO_FLT_6CH CONV_FLTP_TO_FLT_6CH
INIT_XMM sse4 INIT_XMM sse4
CONV_FLTP_TO_FLT_6CH CONV_FLTP_TO_FLT_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLTP_TO_FLT_6CH CONV_FLTP_TO_FLT_6CH
%endif %endif
...@@ -859,7 +859,7 @@ INIT_XMM sse2 ...@@ -859,7 +859,7 @@ INIT_XMM sse2
CONV_S16_TO_S16P_2CH CONV_S16_TO_S16P_2CH
INIT_XMM ssse3 INIT_XMM ssse3
CONV_S16_TO_S16P_2CH CONV_S16_TO_S16P_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16_TO_S16P_2CH CONV_S16_TO_S16P_2CH
%endif %endif
...@@ -920,7 +920,7 @@ CONV_S16_TO_S16P_6CH ...@@ -920,7 +920,7 @@ CONV_S16_TO_S16P_6CH
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
INIT_XMM ssse3 INIT_XMM ssse3
CONV_S16_TO_S16P_6CH CONV_S16_TO_S16P_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16_TO_S16P_6CH CONV_S16_TO_S16P_6CH
%endif %endif
...@@ -958,7 +958,7 @@ cglobal conv_s16_to_fltp_2ch, 3,4,5, dst0, src, len, dst1 ...@@ -958,7 +958,7 @@ cglobal conv_s16_to_fltp_2ch, 3,4,5, dst0, src, len, dst1
INIT_XMM sse2 INIT_XMM sse2
CONV_S16_TO_FLTP_2CH CONV_S16_TO_FLTP_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16_TO_FLTP_2CH CONV_S16_TO_FLTP_2CH
%endif %endif
...@@ -1041,7 +1041,7 @@ INIT_XMM ssse3 ...@@ -1041,7 +1041,7 @@ INIT_XMM ssse3
CONV_S16_TO_FLTP_6CH CONV_S16_TO_FLTP_6CH
INIT_XMM sse4 INIT_XMM sse4
CONV_S16_TO_FLTP_6CH CONV_S16_TO_FLTP_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_S16_TO_FLTP_6CH CONV_S16_TO_FLTP_6CH
%endif %endif
...@@ -1087,7 +1087,7 @@ cglobal conv_flt_to_s16p_2ch, 3,4,6, dst0, src, len, dst1 ...@@ -1087,7 +1087,7 @@ cglobal conv_flt_to_s16p_2ch, 3,4,6, dst0, src, len, dst1
INIT_XMM sse2 INIT_XMM sse2
CONV_FLT_TO_S16P_2CH CONV_FLT_TO_S16P_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLT_TO_S16P_2CH CONV_FLT_TO_S16P_2CH
%endif %endif
...@@ -1161,7 +1161,7 @@ CONV_FLT_TO_S16P_6CH ...@@ -1161,7 +1161,7 @@ CONV_FLT_TO_S16P_6CH
%define PALIGNR PALIGNR_SSSE3 %define PALIGNR PALIGNR_SSSE3
INIT_XMM ssse3 INIT_XMM ssse3
CONV_FLT_TO_S16P_6CH CONV_FLT_TO_S16P_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLT_TO_S16P_6CH CONV_FLT_TO_S16P_6CH
%endif %endif
...@@ -1193,7 +1193,7 @@ cglobal conv_flt_to_fltp_2ch, 3,4,3, dst0, src, len, dst1 ...@@ -1193,7 +1193,7 @@ cglobal conv_flt_to_fltp_2ch, 3,4,3, dst0, src, len, dst1
INIT_XMM sse INIT_XMM sse
CONV_FLT_TO_FLTP_2CH CONV_FLT_TO_FLTP_2CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLT_TO_FLTP_2CH CONV_FLT_TO_FLTP_2CH
%endif %endif
...@@ -1256,7 +1256,7 @@ cglobal conv_flt_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5 ...@@ -1256,7 +1256,7 @@ cglobal conv_flt_to_fltp_6ch, 2,7,7, dst, src, dst1, dst2, dst3, dst4, dst5
INIT_XMM sse2 INIT_XMM sse2
CONV_FLT_TO_FLTP_6CH CONV_FLT_TO_FLTP_6CH
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
CONV_FLT_TO_FLTP_6CH CONV_FLT_TO_FLTP_6CH
%endif %endif
...@@ -56,7 +56,7 @@ cglobal mix_2_to_1_fltp_flt, 3,4,6, src, matrix, len, src1 ...@@ -56,7 +56,7 @@ cglobal mix_2_to_1_fltp_flt, 3,4,6, src, matrix, len, src1
INIT_XMM sse INIT_XMM sse
MIX_2_TO_1_FLTP_FLT MIX_2_TO_1_FLTP_FLT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
MIX_2_TO_1_FLTP_FLT MIX_2_TO_1_FLTP_FLT
%endif %endif
...@@ -175,7 +175,7 @@ cglobal mix_1_to_2_fltp_flt, 3,5,4, src0, matrix0, len, src1, matrix1 ...@@ -175,7 +175,7 @@ cglobal mix_1_to_2_fltp_flt, 3,5,4, src0, matrix0, len, src1, matrix1
INIT_XMM sse INIT_XMM sse
MIX_1_TO_2_FLTP_FLT MIX_1_TO_2_FLTP_FLT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
MIX_1_TO_2_FLTP_FLT MIX_1_TO_2_FLTP_FLT
%endif %endif
...@@ -222,7 +222,7 @@ INIT_XMM sse2 ...@@ -222,7 +222,7 @@ INIT_XMM sse2
MIX_1_TO_2_S16P_FLT MIX_1_TO_2_S16P_FLT
INIT_XMM sse4 INIT_XMM sse4
MIX_1_TO_2_S16P_FLT MIX_1_TO_2_S16P_FLT
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_XMM avx INIT_XMM avx
MIX_1_TO_2_S16P_FLT MIX_1_TO_2_S16P_FLT
%endif %endif
...@@ -490,7 +490,7 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, s ...@@ -490,7 +490,7 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, s
MIX_3_8_TO_1_2_FLT %%i, 1, s16p MIX_3_8_TO_1_2_FLT %%i, 1, s16p
MIX_3_8_TO_1_2_FLT %%i, 2, s16p MIX_3_8_TO_1_2_FLT %%i, 2, s16p
; do not use ymm AVX or FMA4 in x86-32 for 6 or more channels due to stack alignment issues ; do not use ymm AVX or FMA4 in x86-32 for 6 or more channels due to stack alignment issues
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
%if ARCH_X86_64 || %%i < 6 %if ARCH_X86_64 || %%i < 6
INIT_YMM avx INIT_YMM avx
%else %else
...@@ -502,7 +502,7 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, s ...@@ -502,7 +502,7 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, s
MIX_3_8_TO_1_2_FLT %%i, 1, s16p MIX_3_8_TO_1_2_FLT %%i, 1, s16p
MIX_3_8_TO_1_2_FLT %%i, 2, s16p MIX_3_8_TO_1_2_FLT %%i, 2, s16p
%endif %endif
%if HAVE_FMA4 %if HAVE_FMA4_EXTERNAL
%if ARCH_X86_64 || %%i < 6 %if ARCH_X86_64 || %%i < 6
INIT_YMM fma4 INIT_YMM fma4
%else %else
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
# define ONLY_IF_THREADS_ENABLED(x) NULL # define ONLY_IF_THREADS_ENABLED(x) NULL
#endif #endif
#if HAVE_MMX && HAVE_INLINE_ASM #if HAVE_MMX_INLINE
/** /**
* Empty mmx state. * Empty mmx state.
* this must be called between any dsp function and float/double code. * this must be called between any dsp function and float/double code.
...@@ -171,8 +171,8 @@ static av_always_inline void emms_c(void) ...@@ -171,8 +171,8 @@ static av_always_inline void emms_c(void)
#elif HAVE_MMX && HAVE_MM_EMPTY #elif HAVE_MMX && HAVE_MM_EMPTY
# include <mmintrin.h> # include <mmintrin.h>
# define emms_c _mm_empty # define emms_c _mm_empty
#else /* HAVE_MMX */ #else
# define emms_c() # define emms_c()
#endif /* HAVE_MMX */ #endif /* HAVE_MMX_INLINE */
#endif /* AVUTIL_INTERNAL_H */ #endif /* AVUTIL_INTERNAL_H */
...@@ -45,7 +45,7 @@ ALIGN 16 ...@@ -45,7 +45,7 @@ ALIGN 16
INIT_XMM sse INIT_XMM sse
VECTOR_FMUL VECTOR_FMUL
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
VECTOR_FMUL VECTOR_FMUL
%endif %endif
...@@ -86,7 +86,7 @@ cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len ...@@ -86,7 +86,7 @@ cglobal vector_fmac_scalar, 4,4,3, dst, src, mul, len
INIT_XMM sse INIT_XMM sse
VECTOR_FMAC_SCALAR VECTOR_FMAC_SCALAR
%if HAVE_AVX %if HAVE_AVX_EXTERNAL
INIT_YMM avx INIT_YMM avx
VECTOR_FMAC_SCALAR VECTOR_FMAC_SCALAR
%endif %endif
...@@ -518,7 +518,7 @@ static int swScale(SwsContext *c, const uint8_t *src[], ...@@ -518,7 +518,7 @@ static int swScale(SwsContext *c, const uint8_t *src[],
if (!enough_lines) if (!enough_lines)
break; // we can't output a dstY line so let's try with the next slice break; // we can't output a dstY line so let's try with the next slice
#if HAVE_MMX && HAVE_INLINE_ASM #if HAVE_MMX_INLINE
updateMMXDitherTables(c, dstY, lumBufIndex, chrBufIndex, updateMMXDitherTables(c, dstY, lumBufIndex, chrBufIndex,
lastInLumBuf, lastInChrBuf); lastInLumBuf, lastInChrBuf);
#endif #endif
......
...@@ -577,7 +577,7 @@ fail: ...@@ -577,7 +577,7 @@ fail:
return ret; return ret;
} }
#if HAVE_MMXEXT && HAVE_INLINE_ASM #if HAVE_MMXEXT_INLINE
static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode,
int16_t *filter, int32_t *filterPos, int numSplits) int16_t *filter, int32_t *filterPos, int numSplits)
{ {
...@@ -740,7 +740,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, ...@@ -740,7 +740,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode,
return fragmentPos + 1; return fragmentPos + 1;
} }
#endif /* HAVE_MMXEXT && HAVE_INLINE_ASM */ #endif /* HAVE_MMXEXT_INLINE */
static void getSubSampleFactors(int *h, int *v, enum PixelFormat format) static void getSubSampleFactors(int *h, int *v, enum PixelFormat format)
{ {
...@@ -1012,7 +1012,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, ...@@ -1012,7 +1012,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
/* precalculate horizontal scaler filter coefficients */ /* precalculate horizontal scaler filter coefficients */
{ {
#if HAVE_MMXEXT && HAVE_INLINE_ASM #if HAVE_MMXEXT_INLINE
// can't downscale !!! // can't downscale !!!
if (c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) { if (c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) {
c->lumMmx2FilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL, c->lumMmx2FilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL,
...@@ -1048,7 +1048,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, ...@@ -1048,7 +1048,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ); mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ);
#endif #endif
} else } else
#endif /* HAVE_MMXEXT && HAVE_INLINE_ASM */ #endif /* HAVE_MMXEXT_INLINE */
{ {
const int filterAlign = const int filterAlign =
(HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) ? 4 : (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) ? 4 :
...@@ -1621,7 +1621,7 @@ void sws_freeContext(SwsContext *c) ...@@ -1621,7 +1621,7 @@ void sws_freeContext(SwsContext *c)
av_freep(&c->hLumFilterPos); av_freep(&c->hLumFilterPos);
av_freep(&c->hChrFilterPos); av_freep(&c->hChrFilterPos);
#if HAVE_MMX #if HAVE_MMX_INLINE
#ifdef MAP_ANONYMOUS #ifdef MAP_ANONYMOUS
if (c->lumMmx2FilterCode) if (c->lumMmx2FilterCode)
munmap(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize); munmap(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize);
...@@ -1638,7 +1638,7 @@ void sws_freeContext(SwsContext *c) ...@@ -1638,7 +1638,7 @@ void sws_freeContext(SwsContext *c)
#endif #endif
c->lumMmx2FilterCode = NULL; c->lumMmx2FilterCode = NULL;
c->chrMmx2FilterCode = NULL; c->chrMmx2FilterCode = NULL;
#endif /* HAVE_MMX */ #endif /* HAVE_MMX_INLINE */
av_freep(&c->yuvTable); av_freep(&c->yuvTable);
av_free(c->formatConvBuffer); av_free(c->formatConvBuffer);
......
...@@ -70,7 +70,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL; ...@@ -70,7 +70,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
//MMX versions //MMX versions
#if HAVE_MMX #if HAVE_MMX_INLINE
#undef RENAME #undef RENAME
#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_MMXEXT 0
#define RENAME(a) a ## _MMX #define RENAME(a) a ## _MMX
...@@ -78,7 +78,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; ...@@ -78,7 +78,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
#endif #endif
//MMX2 versions //MMX2 versions
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
#undef RENAME #undef RENAME
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
#define COMPILE_TEMPLATE_MMXEXT 1 #define COMPILE_TEMPLATE_MMXEXT 1
...@@ -308,7 +308,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c) ...@@ -308,7 +308,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c)
#if HAVE_INLINE_ASM #if HAVE_INLINE_ASM
if (cpu_flags & AV_CPU_FLAG_MMX) if (cpu_flags & AV_CPU_FLAG_MMX)
sws_init_swScale_MMX(c); sws_init_swScale_MMX(c);
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
if (cpu_flags & AV_CPU_FLAG_MMXEXT) if (cpu_flags & AV_CPU_FLAG_MMXEXT)
sws_init_swScale_MMX2(c); sws_init_swScale_MMX2(c);
#endif #endif
......
...@@ -50,22 +50,22 @@ DECLARE_ASM_CONST(8, uint64_t, pb_03) = 0x0303030303030303ULL; ...@@ -50,22 +50,22 @@ DECLARE_ASM_CONST(8, uint64_t, pb_03) = 0x0303030303030303ULL;
DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
//MMX versions //MMX versions
#if HAVE_MMX #if HAVE_MMX_INLINE
#undef RENAME #undef RENAME
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_MMXEXT 0
#define RENAME(a) a ## _MMX #define RENAME(a) a ## _MMX
#include "yuv2rgb_template.c" #include "yuv2rgb_template.c"
#endif /* HAVE_MMX */ #endif /* HAVE_MMX_INLINE */
//MMX2 versions //MMX2 versions
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
#undef RENAME #undef RENAME
#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_MMXEXT
#define COMPILE_TEMPLATE_MMXEXT 1 #define COMPILE_TEMPLATE_MMXEXT 1
#define RENAME(a) a ## _MMX2 #define RENAME(a) a ## _MMX2
#include "yuv2rgb_template.c" #include "yuv2rgb_template.c"
#endif /* HAVE_MMXEXT */ #endif /* HAVE_MMXEXT_INLINE */
#endif /* HAVE_INLINE_ASM */ #endif /* HAVE_INLINE_ASM */
...@@ -78,7 +78,7 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) ...@@ -78,7 +78,7 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
c->srcFormat != PIX_FMT_YUVA420P) c->srcFormat != PIX_FMT_YUVA420P)
return NULL; return NULL;
#if HAVE_MMXEXT #if HAVE_MMXEXT_INLINE
if (cpu_flags & AV_CPU_FLAG_MMXEXT) { if (cpu_flags & AV_CPU_FLAG_MMXEXT) {
switch (c->dstFormat) { switch (c->dstFormat) {
case PIX_FMT_RGB24: return yuv420_rgb24_MMX2; case PIX_FMT_RGB24: return yuv420_rgb24_MMX2;
......
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