CCFLAGS = -g -Wall -W ;
# Globals defines
-DEFINES = DEBUG __X264__ ;
+DEFINES = DEBUG __X264__ ARCH_$(OSPLAT) SYS_$(OS) ;
# Optims
OPTIM = -O3 -funroll-loops ;
# Headers rep
-HDRS = . core core/i366 decoder encoder ;
+HDRS = . core core/i386 decoder encoder ;
SOURCES_C = core/mc.c core/predict.c core/pixel.c core/macroblock.c
core/frame.c core/dct.c core/cpu.c core/cabac.c
# libx264
SOURCES_X264 = $(SOURCES_C) ;
-if $(OS) = LINUX
+if $(OSPLAT) = X86
{
- DEFINES += ARCH_X86 HAVE_MMXEXT HAVE_SSE2 HAVE_MALLOC_H ;
+ DEFINES += HAVE_MALLOC_H HAVE_MMXEXT HAVE_SSE2 ;
SOURCES_X264 += $(SOURCES_MMX) ;
SOURCES_X264 += $(SOURCES_X86) ;
- ASFLAGS = -f elf ;
+ ASFLAGS = -f elf ;
- # Don't ask why
+ # Don't ask
NOARUPDATE = false ;
}
-if $(OS) = MACOSX
+if $(OSPLAT) = PPC
{
- DEFINES += HAVE_ALTIVEC ;
SOURCES_X264 += $(SOURCES_ALTIVEC) ;
- CCFLAGS += -faltivec ;
-# OPTIM += -falign-loops=16 ;
+ OPTIM += -falign-loops=16 ;
+
+ if $(OS) = MACOSX
+ {
+ CCFLAGS += -faltivec ;
+ }
+ if $(OS) = LINUX
+ {
+ CCFLAGS += -maltivec -mabi=altivec ;
+ }
}
Library libx264 : $(SOURCES_X264) ;
# Makefile: tuned for i386/MMX system only
# For ppc append
# SRCS: core/ppc/mc.c core/ppc/pixel.c
-# Defines: HAVE_ALTIVEC
+# Defines: HAVE_PPC
# CFLAGS: -faltivec
#
PFLAGS=-DARCH_X86 -DHAVE_MMXEXT -DHAVE_SSE2
}
#endif
-#elif defined( HAVE_ALTIVEC )
-#include <sys/sysctl.h>
+#elif defined( ARCH_PPC )
+#ifdef SYS_MACOSX
+#include <sys/sysctl.h>
uint32_t x264_cpu_detect( void )
{
- /* Thx VLC */
+ /* Thank you VLC */
uint32_t cpu = 0;
int selectors[2] = { CTL_HW, HW_VECTORUNIT };
int has_altivec = 0;
return cpu;
}
+#elif defined( SYS_LINUX )
+uint32_t x264_cpu_detect( void )
+{
+ /* FIXME (Linux PPC) */
+ return X264_CPU_ALTIVEC;
+}
+#endif
+
void x264_cpu_restore( uint32_t cpu )
{
}
#ifdef HAVE_MMXEXT
# include "i386/mc.h"
#endif
-#ifdef HAVE_ALTIVEC
+#ifdef ARCH_PPC
# include "ppc/mc.h"
#endif
x264_mc_sse2_init( pf );
#endif
-#ifdef HAVE_ALTIVEC
+#ifdef ARCH_PPC
if( cpu&X264_CPU_ALTIVEC )
x264_mc_altivec_init( pf );
#endif
#ifdef HAVE_MMXEXT
# include "i386/pixel.h"
#endif
-#ifdef HAVE_ALTIVEC
+#ifdef ARCH_PPC
# include "ppc/pixel.h"
#endif
pixf->satd[PIXEL_4x4] = x264_pixel_satd_4x4_mmxext;
}
#endif
-#ifdef HAVE_ALTIVEC
+#ifdef ARCH_PPC
if( cpu&X264_CPU_ALTIVEC )
{
x264_pixel_altivec_init( pixf );
#include <string.h>
#include <stdint.h>
+#ifdef SYS_LINUX
+#include <altivec.h>
+#endif
+
#include "x264.h"
#include "../mc.h"
#include "../clip1.h"
#include <string.h>
#include <stdint.h>
+#ifdef SYS_LINUX
+#include <altivec.h>
+#endif
+
#include "x264.h"
#include "../pixel.h"
#include "pixel.h"
#include "core/i386/dct.h"
#include "core/i386/mc.h"
#endif
-#ifdef HAVE_ALTIVEC
+#ifdef ARCH_PPC
#include "core/ppc/pixel.h"
#endif
#ifdef HAVE_MMXEXT
x264_pixel_init( X264_CPU_MMX|X264_CPU_MMXEXT, &pixel_asm );
#endif
-#ifdef HAVE_ALTIVEC
+#ifdef ARCH_PPC
x264_pixel_altivec_init( &pixel_asm );
#endif
#ifdef HAVE_MMXEXT
fprintf( stderr, "x264: MMXEXT against C\n" );
-#elif HAVE_ALTIVEC
+#elif ARCH_PPC
fprintf( stderr, "x264: ALTIVEC against C\n" );
#endif