[PATCH] correct mp3lib -v output on PPC
This simply makes mp3lib say that it's using Altivec to decode instead of generic C when it uses the optimized IMDCT. 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.
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
On Mar 26, 2006, at 5:31 AM, Diego Biurrun wrote:
--- 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?
Right now it's declared undefined. It seemed like it would be against the patching guidelines to have this change more code by making it set to NULL in the first place, but I can do that if you want.
On Sun, Mar 26, 2006 at 10:58:24AM -0500, Alexander Strange wrote:
On Mar 26, 2006, at 5:31 AM, Diego Biurrun wrote:
--- 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
Why is it necessary to set synth_func to NULL?
Right now it's declared undefined.
It works fine here and it worked before you added the message. Is there any problem you are trying to fix?
It seemed like it would be against the patching guidelines to have this change more code by making it set to NULL in the first place, but I can do that if you want.
I don't quite get what you're trying to say here... Diego
On Wed, Mar 29, 2006 at 02:28:42AM +0200, Diego Biurrun wrote:
On Sun, Mar 26, 2006 at 10:58:24AM -0500, Alexander Strange wrote:
On Mar 26, 2006, at 5:31 AM, Diego Biurrun wrote:
--- 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
Why is it necessary to set synth_func to NULL?
Right now it's declared undefined.
It works fine here and it worked before you added the message. Is there any problem you are trying to fix?
Applied without the synth_func change. Diego
participants (2)
-
Alexander Strange -
Diego Biurrun