aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86
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
parentf3683349aecf3be4c9c875186a812c0cde8ecf41 (diff)
parentec36aa69448f20a78d8c4588265022e0b2272ab5 (diff)
downloadffmpeg-98298eb1034bddb4557fa689553dae793c2b0092.tar.gz
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')
-rw-r--r--libavcodec/x86/dsputil_mmx.c10
-rw-r--r--libavcodec/x86/fmtconvert_init.c4
-rw-r--r--libavcodec/x86/mpegaudiodec.c4
-rw-r--r--libavcodec/x86/mpegvideoenc.c30
-rw-r--r--libavcodec/x86/rv34dsp_init.c2
-rw-r--r--libavcodec/x86/rv40dsp_init.c15
-rw-r--r--libavcodec/x86/vc1dsp_mmx.c5
-rw-r--r--libavcodec/x86/vp8dsp_init.c4
8 files changed, 41 insertions, 33 deletions
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index db3c78dff3..5997adcb3a 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -2822,7 +2822,7 @@ static void dsputil_init_mmx2(DSPContext *c, AVCodecContext *avctx,
#endif
SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 10_mmxext, ff_);
SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 10_mmxext, ff_);
-#endif
+#endif /* HAVE_YASM */
}
#if HAVE_INLINE_ASM
@@ -2857,7 +2857,7 @@ static void dsputil_init_mmx2(DSPContext *c, AVCodecContext *avctx,
} else {
c->apply_window_int16 = ff_apply_window_int16_mmxext;
}
-#endif
+#endif /* HAVE_YASM */
}
static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx,
@@ -2936,7 +2936,7 @@ static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx,
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_3dnow_rnd;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_3dnow;
}
-#endif
+#endif /* HAVE_YASM */
}
static void dsputil_init_3dnowext(DSPContext *c, AVCodecContext *avctx,
@@ -2982,7 +2982,7 @@ static void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx, int mm_flags)
#if HAVE_INLINE_ASM
c->gmc = gmc_sse;
#endif
-#endif
+#endif /* HAVE_YASM */
}
static void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
@@ -3050,7 +3050,7 @@ static void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
c->apply_window_int16 = ff_apply_window_int16_sse2;
}
c->bswap_buf = ff_bswap32_buf_sse2;
-#endif
+#endif /* HAVE_YASM */
}
static void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
diff --git a/libavcodec/x86/fmtconvert_init.c b/libavcodec/x86/fmtconvert_init.c
index 361ac85faf..2aa23ba780 100644
--- a/libavcodec/x86/fmtconvert_init.c
+++ b/libavcodec/x86/fmtconvert_init.c
@@ -110,7 +110,7 @@ static void float_interleave_sse(float *dst, const float **src,
else
ff_float_interleave_c(dst, src, len, channels);
}
-#endif
+#endif /* HAVE_YASM */
void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
{
@@ -143,5 +143,5 @@ void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
c->float_to_int16_interleave = float_to_int16_interleave_sse2;
}
}
-#endif
+#endif /* HAVE_YASM */
}
diff --git a/libavcodec/x86/mpegaudiodec.c b/libavcodec/x86/mpegaudiodec.c
index 7bc0c30c4f..8da3e02b78 100644
--- a/libavcodec/x86/mpegaudiodec.c
+++ b/libavcodec/x86/mpegaudiodec.c
@@ -182,6 +182,7 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out,
#endif /* HAVE_INLINE_ASM */
+#if HAVE_YASM
#define DECL_IMDCT_BLOCKS(CPU1, CPU2) \
static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in, \
int count, int switch_point, int block_type) \
@@ -214,7 +215,6 @@ static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in, \
} \
}
-#if HAVE_YASM
#if HAVE_SSE
DECL_IMDCT_BLOCKS(sse,sse)
DECL_IMDCT_BLOCKS(sse2,sse)
@@ -224,7 +224,7 @@ DECL_IMDCT_BLOCKS(ssse3,sse)
#if HAVE_AVX
DECL_IMDCT_BLOCKS(avx,avx)
#endif
-#endif
+#endif /* HAVE_YASM */
void ff_mpadsp_init_mmx(MPADSPContext *s)
{
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 */
}
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index b07ad89f0e..de323e9c3c 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -43,5 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp)
}
if (mm_flags & AV_CPU_FLAG_SSE4)
c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
-#endif
+#endif /* HAVE_YASM */
}
diff --git a/libavcodec/x86/rv40dsp_init.c b/libavcodec/x86/rv40dsp_init.c
index 1c193076b0..50aaa24b43 100644
--- a/libavcodec/x86/rv40dsp_init.c
+++ b/libavcodec/x86/rv40dsp_init.c
@@ -2,20 +2,20 @@
* RV40 decoder motion compensation functions x86-optimised
* Copyright (c) 2008 Konstantin Shishkov
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -30,6 +30,7 @@
#include "libavutil/mem.h"
#include "dsputil_mmx.h"
+#if HAVE_YASM
void ff_put_rv40_chroma_mc8_mmx (uint8_t *dst, uint8_t *src,
int stride, int h, int x, int y);
void ff_avg_rv40_chroma_mc8_mmx2 (uint8_t *dst, uint8_t *src,
@@ -57,8 +58,6 @@ DECLARE_WEIGHT(mmx2)
DECLARE_WEIGHT(sse2)
DECLARE_WEIGHT(ssse3)
-#if HAVE_YASM
-
/** @{ */
/**
* Define one qpel function.
@@ -185,7 +184,7 @@ QPEL_FUNCS_SET (OP, 3, 1, OPT) \
QPEL_FUNCS_SET (OP, 3, 2, OPT)
/** @} */
-#endif //HAVE_YASM
+#endif /* HAVE_YASM */
void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp)
{
@@ -238,5 +237,5 @@ void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp)
QPEL_MC_SET(put_, _ssse3)
QPEL_MC_SET(avg_, _ssse3)
}
-#endif
+#endif /* HAVE_YASM */
}
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
index 454be97f36..66251d0b15 100644
--- a/libavcodec/x86/vc1dsp_mmx.c
+++ b/libavcodec/x86/vc1dsp_mmx.c
@@ -717,8 +717,7 @@ static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq)
ff_vc1_h_loop_filter8_sse4(src, stride, pq);
ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq);
}
-
-#endif
+#endif /* HAVE_YASM */
void ff_put_vc1_chroma_mc8_mmx_nornd (uint8_t *dst, uint8_t *src,
int stride, int h, int x, int y);
@@ -828,5 +827,5 @@ void ff_vc1dsp_init_mmx(VC1DSPContext *dsp)
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse4;
dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse4;
}
-#endif
+#endif /* HAVE_YASM */
}
diff --git a/libavcodec/x86/vp8dsp_init.c b/libavcodec/x86/vp8dsp_init.c
index a7e351ad9a..a9f2740f76 100644
--- a/libavcodec/x86/vp8dsp_init.c
+++ b/libavcodec/x86/vp8dsp_init.c
@@ -289,7 +289,7 @@ DECLARE_LOOP_FILTER(sse2)
DECLARE_LOOP_FILTER(ssse3)
DECLARE_LOOP_FILTER(sse4)
-#endif
+#endif /* HAVE_YASM */
#define VP8_LUMA_MC_FUNC(IDX, SIZE, OPT) \
c->put_vp8_epel_pixels_tab[IDX][0][2] = ff_put_vp8_epel ## SIZE ## _h6_ ## OPT; \
@@ -446,5 +446,5 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
c->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mbedge_sse4;
#endif
}
-#endif
+#endif /* HAVE_YASM */
}