diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-04-21 00:13:01 +0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-04-22 14:05:09 +0400 |
commit | b4ad7c54c878dead7dfa4838b912a530c1debe85 (patch) | |
tree | 8fbe57cb50d861eb3f1a5a22b7e21a377543d4c2 /libavcodec | |
parent | a0d5ca4f0a8e2c34d784d503a12af6303424ac6a (diff) |
x86: cavs: Refactor duplicate dspfunc macro
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/x86/cavsdsp.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index c1506e00f1..d9cf85f1b6 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -459,6 +459,12 @@ static av_cold void cavsdsp_init_mmx(CAVSDSPContext *c, } #endif /* HAVE_MMX_INLINE */ +#define DSPFUNC(PFX, IDX, NUM, EXT) \ + c->PFX ## _cavs_qpel_pixels_tab[IDX][ 2] = ff_ ## PFX ## _cavs_qpel ## NUM ## _mc20_ ## EXT; \ + c->PFX ## _cavs_qpel_pixels_tab[IDX][ 4] = ff_ ## PFX ## _cavs_qpel ## NUM ## _mc01_ ## EXT; \ + c->PFX ## _cavs_qpel_pixels_tab[IDX][ 8] = ff_ ## PFX ## _cavs_qpel ## NUM ## _mc02_ ## EXT; \ + c->PFX ## _cavs_qpel_pixels_tab[IDX][12] = ff_ ## PFX ## _cavs_qpel ## NUM ## _mc03_ ## EXT; \ + #if HAVE_MMXEXT_INLINE QPEL_CAVS(put_, PUT_OP, mmxext) QPEL_CAVS(avg_, AVG_MMXEXT_OP, mmxext) @@ -471,17 +477,10 @@ CAVS_MC(avg_, 16, mmxext) static av_cold void ff_cavsdsp_init_mmxext(CAVSDSPContext *c, AVCodecContext *avctx) { -#define dspfunc(PFX, IDX, NUM) \ - c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_mmxext; \ - c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_mmxext; \ - c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_mmxext; \ - c->PFX ## _pixels_tab[IDX][12] = ff_ ## PFX ## NUM ## _mc03_mmxext; \ - - dspfunc(put_cavs_qpel, 0, 16); - dspfunc(put_cavs_qpel, 1, 8); - dspfunc(avg_cavs_qpel, 0, 16); - dspfunc(avg_cavs_qpel, 1, 8); -#undef dspfunc + DSPFUNC(put, 0, 16, mmxext); + DSPFUNC(put, 1, 8, mmxext); + DSPFUNC(avg, 0, 16, mmxext); + DSPFUNC(avg, 1, 8, mmxext); } #endif /* HAVE_MMXEXT_INLINE */ @@ -497,17 +496,10 @@ CAVS_MC(avg_, 16,3dnow) static av_cold void ff_cavsdsp_init_3dnow(CAVSDSPContext *c, AVCodecContext *avctx) { -#define dspfunc(PFX, IDX, NUM) \ - c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_3dnow; \ - c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_3dnow; \ - c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_3dnow; \ - c->PFX ## _pixels_tab[IDX][12] = ff_ ## PFX ## NUM ## _mc03_3dnow; \ - - dspfunc(put_cavs_qpel, 0, 16); - dspfunc(put_cavs_qpel, 1, 8); - dspfunc(avg_cavs_qpel, 0, 16); - dspfunc(avg_cavs_qpel, 1, 8); -#undef dspfunc + DSPFUNC(put, 0, 16, 3dnow); + DSPFUNC(put, 1, 8, 3dnow); + DSPFUNC(avg, 0, 16, 3dnow); + DSPFUNC(avg, 1, 8, 3dnow); } #endif /* HAVE_AMD3DNOW_INLINE */ |