Index: configure =================================================================== RCS file: /cvsroot/mplayer/main/configure,v retrieving revision 1.830 diff -u -r1.830 configure --- configure 12 Jan 2004 22:48:02 -0000 1.830 +++ configure 19 Jan 2004 09:31:13 -0000 @@ -603,6 +603,9 @@ _cpuinfo="TOOLS/cpuinfo" fi +# Additional optimizations flags. Putting them in _march or _mpcpu pollute configure output. +_optflags="" + case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) _def_arch="#define ARCH_X86 1" @@ -896,11 +899,18 @@ # gcc 3.1(.1) and up supports 7400 and 7450 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1"; then case "$proc" in - 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;; - 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;; + 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' _optflags='-fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -ffast-math ' ;; + 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' _optflags='-fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -ffast-math ' ;; *) ;; esac fi + # gcc 3.3 and up supports 970 + if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3"; then + case "$proc" in + 970*) _march='-mcpu=970' _mcpu='-mtune=970' _optflags='-fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -ffast-math -mpowerpc64' ;; + *) ;; + esac + fi fi if test -n "$_mcpu"; then @@ -5625,9 +5635,9 @@ _stripbinaries=no elif test -z "$CFLAGS" ; then if test "$host_arch" != "mips" ; then - CFLAGS="-O4 $_march $_mcpu -pipe -ffast-math -fomit-frame-pointer" + CFLAGS="-O4 $_march $_mcpu $_optflags -pipe -ffast-math -fomit-frame-pointer" else - CFLAGS="-O4 $_march $_mcpu -ffast-math -fomit-frame-pointer" + CFLAGS="-O4 $_march $_mcpu $_optflags -ffast-math -fomit-frame-pointer" fi # always compile with '-g' if .developer: if test -f ".developer" ; then Index: liba52/Makefile =================================================================== RCS file: /cvsroot/mplayer/main/liba52/Makefile,v retrieving revision 1.9 diff -u -r1.9 Makefile --- liba52/Makefile 11 Aug 2003 20:52:50 -0000 1.9 +++ liba52/Makefile 19 Jan 2004 09:31:13 -0000 @@ -19,7 +19,7 @@ $(AR) r $(LIBNAME) $(OBJS) test: $(LIBNAME) test.c - $(CC) $(CFLAGS) test.c ../cpudetect.c -o test ./liba52.a -lm + $(CC) $(CFLAGS) test.c ../cpudetect.c ../mp_msg.c -o test ./liba52.a -lm test2: $(LIBNAME) test.c $(CC) $(CFLAGS) test.c -o test2 ../libac3/libac3.a ./liba52.a -lm Index: liba52/resample.c =================================================================== RCS file: /cvsroot/mplayer/main/liba52/resample.c,v retrieving revision 1.15 diff -u -r1.15 resample.c --- liba52/resample.c 19 Jan 2002 05:12:34 -0000 1.15 +++ liba52/resample.c 19 Jan 2004 09:31:13 -0000 @@ -19,6 +19,10 @@ #include "resample_mmx.c" #endif +#ifdef HAVE_ALTIVEC +#include "resample_altivec.c" +#endif + void* a52_resample_init(uint32_t mm_accel,int flags,int chans){ void* tmp; @@ -32,7 +36,17 @@ } } #endif - +#ifdef HAVE_ALTIVEC + if(mm_accel&MM_ACCEL_PPC_ALTIVEC){ + tmp=a52_resample_altivec(flags,chans); + if(tmp){ + if(a52_resample==NULL) fprintf(stderr, "Using AltiVec optimized resampler\n"); + a52_resample=tmp; + return tmp; + } + } +#endif + tmp=a52_resample_C(flags,chans); if(tmp){ if(a52_resample==NULL) fprintf(stderr, "No accelerated resampler found\n"); Index: liba52/test.c =================================================================== RCS file: /cvsroot/mplayer/main/liba52/test.c,v retrieving revision 1.6 diff -u -r1.6 test.c --- liba52/test.c 30 Dec 2001 21:38:53 -0000 1.6 +++ liba52/test.c 19 Jan 2004 09:31:13 -0000 @@ -49,9 +49,9 @@ #endif FILE *temp= stdout; - stdout= stderr; //EVIL HACK FIXME +// stdout= stderr; //EVIL HACK FIXME GetCpuCaps(&gCpuCaps); - stdout= temp; +// stdout= temp; // gCpuCaps.hasMMX=0; // gCpuCaps.hasSSE=0; if(gCpuCaps.hasMMX) accel |= MM_ACCEL_X86_MMX; @@ -59,6 +59,7 @@ if(gCpuCaps.hasSSE) accel |= MM_ACCEL_X86_SSE; if(gCpuCaps.has3DNow) accel |= MM_ACCEL_X86_3DNOW; // if(gCpuCaps.has3DNowExt) accel |= MM_ACCEL_X86_3DNOWEXT; + if(gCpuCaps.hasAltiVec) accel |= MM_ACCEL_PPC_ALTIVEC; samples = a52_init (accel); if (samples == NULL) { Index: osdep/timer-darwin.c =================================================================== RCS file: /cvsroot/mplayer/main/osdep/timer-darwin.c,v retrieving revision 1.2 diff -u -r1.2 timer-darwin.c --- osdep/timer-darwin.c 3 Aug 2003 18:28:28 -0000 1.2 +++ osdep/timer-darwin.c 19 Jan 2004 09:31:13 -0000 @@ -74,6 +74,7 @@ /* sleep usec_delay microseconds */ int usec_sleep(int usec_delay) { +/* mach_timespec_t start_time, end_time; clock_get_time(clock_port, &start_time); @@ -86,6 +87,8 @@ clock_get_time(clock_port, &end_time); return usec_delay - udiff_time(start_time, end_time); +*/ + usleep(usec_delay); }