[MPlayer-cvslog] r26657 - in trunk: Makefile libmpeg2/idct.c libmpeg2/libmpeg-0.4.1.diff libmpeg2/motion_comp.c

diego subversion at mplayerhq.hu
Sat May 3 17:23:23 CEST 2008


Author: diego
Date: Sat May  3 17:23:22 2008
New Revision: 26657

Log:
Only compile and use libmpeg2 AltiVec code when AltiVec is available. The
AltiVec code needs -maltivec to compile, but then AltiVec instructions
appear in other places of the code causing MPlayer to sigill.
Somehow upstream libmpeg2 manages not to sigill under what appear to be
the same circumstances. Enlightenment welcome.


Modified:
   trunk/Makefile
   trunk/libmpeg2/idct.c
   trunk/libmpeg2/libmpeg-0.4.1.diff
   trunk/libmpeg2/motion_comp.c

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Sat May  3 17:23:22 2008
@@ -340,7 +340,7 @@ SRCS_COMMON-$(LIBMPEG2)-$(ARCH_ALPHA)   
 SRCS_COMMON-$(LIBMPEG2)-$(ARCH_ARMV4L)  += libmpeg2/motion_comp_arm.c \
                                            libmpeg2/motion_comp_arm_s.S \
                                            libmpeg2/motion_comp_iwmmxt.c
-SRCS_COMMON-$(LIBMPEG2)-$(ARCH_POWERPC) += libmpeg2/idct_altivec.c \
+SRCS_COMMON-$(LIBMPEG2)-$(HAVE_ALTIVEC) += libmpeg2/idct_altivec.c \
                                            libmpeg2/motion_comp_altivec.c
 SRCS_COMMON-$(LIBMPEG2)-$(HAVE_MMX)     += libmpeg2/idct_mmx.c \
                                            libmpeg2/motion_comp_mmx.c

Modified: trunk/libmpeg2/idct.c
==============================================================================
--- trunk/libmpeg2/idct.c	(original)
+++ trunk/libmpeg2/idct.c	Sat May  3 17:23:22 2008
@@ -19,6 +19,10 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Modified for use with MPlayer, see libmpeg-0.4.1.diff for the exact changes.
+ * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/
+ * $Id$
  */
 
 #include "config.h"
@@ -250,7 +254,7 @@ void mpeg2_idct_init (uint32_t accel)
 	mpeg2_idct_mmx_init ();
     } else
 #endif
-#ifdef ARCH_PPC
+#ifdef HAVE_ALTIVEC
     if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
 	mpeg2_idct_copy = mpeg2_idct_copy_altivec;
 	mpeg2_idct_add = mpeg2_idct_add_altivec;

Modified: trunk/libmpeg2/libmpeg-0.4.1.diff
==============================================================================
--- trunk/libmpeg2/libmpeg-0.4.1.diff	(original)
+++ trunk/libmpeg2/libmpeg-0.4.1.diff	Sat May  3 17:23:22 2008
@@ -175,6 +175,17 @@
  	    for (j = 0; j < 64; j++)
  		decoder->quantizer_prescale[index][i][j] =
  		    k * mpeg2dec->quantizer_matrix[index][j];
+--- libmpeg2/idct.c	(revision 26652)
++++ libmpeg2/idct.c	(working copy)
+@@ -250,7 +254,7 @@
+ 	mpeg2_idct_mmx_init ();
+     } else
+ #endif
+-#ifdef ARCH_PPC
++#ifdef HAVE_ALTIVEC
+     if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
+ 	mpeg2_idct_copy = mpeg2_idct_copy_altivec;
+ 	mpeg2_idct_add = mpeg2_idct_add_altivec;
 --- 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 @@
@@ -188,6 +199,15 @@
  
 --- 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 @@
+ 	mpeg2_mc = mpeg2_mc_mmx;
+     else
+ #endif
+-#ifdef ARCH_PPC
++#ifdef HAVE_ALTIVEC
+     if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
+ 	mpeg2_mc = mpeg2_mc_altivec;
+     else
 @@ -67,6 +61,13 @@
  	mpeg2_mc = mpeg2_mc_vis;
      else

Modified: trunk/libmpeg2/motion_comp.c
==============================================================================
--- trunk/libmpeg2/motion_comp.c	(original)
+++ trunk/libmpeg2/motion_comp.c	Sat May  3 17:23:22 2008
@@ -46,7 +46,7 @@ void mpeg2_mc_init (uint32_t accel)
 	mpeg2_mc = mpeg2_mc_mmx;
     else
 #endif
-#ifdef ARCH_PPC
+#ifdef HAVE_ALTIVEC
     if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
 	mpeg2_mc = mpeg2_mc_altivec;
     else



More information about the MPlayer-cvslog mailing list