[MPlayer-dev-eng] libmpeg2 #ifdeffery

Diego Biurrun diego at biurrun.de
Wed Mar 5 17:55:20 CET 2008


We currently ship libmpeg2 butchered up with a lot of #ifdefs around
processor-specific optimizations as in

--- libmpeg2/motion_comp.c	2006-06-16 20:12:26.000000000 +0200
+++ libmpeg2/motion_comp.c	2006-06-16 20:12:50.000000000 +0200
@@ -37,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
-#ifdef ARCH_PPC
+#if defined(ARCH_PPC) && defined(HAVE_ALTIVEC)
     if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
 	mpeg2_mc = mpeg2_mc_altivec;
     else

See libmpeg2/libmpeg-0.4.1.diff for the full monty.

Is this still desirable?  Is there any real speed gain?

Diego



More information about the MPlayer-dev-eng mailing list