diff options
author | Måns Rullgård <mans@mansr.com> | 2010-08-03 20:59:00 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-08-03 20:59:00 +0000 |
commit | f079a64aea0d19dd7adfc045747cd4b4dfb6225c (patch) | |
tree | f02085b637c2b6386bc96ed92aac18e7b8450383 /libavcodec/x86 | |
parent | 61ee75bbf86cc2a69fb02c32e391c197ddd9fcf3 (diff) | |
download | ffmpeg-f079a64aea0d19dd7adfc045747cd4b4dfb6225c.tar.gz |
Move cavs dsp functions to their own struct
Originally committed as revision 24685 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/cavsdsp_mmx.c | 13 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_mmx.c | 6 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_mmx.h | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/libavcodec/x86/cavsdsp_mmx.c b/libavcodec/x86/cavsdsp_mmx.c index e8c7065fd7..7872b3cced 100644 --- a/libavcodec/x86/cavsdsp_mmx.c +++ b/libavcodec/x86/cavsdsp_mmx.c @@ -25,6 +25,7 @@ #include "libavutil/common.h" #include "libavutil/x86_cpu.h" #include "libavcodec/dsputil.h" +#include "libavcodec/cavsdsp.h" #include "dsputil_mmx.h" /***************************************************************************** @@ -437,7 +438,7 @@ CAVS_MC(put_, 16,mmx2) CAVS_MC(avg_, 8, mmx2) CAVS_MC(avg_, 16,mmx2) -void ff_cavsdsp_init_mmx2(DSPContext* c, AVCodecContext *avctx) { +static void ff_cavsdsp_init_mmx2(CAVSDSPContext* c, AVCodecContext *avctx) { #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmx2; \ c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_mmx2; \ @@ -453,7 +454,7 @@ void ff_cavsdsp_init_mmx2(DSPContext* c, AVCodecContext *avctx) { c->cavs_idct8_add = cavs_idct8_add_mmx; } -void ff_cavsdsp_init_3dnow(DSPContext* c, AVCodecContext *avctx) { +static void ff_cavsdsp_init_3dnow(CAVSDSPContext* c, AVCodecContext *avctx) { #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmx2; \ c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_3dnow; \ @@ -468,3 +469,11 @@ void ff_cavsdsp_init_3dnow(DSPContext* c, AVCodecContext *avctx) { #undef dspfunc c->cavs_idct8_add = cavs_idct8_add_mmx; } + +void ff_cavsdsp_init_mmx(CAVSDSPContext *c, AVCodecContext *avctx) +{ + int mm_flags = mm_support(); + + if (mm_flags & FF_MM_MMX2) ff_cavsdsp_init_mmx2 (c, avctx); + if (mm_flags & FF_MM_3DNOW) ff_cavsdsp_init_3dnow(c, avctx); +} diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 79d4bfce29..f06d4e5a5a 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -2727,9 +2727,6 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) c->add_hfyu_median_prediction = add_hfyu_median_prediction_cmov; #endif - if (CONFIG_CAVS_DECODER) - ff_cavsdsp_init_mmx2(c, avctx); - if (CONFIG_VC1_DECODER) ff_vc1dsp_init_mmx(c, avctx); @@ -2790,9 +2787,6 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) c->avg_rv40_chroma_pixels_tab[0]= avg_rv40_chroma_mc8_3dnow; c->avg_rv40_chroma_pixels_tab[1]= avg_rv40_chroma_mc4_3dnow; - - if (CONFIG_CAVS_DECODER) - ff_cavsdsp_init_3dnow(c, avctx); } diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h index 5de1c908f1..116a9c68a5 100644 --- a/libavcodec/x86/dsputil_mmx.h +++ b/libavcodec/x86/dsputil_mmx.h @@ -162,8 +162,6 @@ void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); -void ff_cavsdsp_init_mmx2(DSPContext* c, AVCodecContext *avctx); -void ff_cavsdsp_init_3dnow(DSPContext* c, AVCodecContext *avctx); void ff_put_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride); void ff_avg_cavs_qpel8_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride); void ff_put_cavs_qpel16_mc00_mmx2(uint8_t *dst, uint8_t *src, int stride); |