[MPlayer-cvslog] r23515 - in trunk: Changelog mp3lib/Makefile mp3lib/decod386.c mp3lib/sr1.c
zuxy
subversion at mplayerhq.hu
Fri Jun 8 16:38:25 CEST 2007
Author: zuxy
Date: Fri Jun 8 16:38:25 2007
New Revision: 23515
Log:
Enable SIMD optmizations for mp3lib on AMD64
Modified:
trunk/Changelog
trunk/mp3lib/Makefile
trunk/mp3lib/decod386.c
trunk/mp3lib/sr1.c
Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog (original)
+++ trunk/Changelog Fri Jun 8 16:38:25 2007
@@ -23,6 +23,7 @@ MPlayer (1.0)
* handle resolution switching for Real codecs
* ffmpeg video decoder handles aspect ratio changes
* amr now handled via libamr wrapper (http://www.penguin.cz/~utx/amr)
+ * SIMD optimizations for mp3lib under AMD64
Demuxers:
* implemented switch_video and switch_program consistently with switch_audio
Modified: trunk/mp3lib/Makefile
==============================================================================
--- trunk/mp3lib/Makefile (original)
+++ trunk/mp3lib/Makefile Fri Jun 8 16:38:25 2007
@@ -3,12 +3,13 @@ include ../config.mak
LIBNAME_COMMON = libmp3.a
SRCS_COMMON = sr1.c
+SRCS_COMMON-$(TARGET_MMX) += decode_MMX.c
+SRCS_COMMON-$(TARGET_SSE) += dct64_sse.c
ifeq ($(TARGET_ARCH_X86_32),yes)
SRCS_COMMON += decode_i586.c
-SRCS_COMMON-$(TARGET_MMX) += decode_MMX.c dct64_MMX.c
+SRCS_COMMON-$(TARGET_MMX) += dct64_MMX.c
SRCS_COMMON-$(TARGET_3DNOW) += dct36_3dnow.c dct64_3dnow.c
SRCS_COMMON-$(TARGET_3DNOWEX) += dct36_k7.c dct64_k7.c
-SRCS_COMMON-$(TARGET_SSE) += dct64_sse.c
endif
SRCS_COMMON-$(TARGET_ALTIVEC) += dct64_altivec.c
Modified: trunk/mp3lib/decod386.c
==============================================================================
--- trunk/mp3lib/decod386.c (original)
+++ trunk/mp3lib/decod386.c Fri Jun 8 16:38:25 2007
@@ -102,7 +102,7 @@ static int synth_1to1_mono2stereo(real *
static synth_func_t synth_func;
-#if defined(CAN_COMPILE_X86_ASM) && defined(HAVE_MMX)
+#ifdef HAVE_MMX
extern int synth_1to1_MMX( real *bandPtr,int channel,short * samples);
#endif
@@ -125,7 +125,7 @@ static int synth_1to1(real *bandPtr,int
*pnt += 128;
/* optimized for x86 */
-#if defined(CAN_COMPILE_X86_ASM)
+#ifdef ARCH_X86
if ( synth_func )
{
// printf("Calling %p, bandPtr=%p channel=%d samples=%p\n",synth_func,bandPtr,channel,samples);
Modified: trunk/mp3lib/sr1.c
==============================================================================
--- trunk/mp3lib/sr1.c (original)
+++ trunk/mp3lib/sr1.c Fri Jun 8 16:38:25 2007
@@ -32,8 +32,10 @@
#include "libvo/fastmemcpy.h"
-#ifdef ARCH_X86_32
-#define CAN_COMPILE_X86_ASM
+#ifdef ARCH_X86_64
+// 3DNow! and 3DNow!Ext routines don't compile under AMD64
+#undef HAVE_3DNOW
+#undef HAVE_3DNOWEX
#endif
//static FILE* mp3_file=NULL;
@@ -137,7 +139,7 @@ LOCAL unsigned int getbits_fast(short nu
// if(MP3_frames>=7741) printf("getbits_fast: bits=%d bitsleft=%d wordptr=%x\n",number_of_bits,bitsleft,wordpointer);
if((bitsleft-=number_of_bits)<0) return 0;
if(!number_of_bits) return 0;
-#if defined(CAN_COMPILE_X86_ASM)
+#ifdef ARCH_X86
rval = bswap_16(*((uint16_t *)wordpointer));
#else
/*
@@ -180,7 +182,7 @@ LOCAL void set_pointer(int backstep)
LOCAL int stream_head_read(unsigned char *hbuf,uint32_t *newhead){
if(mp3_read(hbuf,4) != 4) return FALSE;
-#if defined(CAN_COMPILE_X86_ASM)
+#ifdef ARCH_X86
*newhead = bswap_32(*((uint32_t*)hbuf));
#else
/*
@@ -415,8 +417,6 @@ void MP3_Init(){
make_decode_tables(outscale);
-#ifdef CAN_COMPILE_X86_ASM
-
#ifdef HAVE_MMX
if (gCpuCaps.hasMMX)
{
@@ -451,6 +451,7 @@ void MP3_Init(){
}
else
#endif
+#ifdef ARCH_X86_32
#ifdef HAVE_MMX
if (gCpuCaps.hasMMX)
{
@@ -465,7 +466,7 @@ void MP3_Init(){
mp_msg(MSGT_DECAUDIO,MSGL_V,"mp3lib: using Pentium optimized decore!\n");
}
else
-#endif
+#endif /* ARCH_X86_32 */
#ifdef HAVE_ALTIVEC
if (gCpuCaps.hasAltiVec)
{
More information about the MPlayer-cvslog
mailing list