diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-04-22 04:57:48 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-04-22 17:50:02 +0200 |
commit | c1ad70c3cb0588254d66265578cfb14580dc0b94 (patch) | |
tree | d3f1ef4d5c10b8cfbfc676ba49c6a772ad1e1d5c /libavcodec | |
parent | 10f1a4d9bd8239ac64f364e0d3b6423c28230d6d (diff) | |
download | ffmpeg-c1ad70c3cb0588254d66265578cfb14580dc0b94.tar.gz |
x86: Move some conditional code around to avoid unused variable warnings
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/x86/dsputil_mmx.c | 27 | ||||
-rw-r--r-- | libavcodec/x86/dsputilenc_mmx.c | 3 | ||||
-rw-r--r-- | libavcodec/x86/mpegvideoenc.c | 2 |
3 files changed, 15 insertions, 17 deletions
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index d3bc72c791..1d96efc0f9 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -1279,9 +1279,9 @@ void ff_vector_clip_int32_sse4 (int32_t *dst, const int32_t *src, static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, int mm_flags) { +#if HAVE_INLINE_ASM const int high_bit_depth = avctx->bits_per_raw_sample > 8; -#if HAVE_INLINE_ASM c->put_pixels_clamped = ff_put_pixels_clamped_mmx; c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx; c->add_pixels_clamped = ff_add_pixels_clamped_mmx; @@ -1319,26 +1319,15 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, } c->vector_clip_int32 = ff_vector_clip_int32_mmx; -#endif - +#endif /* HAVE_YASM */ } static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx, int mm_flags) { +#if HAVE_INLINE_ASM const int high_bit_depth = avctx->bits_per_raw_sample > 8; -#if HAVE_YASM - SET_QPEL_FUNCS(avg_qpel, 0, 16, mmxext, ); - SET_QPEL_FUNCS(avg_qpel, 1, 8, mmxext, ); - - SET_QPEL_FUNCS(put_qpel, 0, 16, mmxext, ); - SET_QPEL_FUNCS(put_qpel, 1, 8, mmxext, ); - SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, ); - SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmxext, ); -#endif /* HAVE_YASM */ - -#if HAVE_INLINE_ASM if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) { c->idct_put = ff_idct_xvid_mmxext_put; c->idct_add = ff_idct_xvid_mmxext_add; @@ -1347,6 +1336,14 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx, #endif /* HAVE_INLINE_ASM */ #if HAVE_MMXEXT_EXTERNAL + SET_QPEL_FUNCS(avg_qpel, 0, 16, mmxext, ); + SET_QPEL_FUNCS(avg_qpel, 1, 8, mmxext, ); + + SET_QPEL_FUNCS(put_qpel, 0, 16, mmxext, ); + SET_QPEL_FUNCS(put_qpel, 1, 8, mmxext, ); + SET_QPEL_FUNCS(put_no_rnd_qpel, 0, 16, mmxext, ); + SET_QPEL_FUNCS(put_no_rnd_qpel, 1, 8, mmxext, ); + /* slower than cmov version on AMD */ if (!(mm_flags & AV_CPU_FLAG_3DNOW)) c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmxext; @@ -1383,9 +1380,9 @@ static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx, static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx, int mm_flags) { +#if HAVE_SSE2_INLINE const int high_bit_depth = avctx->bits_per_raw_sample > 8; -#if HAVE_SSE2_INLINE if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) { c->idct_put = ff_idct_xvid_sse2_put; c->idct_add = ff_idct_xvid_sse2_add; diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index 67db52c873..ef85488beb 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -946,9 +946,10 @@ hadamard_func(ssse3) av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx) { int mm_flags = av_get_cpu_flags(); - int bit_depth = avctx->bits_per_raw_sample; #if HAVE_YASM + int bit_depth = avctx->bits_per_raw_sample; + if (EXTERNAL_MMX(mm_flags)) { if (bit_depth <= 8) c->get_pixels = ff_get_pixels_mmx; diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c index c32c0ce2b6..7ecb5d49a6 100644 --- a/libavcodec/x86/mpegvideoenc.c +++ b/libavcodec/x86/mpegvideoenc.c @@ -83,11 +83,11 @@ extern uint16_t ff_inv_zigzag_direct16[64]; av_cold void ff_MPV_encode_init_x86(MpegEncContext *s) { - 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_INLINE + int mm_flags = av_get_cpu_flags(); if (INLINE_MMX(mm_flags)) s->dct_quantize = dct_quantize_MMX; #endif |