[MPlayer-dev-eng] [PATCH] correct mp3lib -v output on PPC

Diego Biurrun diego at biurrun.de
Sun Mar 26 12:31:14 CEST 2006


On Thu, Mar 23, 2006 at 07:49:20PM -0500, Alexander Strange wrote:
> This simply makes mp3lib say that it's using Altivec to decode  
> instead of generic C when it uses the optimized IMDCT.

--- mp3lib/sr1.c	9 Feb 2006 14:08:00 -0000	1.36
+++ mp3lib/sr1.c	24 Mar 2006 00:30:43 -0000
@@ -447,6 +447,14 @@
     }
     else
 #endif
+#ifdef HAVE_ALTIVEC
+    if (gCpuCaps.hasAltiVec)
+    {
+	synth_func = NULL; /* only dct64 is altivec-optimized; it uses the C synth_func */
+	mp_msg(MSGT_DECAUDIO,MSGL_V,"mp3lib: using AltiVec optimized decore!\n");
+    }
+    else
+#endif
     {
 	synth_func = NULL; /* use default c version */
 	mp_msg(MSGT_DECAUDIO,MSGL_V,"mp3lib: using generic C decore!\n");

Why is it necessary to set synth_func to NULL?

> I notice the Altivec code in decod386.c checks gCpuCaps every time it  
> calls dct64; you could save a very small amount of time by using a  
> function pointer there like the rest of the SIMD code.

Patches welcome.

Diego




More information about the MPlayer-dev-eng mailing list