[MPlayer-users] [PATCH - MacOS X] Anyone have success with x264?
Peter Spam
pspam at mac.com
Sat Oct 9 10:31:38 CEST 2004
I believe I've gotten mencoder to work fine (after some patching for
MacOS X - see below), but mplayer seems to have become a front-end to
the x264 app:
0 (64) G4 1:21am ~/Devel/mpl/main> ./mplayer
x264 build:0x000b
Syntax: x264 [options] [-o out.h26l] in.yuv widthxheigh
-h, --help Print this help
-I, --idrframe <integer> Each 'number' I frames are IDR frames
-i, --iframe <integer> Max interval between I frames
[snip]
Any ideas? This is with 10/9/04 CVS and x264 r50, with the
below-mentioned x264 patches.
Thanks,
Peter
diff -dburN x264/Makefile x264_pfh/Makefile
--- x264/Makefile Sat Sep 25 14:30:47 2004
+++ x264_pfh/Makefile Sat Sep 25 14:30:02 2004
@@ -1,13 +1,26 @@
# Makefile: tuned for i386/MMX system only
-# For ppc append
-# SRCS: core/ppc/mc.c core/ppc/pixel.c
-# Defines: HAVE_PPC
-# CFLAGS: -faltivec
-#
+# Uncomment this for Mac OS X
+#SYS_MACOSX=1
+
+ifdef SYS_MACOSX
+PFLAGS=-DSYS_MACOSX -DHAVE_PPC
+CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__
-DHAVE_MALLOC_H -faltivec $(PFLAGS)
+else
PFLAGS=-DARCH_X86 -DHAVE_MMXEXT -DHAVE_SSE2
-CC=gcc
CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__
-DHAVE_MALLOC_H $(PFLAGS)
+endif
+CC=gcc
+ifdef SYS_MACOSX
+SRCS= core/mc.c core/predict.c core/pixel.c core/macroblock.c \
+ core/frame.c core/dct.c core/cpu.c core/cabac.c \
+ core/common.c core/mdate.c core/csp.c \
+ encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
+ encoder/set.c encoder/macroblock.c encoder/cabac.c
encoder/cavlc.c \
+ encoder/encoder.c encoder/eval.c \
+ core/ppc/mc.c core/ppc/pixel.c \
+ x264.c
+else
SRCS= core/mc.c core/predict.c core/pixel.c core/macroblock.c \
core/frame.c core/dct.c core/cpu.c core/cabac.c \
core/common.c core/mdate.c core/csp.c \
@@ -16,6 +29,7 @@
encoder/encoder.c encoder/eval.c \
core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c \
x264.c
+endif
AS= nasm
# for linux
@@ -31,8 +45,14 @@
default: $(DEP) x264
+ifdef SYS_MACOSX
+libx264.a: $(OBJS)
+ ar rc libx264.a $(OBJS)
+ ranlib libx264.a
+else
libx264.a: $(OBJS) $(OBJASM)
ar rc libx264.a $(OBJS) $(OBJASM)
+endif
x264: libx264.a x264.o
$(CC) $(CFLAGS) -o x264 x264.o libx264.a -lm
diff -dburN x264/core/common.c x264_pfh/core/common.c
--- x264/core/common.c Sat Sep 25 14:30:46 2004
+++ x264_pfh/core/common.c Sat Sep 25 14:25:46 2004
@@ -27,8 +27,12 @@
#include <stdarg.h>
#ifdef HAVE_MALLOC_H
+#ifdef SYS_MACOSX
+#include <malloc/malloc.h>
+#else
#include <malloc.h>
-#endif
+#endif /* SYS_MACOSX */
+#endif /* HAVE_MALLOC_H */
#include "common.h"
#include "cpu.h"
@@ -303,8 +307,12 @@
void *x264_malloc( int i_size )
{
#ifdef HAVE_MALLOC_H
- return memalign( 16, i_size );
+#ifdef SYS_MACOSX
+ return malloc(i_size); /* ... since it's already aligned 16 on
MacOS X*/
#else
+ return memalign( 16, i_size );
+#endif /* SYS_MACOSX */
+#else /* we don't HAVE_MALLOC_H */
uint8_t * buf;
uint8_t * align_buf;
buf = (uint8_t *) malloc( i_size + 15 + sizeof( void ** ) +
diff -dburN x264_50_stock/x264.h x264_50_pfh/x264.h
--- x264_50_stock/x264.h Sat Oct 9 00:55:09 2004
+++ x264_50_pfh/x264.h Sat Oct 9 01:16:51 2004
@@ -115,7 +115,8 @@
/* Log */
- void (*pf_log)( void *, int i_level, const char *psz,
va_list );
+ /*void (*pf_log)( void *, int i_level, const char *psz,
va_list );*/
+ void (*pf_log)( void *, int i_level, const char *psz, ... );
void *p_log_private;
int i_log_level;
More information about the MPlayer-users
mailing list