From 17337f54c057accf12b0e87d12f576194ad085a8 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 28 Aug 2012 14:53:33 +0200 Subject: x86: Split inline and external assembly #ifdefs --- libavcodec/dct-test.c | 4 ++-- libavcodec/imgconvert.c | 8 ++++---- libavcodec/x86/ac3dsp.asm | 8 ++++---- libavcodec/x86/dct32.asm | 2 +- libavcodec/x86/dsputil.asm | 6 +++--- libavcodec/x86/dsputil_mmx.c | 21 ++++++++++----------- libavcodec/x86/dsputilenc_mmx.c | 8 ++++---- libavcodec/x86/fft.asm | 8 ++++---- libavcodec/x86/h264_chromamc_10bit.asm | 4 ++-- libavcodec/x86/h264_idct_10bit.asm | 16 ++++++++-------- libavcodec/x86/h264_intrapred_10bit.asm | 26 +++++++++++++------------- libavcodec/x86/h264_qpel.c | 4 ++-- libavcodec/x86/h264dsp_init.c | 10 +++++----- libavcodec/x86/mpegvideoenc.c | 30 ++++++++++++------------------ 14 files changed, 74 insertions(+), 81 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 21a3397..72d2d80 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -85,7 +85,7 @@ static const struct algo fdct_tab[] = { { "IJG-AAN-INT", ff_fdct_ifast, SCALE_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 }, { "MMXEXT", ff_fdct_mmx2, NO_PERM, AV_CPU_FLAG_MMXEXT }, { "SSE2", ff_fdct_sse2, NO_PERM, AV_CPU_FLAG_SSE2 }, @@ -108,7 +108,7 @@ static const struct algo idct_tab[] = { { "INT", ff_j_rev_dct, MMX_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 }, { "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 }, diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 62ec35a..f6c5e3c 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -39,7 +39,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/imgutils.h" -#if HAVE_MMX && HAVE_YASM +#if HAVE_MMX_EXTERNAL #include "x86/dsputil_mmx.h" #endif @@ -52,7 +52,7 @@ #define FF_PIXEL_PACKED 1 /**< only one components containing all the channels */ #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 ff_deinterlace_line_mmx #else @@ -877,7 +877,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, return 0; } -#if !(HAVE_MMX && HAVE_YASM) +#if !HAVE_MMX_EXTERNAL /* filter parameters: [-1 4 2 4 -1] // 8 */ static void deinterlace_line_c(uint8_t *dst, 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, lum++; } } -#endif +#endif /* !HAVE_MMX_EXTERNAL */ /* deinterlacing : 2 temporal taps, 3 spatial taps linear filter. The top field is copied as is, but the bottom field is deinterlaced diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm index ef828bb..176fd3d 100644 --- a/libavcodec/x86/ac3dsp.asm +++ b/libavcodec/x86/ac3dsp.asm @@ -73,7 +73,7 @@ AC3_EXPONENT_MIN mmx %define LOOP_ALIGN ALIGN 16 AC3_EXPONENT_MIN mmxext %endif -%if HAVE_SSE +%if HAVE_SSE2_EXTERNAL INIT_XMM AC3_EXPONENT_MIN sse2 %endif @@ -385,7 +385,7 @@ cglobal ac3_compute_mantissa_size_sse2, 1,2,4, mant_cnt, sum pabsd %1, %1 %endmacro -%if HAVE_AMD3DNOW +%if HAVE_AMD3DNOW_EXTERNAL INIT_MMX cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len add expq, lenq @@ -453,11 +453,11 @@ cglobal ac3_extract_exponents_%1, 3,3,4, exp, coef, len REP_RET %endmacro -%if HAVE_SSE +%if HAVE_SSE2_EXTERNAL INIT_XMM %define PABSD PABSD_MMX AC3_EXTRACT_EXPONENTS sse2 -%if HAVE_SSSE3 +%if HAVE_SSSE3_EXTERNAL %define PABSD PABSD_SSSE3 AC3_EXTRACT_EXPONENTS ssse3 %endif diff --git a/libavcodec/x86/dct32.asm b/libavcodec/x86/dct32.asm index 9d6169c..58ee8d3 100644 --- a/libavcodec/x86/dct32.asm +++ b/libavcodec/x86/dct32.asm @@ -193,7 +193,7 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000 INIT_YMM avx SECTION_TEXT -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL ; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in) cglobal dct32_float, 2,3,8, out, in, tmp ; pass 1 diff --git a/libavcodec/x86/dsputil.asm b/libavcodec/x86/dsputil.asm index d6cf824..fcb1b6d 100644 --- a/libavcodec/x86/dsputil.asm +++ b/libavcodec/x86/dsputil.asm @@ -1169,7 +1169,7 @@ ALIGN 16 INIT_XMM sse VECTOR_FMUL_REVERSE -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL_REVERSE %endif @@ -1199,7 +1199,7 @@ ALIGN 16 INIT_XMM sse VECTOR_FMUL_ADD -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_YMM avx VECTOR_FMUL_ADD %endif @@ -1245,7 +1245,7 @@ cglobal butterflies_float_interleave, 4,4,3, dst, src0, src1, len INIT_XMM sse BUTTERFLIES_FLOAT_INTERLEAVE -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_YMM avx BUTTERFLIES_FLOAT_INTERLEAVE %endif diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 4fbb146..d950506 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -2812,7 +2812,7 @@ static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx, static void dsputil_init_3dnowext(DSPContext *c, AVCodecContext *avctx, int mm_flags) { -#if HAVE_6REGS && HAVE_INLINE_ASM +#if HAVE_AMD3DNOWEXT_INLINE && HAVE_6REGS c->vector_fmul_window = vector_fmul_window_3dnowext; #endif } @@ -2926,11 +2926,10 @@ static void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx, static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, int mm_flags) { -#if HAVE_SSSE3 const int high_bit_depth = avctx->bits_per_raw_sample > 8; const int bit_depth = avctx->bits_per_raw_sample; -#if HAVE_INLINE_ASM +#if HAVE_SSSE3_INLINE if (!high_bit_depth && CONFIG_H264QPEL) { H264_QPEL_FUNCS(1, 0, ssse3); H264_QPEL_FUNCS(1, 1, ssse3); @@ -2945,8 +2944,9 @@ static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx, H264_QPEL_FUNCS(3, 2, ssse3); H264_QPEL_FUNCS(3, 3, ssse3); } -#endif /* HAVE_INLINE_ASM */ -#if HAVE_YASM +#endif /* HAVE_SSSE3_INLINE */ + +#if HAVE_SSSE3_EXTERNAL if (bit_depth == 10 && CONFIG_H264QPEL) { H264_QPEL_FUNCS_10(1, 0, ssse3_cache64); H264_QPEL_FUNCS_10(2, 0, ssse3_cache64); @@ -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 c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3; c->bswap_buf = ff_bswap32_buf_ssse3; -#endif -#endif +#endif /* HAVE_SSSE3_EXTERNAL */ } static void dsputil_init_sse4(DSPContext *c, AVCodecContext *avctx, int mm_flags) { -#if HAVE_YASM +#if HAVE_SSE4_EXTERNAL 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) { -#if HAVE_AVX && HAVE_YASM +#if HAVE_AVX_EXTERNAL const int bit_depth = avctx->bits_per_raw_sample; if (bit_depth == 10) { @@ -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->vector_fmul_reverse = ff_vector_fmul_reverse_avx; c->vector_fmul_add = ff_vector_fmul_add_avx; -#endif +#endif /* HAVE_AVX_EXTERNAL */ } void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx) diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index c0ef0ba..1033132 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -982,7 +982,7 @@ DCT_SAD_FUNC(mmx2) DCT_SAD_FUNC(sse2) #undef MMABS -#if HAVE_SSSE3 +#if HAVE_SSSE3_INLINE #define MMABS(a,z) MMABS_SSSE3(a,z) DCT_SAD_FUNC(ssse3) #undef MMABS @@ -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 PMULHRW -#if HAVE_SSSE3 +#if HAVE_SSSE3_INLINE #undef PHADDD #define DEF(x) x ## _ssse3 #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 #undef SCALE_OFFSET #undef PMULHRW #undef PHADDD -#endif //HAVE_SSSE3 +#endif /* HAVE_SSSE3_INLINE */ #endif /* HAVE_INLINE_ASM */ @@ -1161,7 +1161,7 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) c->sum_abs_dctelem= sum_abs_dctelem_sse2; } -#if HAVE_SSSE3 +#if HAVE_SSSE3_INLINE if(mm_flags & AV_CPU_FLAG_SSSE3){ if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ c->try_8x8basis= try_8x8basis_ssse3; diff --git a/libavcodec/x86/fft.asm b/libavcodec/x86/fft.asm index 645253c..f054298 100644 --- a/libavcodec/x86/fft.asm +++ b/libavcodec/x86/fft.asm @@ -305,7 +305,7 @@ IF%1 mova Z(1), m5 INIT_YMM avx -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL align 16 fft8_avx: mova m0, Z(0) @@ -552,7 +552,7 @@ DEFINE_ARGS zc, w, n, o1, o3 INIT_YMM avx -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL %macro INTERL_AVX 5 vunpckhps %3, %2, %1 vunpcklps %2, %2, %1 @@ -793,7 +793,7 @@ align 8 dispatch_tab %+ fullsuffix: pointer list_of_fft %endmacro ; DECL_FFT -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_YMM avx DECL_FFT 6 DECL_FFT 6, _interleave @@ -1100,6 +1100,6 @@ DECL_IMDCT POSROTATESHUF_3DNOW INIT_YMM avx -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL DECL_IMDCT POSROTATESHUF_AVX %endif diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm index f8a2cff..bcdb27c 100644 --- a/libavcodec/x86/h264_chromamc_10bit.asm +++ b/libavcodec/x86/h264_chromamc_10bit.asm @@ -252,7 +252,7 @@ cglobal %1_h264_chroma_mc2_10, 6,7 %define CHROMAMC_AVG NOTHING INIT_XMM sse2 CHROMA_MC8 put -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx CHROMA_MC8 put %endif @@ -264,7 +264,7 @@ CHROMA_MC2 put %define PAVG pavgw INIT_XMM sse2 CHROMA_MC8 avg -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx CHROMA_MC8 avg %endif diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm index 4b80669..6afcee2 100644 --- a/libavcodec/x86/h264_idct_10bit.asm +++ b/libavcodec/x86/h264_idct_10bit.asm @@ -80,7 +80,7 @@ cglobal h264_idct_add_10, 3,3 INIT_XMM sse2 IDCT_ADD_10 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT_ADD_10 %endif @@ -110,7 +110,7 @@ add4x4_idct %+ SUFFIX: INIT_XMM sse2 ALIGN 16 ADD4x4IDCT -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx ALIGN 16 ADD4x4IDCT @@ -150,7 +150,7 @@ cglobal h264_idct_add16_10, 5,6 INIT_XMM sse2 IDCT_ADD16_10 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT_ADD16_10 %endif @@ -216,7 +216,7 @@ cglobal h264_idct8_dc_add_10,3,3,7 INIT_XMM sse2 IDCT8_DC_ADD -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT8_DC_ADD %endif @@ -287,7 +287,7 @@ cglobal h264_idct_add16intra_10,5,7,8 INIT_XMM sse2 IDCT_ADD16INTRA_10 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT_ADD16INTRA_10 %endif @@ -324,7 +324,7 @@ cglobal h264_idct_add8_10,5,8,7 INIT_XMM sse2 IDCT_ADD8 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT_ADD8 %endif @@ -501,7 +501,7 @@ h264_idct8_add1_10 %+ SUFFIX: INIT_XMM sse2 IDCT8_ADD -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT8_ADD %endif @@ -541,7 +541,7 @@ cglobal h264_idct8_add4_10, 0,7,16 INIT_XMM sse2 IDCT8_ADD4 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_XMM avx IDCT8_ADD4 %endif diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm index 1423b56..529134e 100644 --- a/libavcodec/x86/h264_intrapred_10bit.asm +++ b/libavcodec/x86/h264_intrapred_10bit.asm @@ -84,7 +84,7 @@ INIT_XMM PRED4x4_DR sse2 %define PALIGNR PALIGNR_SSSE3 PRED4x4_DR ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED4x4_DR avx %endif @@ -124,7 +124,7 @@ INIT_XMM PRED4x4_VR sse2 %define PALIGNR PALIGNR_SSSE3 PRED4x4_VR ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED4x4_VR avx %endif @@ -167,7 +167,7 @@ INIT_XMM PRED4x4_HD sse2 %define PALIGNR PALIGNR_SSSE3 PRED4x4_HD ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED4x4_HD avx %endif @@ -238,7 +238,7 @@ cglobal pred4x4_down_left_10_%1, 3,3 INIT_XMM PRED4x4_DL sse2 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED4x4_DL avx %endif @@ -267,7 +267,7 @@ cglobal pred4x4_vertical_left_10_%1, 3,3 INIT_XMM PRED4x4_VL sse2 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED4x4_VL avx %endif @@ -577,7 +577,7 @@ cglobal pred8x8l_top_dc_10_%1, 4,4,6 INIT_XMM PRED8x8L_TOP_DC sse2 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_TOP_DC avx %endif @@ -636,7 +636,7 @@ cglobal pred8x8l_dc_10_%1, 4,6,6 INIT_XMM PRED8x8L_DC sse2 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_DC avx %endif @@ -671,7 +671,7 @@ cglobal pred8x8l_vertical_10_%1, 4,4,6 INIT_XMM PRED8x8L_VERTICAL sse2 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_VERTICAL avx %endif @@ -728,7 +728,7 @@ INIT_XMM PRED8x8L_HORIZONTAL sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_HORIZONTAL ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_HORIZONTAL avx %endif @@ -797,7 +797,7 @@ INIT_XMM PRED8x8L_DOWN_LEFT sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_DOWN_LEFT ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_DOWN_LEFT avx %endif @@ -872,7 +872,7 @@ INIT_XMM PRED8x8L_DOWN_RIGHT sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_DOWN_RIGHT ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_DOWN_RIGHT avx %endif @@ -943,7 +943,7 @@ INIT_XMM PRED8x8L_VERTICAL_RIGHT sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_VERTICAL_RIGHT ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_VERTICAL_RIGHT avx %endif @@ -1005,7 +1005,7 @@ INIT_XMM PRED8x8L_HORIZONTAL_UP sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_HORIZONTAL_UP ssse3 -%if HAVE_AVX +%if HAVE_AVX_EXTERNAL INIT_AVX PRED8x8L_HORIZONTAL_UP avx %endif diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c index fc1635d..284c85a 100644 --- a/libavcodec/x86/h264_qpel.c +++ b/libavcodec/x86/h264_qpel.c @@ -1174,7 +1174,7 @@ QPEL_H264_V_XMM(put_, PUT_OP, sse2) QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2) QPEL_H264_HV_XMM(put_, PUT_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(avg_, AVG_MMX2_OP, ssse3) QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3) @@ -1188,7 +1188,7 @@ H264_MC_4816(3dnow) H264_MC_4816(mmx2) H264_MC_816(H264_MC_V, 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_HV, ssse3) #endif diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index f24f751..7be78a8 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -39,7 +39,7 @@ IDCT_ADD_FUNC(8_dc, 10, sse2) IDCT_ADD_FUNC(8, 8, mmx) IDCT_ADD_FUNC(8, 8, sse2) IDCT_ADD_FUNC(8, 10, sse2) -#if HAVE_AVX +#if HAVE_AVX_EXTERNAL IDCT_ADD_FUNC(, 10, avx) IDCT_ADD_FUNC(8_dc, 10, avx) IDCT_ADD_FUNC(8, 10, avx) @@ -64,7 +64,7 @@ IDCT_ADD_REP_FUNC(, 16intra, 8, mmx) IDCT_ADD_REP_FUNC(, 16intra, 8, mmx2) IDCT_ADD_REP_FUNC(, 16intra, 8, 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(, 16intra, 10, avx) #endif @@ -79,7 +79,7 @@ IDCT_ADD_REP_FUNC2(, 8, 8, mmx) IDCT_ADD_REP_FUNC2(, 8, 8, mmx2) IDCT_ADD_REP_FUNC2(, 8, 8, sse2) IDCT_ADD_REP_FUNC2(, 8, 10, sse2) -#if HAVE_AVX +#if HAVE_AVX_EXTERNAL IDCT_ADD_REP_FUNC2(, 8, 10, avx) #endif @@ -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[2] = ff_h264_biweight_4_10_sse4; } -#if HAVE_AVX +#if HAVE_AVX_EXTERNAL if (mm_flags & AV_CPU_FLAG_AVX) { c->h264_idct_dc_add = 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, c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_avx; #endif /* HAVE_ALIGNED_STACK */ } -#endif /* HAVE_AVX */ +#endif /* HAVE_AVX_EXTERNAL */ } } } diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c index c3d8b83..31a6790 100644 --- a/libavcodec/x86/mpegvideoenc.c +++ b/libavcodec/x86/mpegvideoenc.c @@ -26,20 +26,18 @@ #include "libavcodec/mpegvideo.h" #include "dsputil_mmx.h" -#if HAVE_INLINE_ASM - extern uint16_t ff_inv_zigzag_direct16[64]; -#if HAVE_MMX +#if HAVE_MMX_INLINE #define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_SSE2 0 #define COMPILE_TEMPLATE_SSSE3 0 #define RENAME(a) a ## _MMX #define RENAMEl(a) a ## _mmx #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_SSE2 #undef COMPILE_TEMPLATE_MMXEXT @@ -51,9 +49,9 @@ extern uint16_t ff_inv_zigzag_direct16[64]; #define RENAME(a) a ## _MMX2 #define RENAMEl(a) a ## _mmx2 #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_SSE2 #undef COMPILE_TEMPLATE_SSSE3 @@ -65,9 +63,9 @@ extern uint16_t ff_inv_zigzag_direct16[64]; #define RENAME(a) a ## _SSE2 #define RENAMEl(a) a ## _sse2 #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_SSE2 #undef COMPILE_TEMPLATE_SSSE3 @@ -79,33 +77,29 @@ extern uint16_t ff_inv_zigzag_direct16[64]; #define RENAME(a) a ## _SSSE3 #define RENAMEl(a) a ## _sse2 #include "mpegvideoenc_template.c" -#endif /* HAVE_SSSE3 */ - -#endif /* HAVE_INLINE_ASM */ +#endif /* HAVE_SSSE3_INLINE */ void ff_MPV_encode_init_x86(MpegEncContext *s) { -#if HAVE_INLINE_ASM int mm_flags = av_get_cpu_flags(); const int dct_algo = s->avctx->dct_algo; 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) s->dct_quantize = dct_quantize_MMX; #endif -#if HAVE_MMXEXT +#if HAVE_MMXEXT_INLINE if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT) s->dct_quantize = dct_quantize_MMX2; #endif -#if HAVE_SSE2 +#if HAVE_SSE2_INLINE if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE2) s->dct_quantize = dct_quantize_SSE2; #endif -#if HAVE_SSSE3 +#if HAVE_SSSE3_INLINE if (mm_flags & AV_CPU_FLAG_SSSE3) s->dct_quantize = dct_quantize_SSSE3; #endif } -#endif /* HAVE_INLINE_ASM */ } -- cgit v1.1