summaryrefslogtreecommitdiff
path: root/libavcodec/x86/mpegvideoenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-31 12:04:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-31 13:01:30 +0200
commit98298eb1034bddb4557fa689553dae793c2b0092 (patch)
treed35dcd981b6647c9f538bc9b346ab806864bc359 /libavcodec/x86/mpegvideoenc.c
parentf3683349aecf3be4c9c875186a812c0cde8ecf41 (diff)
parentec36aa69448f20a78d8c4588265022e0b2272ab5 (diff)
Merge commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5'
* commit 'ec36aa69448f20a78d8c4588265022e0b2272ab5': x86: Fix linking with some or all of yasm, mmx, optimizations disabled configure: Add more fine-grained SSE CPU capabilities flags avfilter: x86: Use more precise compile template names x86: cosmetics: Comment some #endifs for better readability g723_1: add comfort noise generation utvideoenc: Switch to dsputils' median prediction utvideoenc: Avoid writing into the input picture avtools: remove the distinction between func_arg and func2_arg. avconv: make the -passlogfile option per-stream. avconv: make the -pass option per-stream. cmdutils: make -codecs print lossy/lossless flags. lavc: add lossy/lossless codec properties. Conflicts: Changelog cmdutils.c configure doc/APIchanges ffmpeg.h ffmpeg_opt.c ffprobe.c libavcodec/codec_desc.c libavcodec/g723_1.c libavcodec/utvideoenc.c libavcodec/version.h libavcodec/x86/mpegaudiodec.c libavcodec/x86/rv40dsp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/mpegvideoenc.c')
-rw-r--r--libavcodec/x86/mpegvideoenc.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c
index 3d75919ba2..93ca54aff9 100644
--- a/libavcodec/x86/mpegvideoenc.c
+++ b/libavcodec/x86/mpegvideoenc.c
@@ -30,13 +30,16 @@
extern uint16_t ff_inv_zigzag_direct16[64];
+#if HAVE_MMX
#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 */
+#if HAVE_MMXEXT
#undef COMPILE_TEMPLATE_SSSE3
#undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_MMXEXT
@@ -48,7 +51,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 */
+#if HAVE_SSE2
#undef COMPILE_TEMPLATE_MMXEXT
#undef COMPILE_TEMPLATE_SSE2
#undef COMPILE_TEMPLATE_SSSE3
@@ -60,6 +65,7 @@ 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 */
#if HAVE_SSSE3
#undef COMPILE_TEMPLATE_MMXEXT
@@ -73,7 +79,7 @@ extern uint16_t ff_inv_zigzag_direct16[64];
#define RENAME(a) a ## _SSSE3
#define RENAMEl(a) a ## _sse2
#include "mpegvideoenc_template.c"
-#endif
+#endif /* HAVE_SSSE3 */
#endif /* HAVE_INLINE_ASM */
@@ -84,18 +90,22 @@ void ff_MPV_encode_init_x86(MpegEncContext *s)
const int dct_algo = s->avctx->dct_algo;
if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
+#if HAVE_MMX
+ if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX)
+ s->dct_quantize = dct_quantize_MMX;
+#endif
+#if HAVE_MMXEXT
+ if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT)
+ s->dct_quantize = dct_quantize_MMX2;
+#endif
+#if HAVE_SSE2
+ if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE2)
+ s->dct_quantize = dct_quantize_SSE2;
+#endif
#if HAVE_SSSE3
- if (mm_flags & AV_CPU_FLAG_SSSE3) {
+ if (mm_flags & AV_CPU_FLAG_SSSE3)
s->dct_quantize = dct_quantize_SSSE3;
- } else
#endif
- if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) {
- s->dct_quantize = dct_quantize_SSE2;
- } else if (mm_flags & AV_CPU_FLAG_MMXEXT && HAVE_MMXEXT) {
- s->dct_quantize = dct_quantize_MMX2;
- } else if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX) {
- s->dct_quantize = dct_quantize_MMX;
- }
}
#endif /* HAVE_INLINE_ASM */
}