diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-29 18:13:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-29 18:13:00 +0200 |
commit | 8579d4b2f0cc7d46dc75e0a0e42d556d653463fc (patch) | |
tree | 8ab65fc1ed0ff0371f552430a33f5ebf57bc5dea /libavcodec/x86 | |
parent | 1c66807636ed8da5cf81d75cc8bb2726c6d6bc21 (diff) | |
parent | 7baa115a33ab516c85ac94f6c5cdaee73e65ddf8 (diff) | |
download | ffmpeg-8579d4b2f0cc7d46dc75e0a0e42d556d653463fc.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
build: export filtered -lz flag in config.mak
build: add separate setting for host linker
configure: probe_cc: use separate variable for linker output flag
x86: Always compile files with functions that are called unconditionally
x86: mpegvideoenc: fix linking with --disable-mmx
x86: mpegvideoenc: Do not abuse HAVE_ variables for template instantiation
Conflicts:
Makefile
configure
libavcodec/x86/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/Makefile | 6 | ||||
-rw-r--r-- | libavcodec/x86/mpegvideoenc.c | 45 | ||||
-rw-r--r-- | libavcodec/x86/mpegvideoenc_template.c | 8 |
3 files changed, 32 insertions, 27 deletions
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 74b7a891f9..6f306d155a 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -1,4 +1,7 @@ +OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o +OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o +OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o @@ -14,7 +17,6 @@ MMX-OBJS += x86/dsputil_mmx.o \ MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o -MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp.o \ x86/dwt.o MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o @@ -24,8 +26,6 @@ MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o MMX-OBJS-$(CONFIG_LPC) += x86/lpc.o MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec.o -MMX-OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o -MMX-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c index 2d190f979f..3d75919ba2 100644 --- a/libavcodec/x86/mpegvideoenc.c +++ b/libavcodec/x86/mpegvideoenc.c @@ -30,39 +30,44 @@ extern uint16_t ff_inv_zigzag_direct16[64]; -#if HAVE_SSSE3 -#define HAVE_SSSE3_BAK -#endif -#undef HAVE_SSSE3 -#define HAVE_SSSE3 0 - -#undef HAVE_SSE2 -#undef HAVE_MMXEXT -#define HAVE_SSE2 0 -#define HAVE_MMXEXT 0 +#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" -#undef HAVE_MMXEXT -#define HAVE_MMXEXT 1 +#undef COMPILE_TEMPLATE_SSSE3 +#undef COMPILE_TEMPLATE_SSE2 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 +#define COMPILE_TEMPLATE_SSE2 0 +#define COMPILE_TEMPLATE_SSSE3 0 #undef RENAME #undef RENAMEl #define RENAME(a) a ## _MMX2 #define RENAMEl(a) a ## _mmx2 #include "mpegvideoenc_template.c" -#undef HAVE_SSE2 -#define HAVE_SSE2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#undef COMPILE_TEMPLATE_SSE2 +#undef COMPILE_TEMPLATE_SSSE3 +#define COMPILE_TEMPLATE_MMXEXT 0 +#define COMPILE_TEMPLATE_SSE2 1 +#define COMPILE_TEMPLATE_SSSE3 0 #undef RENAME #undef RENAMEl #define RENAME(a) a ## _SSE2 #define RENAMEl(a) a ## _sse2 #include "mpegvideoenc_template.c" -#ifdef HAVE_SSSE3_BAK -#undef HAVE_SSSE3 -#define HAVE_SSSE3 1 +#if HAVE_SSSE3 +#undef COMPILE_TEMPLATE_MMXEXT +#undef COMPILE_TEMPLATE_SSE2 +#undef COMPILE_TEMPLATE_SSSE3 +#define COMPILE_TEMPLATE_MMXEXT 0 +#define COMPILE_TEMPLATE_SSE2 1 +#define COMPILE_TEMPLATE_SSSE3 1 #undef RENAME #undef RENAMEl #define RENAME(a) a ## _SSSE3 @@ -84,11 +89,11 @@ void ff_MPV_encode_init_x86(MpegEncContext *s) s->dct_quantize = dct_quantize_SSSE3; } else #endif - if (mm_flags & AV_CPU_FLAG_SSE2) { + if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) { s->dct_quantize = dct_quantize_SSE2; - } else if (mm_flags & AV_CPU_FLAG_MMXEXT) { + } else if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT) { s->dct_quantize = dct_quantize_MMX2; - } else { + } else if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX) { s->dct_quantize = dct_quantize_MMX; } } diff --git a/libavcodec/x86/mpegvideoenc_template.c b/libavcodec/x86/mpegvideoenc_template.c index d538a39919..d874f39ec7 100644 --- a/libavcodec/x86/mpegvideoenc_template.c +++ b/libavcodec/x86/mpegvideoenc_template.c @@ -29,7 +29,7 @@ #undef SAVE_SIGN #undef RESTORE_SIGN -#if HAVE_SSE2 +#if COMPILE_TEMPLATE_SSE2 #define MMREG_WIDTH "16" #define MM "%%xmm" #define MOVQ "movdqa" @@ -48,7 +48,7 @@ #define MMREG_WIDTH "8" #define MM "%%mm" #define MOVQ "movq" -#if HAVE_MMXEXT +#if COMPILE_TEMPLATE_MMXEXT #define SPREADW(a) "pshufw $0, "a", "a" \n\t" #define PMAXW(a,b) "pmaxsw "a", "b" \n\t" #define PMAX(a,b) \ @@ -74,7 +74,7 @@ #endif #endif -#if HAVE_SSSE3 +#if COMPILE_TEMPLATE_SSSE3 #define SAVE_SIGN(a,b) \ "movdqa "b", "a" \n\t"\ "pabsw "b", "b" \n\t" @@ -215,7 +215,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, SPREADW(MM"1") "psubusw "MM"1, "MM"4 \n\t" "packuswb "MM"4, "MM"4 \n\t" -#if HAVE_SSE2 +#if COMPILE_TEMPLATE_SSE2 "packuswb "MM"4, "MM"4 \n\t" #endif "movd "MM"4, %0 \n\t" // *overflow |