Index: configure.in
===================================================================
--- configure.in	(revision 999)
+++ configure.in	(working copy)
@@ -270,10 +270,22 @@
 
 
 ############## libx264
-AC_CHECK_LIB(x264, x264_encoder_open,[libx264=yes],,-lpthread -lm)
+LIBX264_LIBS=""
+AC_CHECK_LIB(x264, x264_encoder_open,[
+  libx264=yes,
+  LIBX264_LIBS="-lx264"
+],,-lpthread -lm)
+if test "x$with_pic" = "xyes"; then
+  AC_CHECK_LIB(x264_pic, x264_encoder_open,[
+    libx264_pic=yes,
+    LIBX264_LIBS="-lx264_pic"
+  ],,-lpthread -lm)
+fi
 AC_CHECK_HEADER(x264.h, [libx264h=yes])
+AC_SUBST(LIBX264_LIBS)
 ##############
 
+
 ############## MMX / 3DNOW  POWERPC / ALTIVEC
 
 AC_ARG_ENABLE(mmx, 
@@ -300,6 +312,7 @@
 	if test "x$enable_3dnow" = "xyes"; then
 		CPU_CFLAGS="-DHAVE_3Dnow $CPU_CFLAGS" # -DUSE_3DNOW --> don't use, not compilin
 	fi
+        cpu_x86_32=yes 
 ;;
 powerpc)
 	CPU_CFLAGS="-mcpu=powerpc $CPU_CFLAGS"
@@ -307,6 +320,16 @@
 		CPU_CFLAGS="-maltivec -mabi=altivec $CPU_CFLAGS"
 	fi
 ;;
+x86_64)
+	test "x$enable_mmx" = "xauto" && enable_mmx=yes
+	CPU_CFLAGS="-DX86_CPU $CPU_CFLAGS"
+	if test "x$enable_mmx" = "xyes"; then
+		CPU_CFLAGS=" -march=athlon64 -funroll-loops -minline-all-stringops -ffast-math -mmmx -msse -msse2 -msse3 -m3dnow"
+		CPU_CFLAGS="-DHAVE_MMX -DUSE_MMX -DHAVE_3dnow $CPU_CFLAGS"
+
+        fi
+        cpu_x86_64=yes
+;;
 esac
 
 test "x$enable_mmx" = "xauto" && enable_mmx=no
@@ -319,6 +342,8 @@
 AC_SUBST(LIBDECORE_LIBADD)
 AC_SUBST(CPU_CFLAGS)
 
+AM_CONDITIONAL([CPU_x86_64], [test x$cpu_x86_64 = xyes])
+AM_CONDITIONAL([CPU_x86_32], [test x$cpu_x86_32 = xyes])
 ############## END OF MMX / 3DNOW
 
 ############ external ffmpeg
Index: quicktime/Makefile.am
===================================================================
--- quicktime/Makefile.am	(revision 999)
+++ quicktime/Makefile.am	(working copy)
@@ -22,7 +22,7 @@
 	-lfaac \
 	encore50/libencore.la \
 	$(top_builddir)/libmpeg3/libmpeg3hv.la \
-	-lx264 \
+	$(LIBX264_LIBS) \
 	$(LIBDV_LIBS) \
 	-ljpeg -lpng \
 	-lz -lpthread -lm
Index: libmpeg3/video/Makefile.am
===================================================================
--- libmpeg3/video/Makefile.am	(revision 999)
+++ libmpeg3/video/Makefile.am	(working copy)
@@ -9,11 +9,13 @@
 	subtitle.c \
 	vlc.c
 
+if CPU_x86_32
 if USEMMX
 libmpeg3_video_la_SOURCES += mmxidct.S reconmmx.s
 else
 libmpeg3_video_la_SOURCES +=
 endif
+endif
 
 noinst_HEADERS = idct.h \
 	layerdata.h \
