diff -Nur x264-snapshot-20051022-2245.orig/common/amd64/Makefile.am x264-snapshot-20051022-2245/common/amd64/Makefile.am --- x264-snapshot-20051022-2245.orig/common/amd64/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/common/amd64/Makefile.am 2005-10-24 01:18:29.134240048 +0200 @@ -0,0 +1,19 @@ +SUFFIXES = .c .o .lo .asm + +YASM=@YASM@ +YASMFLAGS=@YASMFLAGS@ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + +noinst_LTLIBRARIES = lib_x8664_yasm.la + +lib_x8664_yasm_la_SOURCES = dct-a.asm cpu-a.asm pixel-a.asm mc-a.asm \ + mc-a2.asm predict-a.asm pixel-sse2.asm quant-a.asm + +am_lib_x8664_yasm_la_OBJECTS = dct-a.lo cpu-a.lo pixel-a.lo mc-a.lo \ + mc-a2.lo predict-a.lo pixel-sse2.lo quant-a.lo + +.asm.o: $< + $(YASM) $(YASMFLAGS) $< -o $@ + +.asm.lo: $< + $(LIBTOOL) --mode=compile --tag=CC sh $(top_srcdir)/strip_fPIC.sh $(YASM) $(YASMFLAGS) $< -o $@ diff -Nur x264-snapshot-20051022-2245.orig/common/common.c x264-snapshot-20051022-2245/common/common.c --- x264-snapshot-20051022-2245.orig/common/common.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/common.c 2005-10-23 23:17:53.281256904 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff -Nur x264-snapshot-20051022-2245.orig/common/common.h x264-snapshot-20051022-2245/common/common.h --- x264-snapshot-20051022-2245.orig/common/common.h 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/common.h 2005-10-23 22:36:41.745987376 +0200 @@ -24,6 +24,10 @@ #ifndef _COMMON_H #define _COMMON_H 1 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/cpu.c x264-snapshot-20051022-2245/common/cpu.c --- x264-snapshot-20051022-2245.orig/common/cpu.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/cpu.c 2005-10-23 22:36:58.382458248 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/dct.c x264-snapshot-20051022-2245/common/dct.c --- x264-snapshot-20051022-2245.orig/common/dct.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/dct.c 2005-10-23 22:37:13.619141920 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/i386/dct-c.c x264-snapshot-20051022-2245/common/i386/dct-c.c --- x264-snapshot-20051022-2245.orig/common/i386/dct-c.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/i386/dct-c.c 2005-10-23 22:38:11.646320448 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/i386/Makefile.am x264-snapshot-20051022-2245/common/i386/Makefile.am --- x264-snapshot-20051022-2245.orig/common/i386/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/common/i386/Makefile.am 2005-10-24 00:44:08.981430880 +0200 @@ -0,0 +1,26 @@ +SUFFIXES = .c .o .lo .asm + +NASM=@NASM@ +NASMFLAGS=@NASMFLAGS@ + +if CPU_i386 +noinst_LTLIBRARIES = lib_x86.la lib_i386_nasm.la +else +noinst_LTLIBRARIES = lib_x86.la +endif + +noinst_HEADERS = dct.h mc.h pixel.h predict.h + +lib_x86_la_SOURCES = mc-c.c dct-c.c predict.c + +lib_i386_nasm_la_SOURCES = dct-a.asm cpu-a.asm pixel-a.asm mc-a.asm \ + mc-a2.asm predict-a.asm pixel-sse2.asm quant-a.asm + +am_lib_i386_nasm_la_OBJECTS = dct-a.lo cpu-a.lo pixel-a.lo mc-a.lo \ + mc-a2.lo predict-a.lo pixel-sse2.lo quant-a.lo + +.asm.o: $< + $(NASM) $(NASMFLAGS) $< -o $@ + +.asm.lo: $< + $(LIBTOOL) --mode=compile --tag=CC sh $(top_srcdir)/strip_fPIC.sh $(NASM) $(NASMFLAGS) $< -o $@ diff -Nur x264-snapshot-20051022-2245.orig/common/i386/mc-c.c x264-snapshot-20051022-2245/common/i386/mc-c.c --- x264-snapshot-20051022-2245.orig/common/i386/mc-c.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/i386/mc-c.c 2005-10-23 22:45:25.266400176 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/i386/predict.c x264-snapshot-20051022-2245/common/i386/predict.c --- x264-snapshot-20051022-2245.orig/common/i386/predict.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/i386/predict.c 2005-10-23 22:45:59.850142648 +0200 @@ -24,6 +24,10 @@ /* XXX predict4x4 are inspired from ffmpeg h264 decoder */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/Makefile.am x264-snapshot-20051022-2245/common/Makefile.am --- x264-snapshot-20051022-2245.orig/common/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/common/Makefile.am 2005-10-24 01:27:56.205032184 +0200 @@ -0,0 +1,53 @@ +if CPU_i386 +i386_subdir = i386 +i386_LIB = $(top_builddir)/common/i386/lib_x86.la $(top_builddir)/common/i386/lib_i386_nasm.la +else +i386_subdir = +i386_LIB = +endif + +if CPU_x8664 +x8664_subdir = i386 amd64 +x8664_LIB = $(top_builddir)/common/i386/lib_x86.la $(top_builddir)/common/amd64/lib_x8664_yasm.la +else +x8664_subdir = +x8664_LIB = +endif + +if CPU_ppc +ppc_subdir = ppc +ppc_LIB = $(top_srcdir)/common/ppc/lib_ppc.la +else +ppc_subdir = +ppc_LIB = +endif + +if CPU_sparc +sparc_subdir = sparc +sparc_LIB = $(top_srcdir)/common/sparc/lib_sparc.la +else +sparc_subdir = +sparc_LIB = +endif + +SUBDIRS = $(i386_subdir) $(x8664_subdir) $(ppc_subdir) $(sparc_subdir) + +common_SRCS = mc.c predict.c pixel.c macroblock.c \ + frame.c dct.c cpu.c cabac.c \ + common.c mdate.c csp.c set.c \ + quant.c + +if VIS +vis_SRCS = common/visualize.c common/display-x11.c +else +vis_SRCS = +endif + +noinst_HEADERS = bs.h cabac.h clip1.h common.h cpu.h csp.h dct.h display.h \ + frame.h macroblock.h mc.h pixel.h predict.h quant.h set.h visualize.h \ + vlc.h + +noinst_LTLIBRARIES = lib_common.la + +lib_common_la_SOURCES = $(common_SRCS) $(vis_SRCS) +lib_common_la_LIBADD = $(i386_LIB) $(x8664_LIB) $(ppc_LIB) $(sparc_LIB) diff -Nur x264-snapshot-20051022-2245.orig/common/mc.c x264-snapshot-20051022-2245/common/mc.c --- x264-snapshot-20051022-2245.orig/common/mc.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/mc.c 2005-10-23 23:15:59.521551008 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/mdate.c x264-snapshot-20051022-2245/common/mdate.c --- x264-snapshot-20051022-2245.orig/common/mdate.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/mdate.c 2005-10-23 23:16:44.309742168 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/pixel.c x264-snapshot-20051022-2245/common/pixel.c --- x264-snapshot-20051022-2245.orig/common/pixel.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/pixel.c 2005-10-23 23:16:49.766912552 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/ppc/Makefile.am x264-snapshot-20051022-2245/common/ppc/Makefile.am --- x264-snapshot-20051022-2245.orig/common/ppc/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/common/ppc/Makefile.am 2005-10-23 23:01:25.817374232 +0200 @@ -0,0 +1,5 @@ +noinst_LTLIBRARIES = lib_ppc.la + +noinst_HEADERS = mc.h pixel.h dct.h ppccommon.h + +lib_ppc_la_SOURCES = mc.c pixel.c dct.c diff -Nur x264-snapshot-20051022-2245.orig/common/predict.c x264-snapshot-20051022-2245/common/predict.c --- x264-snapshot-20051022-2245.orig/common/predict.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/predict.c 2005-10-23 23:16:54.594178696 +0200 @@ -24,6 +24,10 @@ /* XXX predict4x4 are inspired from ffmpeg h264 decoder */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/common/sparc/Makefile.am x264-snapshot-20051022-2245/common/sparc/Makefile.am --- x264-snapshot-20051022-2245.orig/common/sparc/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/common/sparc/Makefile.am 2005-10-23 23:03:09.936545712 +0200 @@ -0,0 +1,7 @@ +SUFFIXES = .lo .asm + +noinst_LTLIBRARIES = lib_sparc.la + +noinst_HEADERS = pixel.h + +lib_sparc_la_SOURCES = pixel.asm diff -Nur x264-snapshot-20051022-2245.orig/common/visualize.c x264-snapshot-20051022-2245/common/visualize.c --- x264-snapshot-20051022-2245.orig/common/visualize.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/common/visualize.c 2005-10-23 23:18:48.564852520 +0200 @@ -39,6 +39,10 @@ * pink blocks with a diagonal line are predicted using the planar function. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/configure.ac x264-snapshot-20051022-2245/configure.ac --- x264-snapshot-20051022-2245.orig/configure.ac 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/configure.ac 2005-10-24 01:03:37.053856880 +0200 @@ -0,0 +1,140 @@ +AC_INIT(libx264, 0.1.2) +AC_PREREQ(2.53) +AC_CONFIG_SRCDIR([x264.c]) +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +AM_INIT_AUTOMAKE + +AM_CONFIG_HEADER([config.h]) + +# Checks for programs. +AC_PROG_AWK +AC_PROG_CC +#AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_LIBTOOL_DLOPEN +AC_PROG_LIBTOOL +AC_PATH_PROG(NASM,nasm) +AC_PATH_PROG(YASM,yasm) + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h sys/time.h sys/timeb.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_HEADER_TIME + +AC_DEFINE_UNQUOTED(X264_VERSION,["333M"],[X264 version]) + +AH_TEMPLATE([CPU_i386], + [Define as 1 if host is an IA32]) + +AH_TEMPLATE([CPU_x8664], + [Define as 1 if host is an X86_64]) + +AH_TEMPLATE([ARCH_X86], + [Define as 1 if host is a x86]) + +AH_TEMPLATE([ARCH_X86_64], + [Define as 1 if host is a x86_64]) + +AH_TEMPLATE([ARCH_PPC], + [Define as 1 if host is a ppc]) + +AH_TEMPLATE([HAVE_MMXEXT], + [Define as 1 if host supports MMX extensions]) + +AH_TEMPLATE([HAVE_SSE2], + [Define as 1 if host supports SSE2 extensions]) + +AH_TEMPLATE([CPU_ppc], + [Define as 1 if host is a ppc]) + +AH_TEMPLATE([CPU_sparc], + [Define as 1 if host is a sparc]) + +AC_DEFINE(SYS_LINUX,1,[Define as 1 if os is Linux]) + +cputype="" +case "$target_cpu" in + i?86) + AC_DEFINE(CPU_i386,1) + AC_SUBST(CPU_i386) + AC_DEFINE(ARCH_X86,1) + AC_SUBST(ARCH_X86) + AC_DEFINE(HAVE_MMXEXT,1) + AC_SUBST(HAVE_MMXEXT) + AC_DEFINE(HAVE_SSE2,1) + AC_SUBST(HAVE_SSE2) + NASMFLAGS="-f elf" + cputype="x86" + if test x"$NASM" = "x"; then + AC_MSG_ERROR(nasm required for x86 build. Please Install it.) + fi + ;; + x86_64-NOTREADY) + AC_DEFINE(CPU_x8664,1) + AC_SUBST(CPU_x8664) + AC_DEFINE(ARCH_X86_64,1) + AC_SUBST(ARCH_X86_64) + AC_DEFINE(HAVE_MMXEXT,1) + AC_SUBST(HAVE_MMXEXT) + AC_DEFINE(HAVE_SSE2,1) + AC_SUBST(HAVE_SSE2) + YASMFLAGS="-f elf -m amd64" + cputype="x8664" + if test x"$YASM" = "x"; then + AC_MSG_ERROR(yasm required for x86_64 build. Please Install it.) + fi + ;; + powerpc) + AC_DEFINE(CPU_ppc,1) + AC_SUBST(CPU_ppc) + AC_DEFINE(ARCH_PPC,1) + AC_SUBST(ARCH_PPC) + cputype="ppc" + CFLAGS="$CFLAGS -maltivec -mabi=altivec" + ;; +esac + +AC_SUBST(NASMFLAGS) +AC_SUBST(YASMFLAGS) + +AM_CONDITIONAL(CPU_i386,[ test "$cputype" = "x86" ]) +AM_CONDITIONAL(CPU_x8664,[ test "$cputype" = "x8664" ]) +AM_CONDITIONAL(CPU_ppc,[ test "$cputype" = "ppc" ]) +dnl Solaris only? +AM_CONDITIONAL(CPU_sparc,[ false ]) + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_TYPE_SIGNAL +AC_FUNC_STRTOD +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([gettimeofday memmove memset pow sqrt strcasecmp strchr strdup strstr strtol]) + +AC_ARG_ENABLE(visualize, [--enable-visualize enable visualization],[vis="$enableval"],[vis=no]) +if test "$vis" = "yes" ; then + AC_PATH_XTRA + LDFLAGS="$LDFLAGS $X_LIBS -lX11" + AC_DEFINE(VISUALIZE,1,[Define as 1 to get visualization]) + CFLAGS="$CFLAGS $X_CFLAGS" +fi +AM_CONDITIONAL(VIS, [test "$vis" = "yes"]) + +AC_CONFIG_FILES([Makefile + common/Makefile + common/amd64/Makefile + common/i386/Makefile + common/ppc/Makefile + common/sparc/Makefile + encoder/Makefile]) +CFLAGS="$CFLAGS -D__X264__" +AC_OUTPUT diff -Nur x264-snapshot-20051022-2245.orig/encoder/Makefile.am x264-snapshot-20051022-2245/encoder/Makefile.am --- x264-snapshot-20051022-2245.orig/encoder/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/encoder/Makefile.am 2005-10-24 00:30:20.749341296 +0200 @@ -0,0 +1,8 @@ +noinst_LTLIBRARIES = lib_encoder.la + +lib_encoder_la_SOURCES = \ + analyse.c me.c ratecontrol.c set.c macroblock.c cabac.c \ + cavlc.c encoder.c eval.c + +noinst_HEADERS = \ + analyse.h macroblock.h me.h ratecontrol.h set.h diff -Nur x264-snapshot-20051022-2245.orig/encoder/set.c x264-snapshot-20051022-2245/encoder/set.c --- x264-snapshot-20051022-2245.orig/encoder/set.c 2005-10-22 22:45:02.000000000 +0200 +++ x264-snapshot-20051022-2245/encoder/set.c 2005-10-24 00:31:10.081841616 +0200 @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_STDINT_H #include #else diff -Nur x264-snapshot-20051022-2245.orig/Makefile.am x264-snapshot-20051022-2245/Makefile.am --- x264-snapshot-20051022-2245.orig/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/Makefile.am 2005-10-24 01:33:43.529230880 +0200 @@ -0,0 +1,14 @@ +SUBDIRS = common encoder + +lib_LTLIBRARIES = libx264.la +bin_PROGRAMS = x264 + +libx264_la_SOURCES = + +include_HEADERS = x264.h +noinst_HEADERS = matroska.h + +libx264_la_LIBADD = common/lib_common.la encoder/lib_encoder.la -lm + +x264_SOURCES = x264.c matroska.c +x264_LDADD = libx264.la diff -Nur x264-snapshot-20051022-2245.orig/strip_fPIC.sh x264-snapshot-20051022-2245/strip_fPIC.sh --- x264-snapshot-20051022-2245.orig/strip_fPIC.sh 1970-01-01 01:00:00.000000000 +0100 +++ x264-snapshot-20051022-2245/strip_fPIC.sh 2005-10-23 22:43:57.648720088 +0200 @@ -0,0 +1,17 @@ +#!/bin/sh +# +# taken from flac sources --qboosh +# +# libtool assumes that the compiler can handle the -fPIC flag +# This isn't always true (for example, nasm can't handle it) +command="" +while [ $1 ]; do + if [ "$1" != "-fPIC" ]; then + if [ "$1" != "-DPIC" ]; then + command="$command $1" + fi + fi + shift +done +echo $command +exec $command diff -Nur x264-snapshot-20051022-2245.orig/x264.h x264-snapshot-20051022-2245/x264.h --- x264-snapshot-20051022-2245.orig/x264.h 2005-10-22 22:45:03.000000000 +0200 +++ x264-snapshot-20051022-2245/x264.h 2005-10-24 00:34:12.415122744 +0200 @@ -24,15 +24,7 @@ #ifndef _X264_H #define _X264_H 1 -#if !defined(_STDINT_H) && !defined(_STDINT_H_) && \ - !defined(_INTTYPES_H) && !defined(_INTTYPES_H_) -# ifdef _MSC_VER -# pragma message("You must include stdint.h or inttypes.h before x264.h") -# else -# warning You must include stdint.h or inttypes.h before x264.h -# endif -#endif - +#include #include #define X264_BUILD 36