diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-09-09 10:56:51 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-09-09 10:56:51 +0000 |
commit | d60e8b3d723ce50c8fa6789956f145f530d95703 (patch) | |
tree | c98500926871258367659cd3bd83bd2504a93707 | |
parent | 4c532c4eb718a92eb00aa22f780b6cb6e4d03a1d (diff) |
Use preprocessor conditionals to disable CPU-extension-specific code. We cannot
rely on libmpeg2's internal CPU extension handling, it leads to link failures
with our build system. Fixes Bugzilla #1188.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27554 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpeg2/idct.c | 16 | ||||
-rw-r--r-- | libmpeg2/libmpeg-0.4.1.diff | 67 | ||||
-rw-r--r-- | libmpeg2/motion_comp.c | 14 |
3 files changed, 85 insertions, 12 deletions
diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c index 80b84527da..7992fd5da4 100644 --- a/libmpeg2/idct.c +++ b/libmpeg2/idct.c @@ -239,16 +239,20 @@ static void mpeg2_idct_add_c (const int last, int16_t * block, void mpeg2_idct_init (uint32_t accel) { -#ifdef ARCH_X86 +#ifdef HAVE_SSE2 if (accel & MPEG2_ACCEL_X86_SSE2) { mpeg2_idct_copy = mpeg2_idct_copy_sse2; mpeg2_idct_add = mpeg2_idct_add_sse2; mpeg2_idct_mmx_init (); - } else if (accel & MPEG2_ACCEL_X86_MMXEXT) { + } else +#elif HAVE_MMX2 + if (accel & MPEG2_ACCEL_X86_MMXEXT) { mpeg2_idct_copy = mpeg2_idct_copy_mmxext; mpeg2_idct_add = mpeg2_idct_add_mmxext; mpeg2_idct_mmx_init (); - } else if (accel & MPEG2_ACCEL_X86_MMX) { + } else +#elif HAVE_MMX + if (accel & MPEG2_ACCEL_X86_MMX) { mpeg2_idct_copy = mpeg2_idct_copy_mmx; mpeg2_idct_add = mpeg2_idct_add_mmx; mpeg2_idct_mmx_init (); @@ -261,12 +265,14 @@ void mpeg2_idct_init (uint32_t accel) mpeg2_idct_altivec_init (); } else #endif -#ifdef ARCH_ALPHA +#ifdef HAVE_VIS if (accel & MPEG2_ACCEL_ALPHA_MVI) { mpeg2_idct_copy = mpeg2_idct_copy_mvi; mpeg2_idct_add = mpeg2_idct_add_mvi; mpeg2_idct_alpha_init (); - } else if (accel & MPEG2_ACCEL_ALPHA) { + } else +#elif ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA) { int i; mpeg2_idct_copy = mpeg2_idct_copy_alpha; diff --git a/libmpeg2/libmpeg-0.4.1.diff b/libmpeg2/libmpeg-0.4.1.diff index dec522ee5e..476cf99643 100644 --- a/libmpeg2/libmpeg-0.4.1.diff +++ b/libmpeg2/libmpeg-0.4.1.diff @@ -162,7 +162,28 @@ k * mpeg2dec->quantizer_matrix[index][j]; --- libmpeg2/idct.c (revision 26652) +++ libmpeg2/idct.c (working copy) -@@ -250,7 +254,7 @@ +@@ -235,30 +239,40 @@ + + void mpeg2_idct_init (uint32_t accel) + { +-#ifdef ARCH_X86 ++#ifdef HAVE_SSE2 ++ if (accel & MPEG2_ACCEL_X86_SSE2) { ++ mpeg2_idct_copy = mpeg2_idct_copy_sse2; ++ mpeg2_idct_add = mpeg2_idct_add_sse2; ++ mpeg2_idct_mmx_init (); ++ } else ++#elif HAVE_MMX2 + if (accel & MPEG2_ACCEL_X86_MMXEXT) { + mpeg2_idct_copy = mpeg2_idct_copy_mmxext; + mpeg2_idct_add = mpeg2_idct_add_mmxext; + mpeg2_idct_mmx_init (); +- } else if (accel & MPEG2_ACCEL_X86_MMX) { ++ } else ++#elif HAVE_MMX ++ if (accel & MPEG2_ACCEL_X86_MMX) { + mpeg2_idct_copy = mpeg2_idct_copy_mmx; + mpeg2_idct_add = mpeg2_idct_add_mmx; mpeg2_idct_mmx_init (); } else #endif @@ -171,6 +192,22 @@ if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { mpeg2_idct_copy = mpeg2_idct_copy_altivec; mpeg2_idct_add = mpeg2_idct_add_altivec; + mpeg2_idct_altivec_init (); + } else + #endif +-#ifdef ARCH_ALPHA ++#ifdef HAVE_VIS + if (accel & MPEG2_ACCEL_ALPHA_MVI) { + mpeg2_idct_copy = mpeg2_idct_copy_mvi; + mpeg2_idct_add = mpeg2_idct_add_mvi; + mpeg2_idct_alpha_init (); +- } else if (accel & MPEG2_ACCEL_ALPHA) { ++ } else ++#elif ARCH_ALPHA ++ if (accel & MPEG2_ACCEL_ALPHA) { + int i; + + mpeg2_idct_copy = mpeg2_idct_copy_alpha; --- libmpeg2/idct_mmx.c 2006-06-16 20:12:26.000000000 +0200 +++ libmpeg2/idct_mmx.c 2006-06-16 20:12:50.000000000 +0200 @@ -23,7 +27,7 @@ @@ -184,7 +221,25 @@ --- libmpeg2/motion_comp.c 2006-06-16 20:12:26.000000000 +0200 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200 -@@ -46,7 +46,7 @@ +@@ -33,16 +37,22 @@ + + void mpeg2_mc_init (uint32_t accel) + { +-#ifdef ARCH_X86 ++#ifdef HAVE_MMX2 + if (accel & MPEG2_ACCEL_X86_MMXEXT) + mpeg2_mc = mpeg2_mc_mmxext; +- else if (accel & MPEG2_ACCEL_X86_3DNOW) ++ else ++#endif ++#ifdef HAVE_3DNOW ++ if (accel & MPEG2_ACCEL_X86_3DNOW) + mpeg2_mc = mpeg2_mc_3dnow; +- else if (accel & MPEG2_ACCEL_X86_MMX) ++ else ++#endif ++#ifdef HAVE_MMX ++ if (accel & MPEG2_ACCEL_X86_MMX) mpeg2_mc = mpeg2_mc_mmx; else #endif @@ -193,7 +248,13 @@ if (accel & MPEG2_ACCEL_PPC_ALTIVEC) mpeg2_mc = mpeg2_mc_altivec; else -@@ -61,6 +61,16 @@ +@@ -52,11 +62,21 @@ + mpeg2_mc = mpeg2_mc_alpha; + else + #endif +-#ifdef ARCH_SPARC ++#ifdef HAVE_VIS + if (accel & MPEG2_ACCEL_SPARC_VIS) mpeg2_mc = mpeg2_mc_vis; else #endif diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c index 37c9c3db0e..0d26ba321f 100644 --- a/libmpeg2/motion_comp.c +++ b/libmpeg2/motion_comp.c @@ -37,12 +37,18 @@ mpeg2_mc_t mpeg2_mc; void mpeg2_mc_init (uint32_t accel) { -#ifdef ARCH_X86 +#ifdef HAVE_MMX2 if (accel & MPEG2_ACCEL_X86_MMXEXT) mpeg2_mc = mpeg2_mc_mmxext; - else if (accel & MPEG2_ACCEL_X86_3DNOW) + else +#endif +#ifdef HAVE_3DNOW + if (accel & MPEG2_ACCEL_X86_3DNOW) mpeg2_mc = mpeg2_mc_3dnow; - else if (accel & MPEG2_ACCEL_X86_MMX) + else +#endif +#ifdef HAVE_MMX + if (accel & MPEG2_ACCEL_X86_MMX) mpeg2_mc = mpeg2_mc_mmx; else #endif @@ -56,7 +62,7 @@ void mpeg2_mc_init (uint32_t accel) mpeg2_mc = mpeg2_mc_alpha; else #endif -#ifdef ARCH_SPARC +#ifdef HAVE_VIS if (accel & MPEG2_ACCEL_SPARC_VIS) mpeg2_mc = mpeg2_mc_vis; else |