From f0c90c8e00f5452c7a27ed23522e7dc16e2db512 Mon Sep 17 00:00:00 2001 From: arpi Date: Sat, 18 Jan 2003 19:28:53 +0000 Subject: An altivec-optimized DCT64 for mp3lib (partially, it seems roughly three times as fast as the C code according to quick-n-dirty gprof tests) This one is bit-perfect. patch by Romain Dolbeau git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9003 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/decod386.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mp3lib/decod386.c') diff --git a/mp3lib/decod386.c b/mp3lib/decod386.c index c76d3bb843..7739cdb8d1 100644 --- a/mp3lib/decod386.c +++ b/mp3lib/decod386.c @@ -158,6 +158,13 @@ int synth_1to1_MMX( real *bandPtr,int channel,short * samples) return 0; } #endif + +#ifdef HAVE_ALTIVEC +#define dct64_base(a,b,c) if(gCpuCaps.hasAltiVec) dct64_altivec(a,b,c); else dct64(a,b,c) +#else /* HAVE_ALTIVEC */ +#define dct64_base(a,b,c) dct64(a,b,c) +#endif /* HAVE_ALTIVEC */ + static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) { static real buffs[2][2][0x110]; @@ -192,12 +199,12 @@ static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt) if(bo & 0x1) { b0 = buf[0]; bo1 = bo; - dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr); + dct64_base(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr); } else { b0 = buf[1]; bo1 = bo+1; - dct64(buf[0]+bo,buf[1]+bo+1,bandPtr); + dct64_base(buf[0]+bo,buf[1]+bo+1,bandPtr); } { -- cgit v1.2.3