diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-07 15:27:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-07 15:36:58 +0200 |
commit | 020865f557ccf06a41ecc461fd13ce6678817d04 (patch) | |
tree | 657a0da279922b830200908b6e620be025e20b85 /libavcodec/x86/mpegvideoencdsp_init.c | |
parent | 462c6cdb8ed256d2063815b67ca4d14e62e25802 (diff) | |
parent | c166148409fe8f0dbccef2fe684286a40ba1e37d (diff) | |
download | ffmpeg-020865f557ccf06a41ecc461fd13ce6678817d04.tar.gz |
Merge commit 'c166148409fe8f0dbccef2fe684286a40ba1e37d'
* commit 'c166148409fe8f0dbccef2fe684286a40ba1e37d':
dsputil: Move pix_sum, pix_norm1, shrink function pointers to mpegvideoenc
Conflicts:
libavcodec/dsputil.c
libavcodec/mpegvideo_enc.c
libavcodec/x86/dsputilenc.asm
libavcodec/x86/dsputilenc_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/mpegvideoencdsp_init.c')
-rw-r--r-- | libavcodec/x86/mpegvideoencdsp_init.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c index d7650ec0e1..16841893a4 100644 --- a/libavcodec/x86/mpegvideoencdsp_init.c +++ b/libavcodec/x86/mpegvideoencdsp_init.c @@ -22,6 +22,12 @@ #include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" +int ff_pix_sum16_mmx(uint8_t *pix, int line_size); +int ff_pix_sum16_sse2(uint8_t *pix, int line_size); +int ff_pix_sum16_xop(uint8_t *pix, int line_size); +int ff_pix_norm1_mmx(uint8_t *pix, int line_size); +int ff_pix_norm1_sse2(uint8_t *pix, int line_size); + #if HAVE_INLINE_ASM #define PHADDD(a, t) \ @@ -95,9 +101,24 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, AVCodecContext *avctx) { -#if HAVE_INLINE_ASM int cpu_flags = av_get_cpu_flags(); + if (EXTERNAL_MMX(cpu_flags)) { + c->pix_sum = ff_pix_sum16_mmx; + c->pix_norm1 = ff_pix_norm1_mmx; + } + + if (EXTERNAL_SSE2(cpu_flags)) { + c->pix_sum = ff_pix_sum16_sse2; + c->pix_norm1 = ff_pix_norm1_sse2; + } + + if (EXTERNAL_XOP(cpu_flags)) { + c->pix_sum = ff_pix_sum16_xop; + } + +#if HAVE_INLINE_ASM + if (INLINE_MMX(cpu_flags)) { if (!(avctx->flags & CODEC_FLAG_BITEXACT)) { c->try_8x8basis = try_8x8basis_mmx; |