]> git.sesse.net Git - vlc/blobdiff - extras/contrib/src/Patches/x264-svn-win32.patch
x264.patch: Sync with upstream
[vlc] / extras / contrib / src / Patches / x264-svn-win32.patch
index 631f1861386fd90dca19868b4ceaea0b0407fee6..3acd45e470c03da2111cd91dcc1b72da0132214f 100644 (file)
@@ -1,230 +1,7 @@
-Index: common/i386/mc-a.asm
+Index: configure
 ===================================================================
---- common/i386/mc-a.asm       (revision 346)
-+++ common/i386/mc-a.asm       (working copy)
-@@ -46,22 +46,6 @@
- %endmacro
- ;=============================================================================
--; Constants
--;=============================================================================
--
--%ifdef FORMAT_COFF
--SECTION .rodata data
--%else
--SECTION .rodata data align=16
--%endif
--
--ALIGN 16
--pw_4:  times 4 dw  4
--pw_8:  times 4 dw  8
--pw_32: times 4 dw 32
--pw_64: times 4 dw 64
--
--;=============================================================================
- ; Code
- ;=============================================================================
-@@ -589,3 +573,20 @@
- .finish
-     pop     edi
-     ret
-+
-+;=============================================================================
-+; Constants
-+;=============================================================================
-+
-+%ifdef FORMAT_COFF
-+SECTION .rodata data
-+%else
-+SECTION .rodata data align=16
-+%endif
-+
-+ALIGN 16
-+pw_4:  times 4 dw  4
-+pw_8:  times 4 dw  8
-+pw_32: times 4 dw 32
-+pw_64: times 4 dw 64
-+
-Index: common/i386/deblock-a.asm
-===================================================================
---- common/i386/deblock-a.asm  (revision 346)
-+++ common/i386/deblock-a.asm  (working copy)
-@@ -31,11 +31,6 @@
-     %endif
- %endmacro
--SECTION .rodata align=16
--pb_01: times 16 db 0x01
--pb_3f: times 16 db 0x3f
--pb_ff: times 16 db 0xff
--
- SECTION .text
- cglobal x264_deblock_v8_luma_mmxext
- cglobal x264_deblock_h_luma_mmxext
-@@ -525,3 +520,11 @@
-     pop  ebp
-     CHROMA_END
-+;=============================================================================
-+; Local Data (Read Only)
-+;=============================================================================
-+SECTION .rodata align=16
-+pb_01: times 16 db 0x01
-+pb_3f: times 16 db 0x3f
-+pb_ff: times 16 db 0xff
-+
-Index: common/i386/dct-a.asm
-===================================================================
---- common/i386/dct-a.asm      (revision 346)
-+++ common/i386/dct-a.asm      (working copy)
-@@ -124,31 +124,6 @@
- %endmacro
- ;=============================================================================
--; Local Data (Read Only)
--;=============================================================================
--
--%ifdef FORMAT_COFF
--SECTION .rodata data
--%else
--SECTION .rodata data align=16
--%endif
--
--;-----------------------------------------------------------------------------
--; Various memory constants (trigonometric values or rounding values)
--;-----------------------------------------------------------------------------
--
--ALIGN 16
--x264_mmx_1:        dw  1,  1,  1,  1
--x264_mmx_32:       dw 32, 32, 32, 32
--x264_mmx_PPNN:     dw  1,  1, -1, -1
--x264_mmx_PNPN:     dw  1, -1,  1, -1 
--x264_mmx_PNNP:     dw  1, -1, -1,  1 
--x264_mmx_PPPN:     dw  1,  1,  1, -1 
--x264_mmx_PPNP:     dw  1,  1, -1,  1 
--x264_mmx_2121:     dw  2,  1,  2,  1 
--x264_mmx_p2n2p1p1: dw  2, -2,  1,  1
--
--;=============================================================================
- ; Code
- ;=============================================================================
-@@ -729,3 +704,28 @@
-     %endrep
-     ret
-+;=============================================================================
-+; Local Data (Read Only)
-+;=============================================================================
-+
-+%ifdef FORMAT_COFF
-+SECTION .rodata data
-+%else
-+SECTION .rodata data align=16
-+%endif
-+
-+;-----------------------------------------------------------------------------
-+; Various memory constants (trigonometric values or rounding values)
-+;-----------------------------------------------------------------------------
-+
-+ALIGN 16
-+x264_mmx_1:        dw  1,  1,  1,  1
-+x264_mmx_32:       dw 32, 32, 32, 32
-+x264_mmx_PPNN:     dw  1,  1, -1, -1
-+x264_mmx_PNPN:     dw  1, -1,  1, -1 
-+x264_mmx_PNNP:     dw  1, -1, -1,  1 
-+x264_mmx_PPPN:     dw  1,  1,  1, -1 
-+x264_mmx_PPNP:     dw  1,  1, -1,  1 
-+x264_mmx_2121:     dw  2,  1,  2,  1 
-+x264_mmx_p2n2p1p1: dw  2, -2,  1,  1
-+
-Index: common/i386/pixel-sse2.asm
-===================================================================
---- common/i386/pixel-sse2.asm (revision 346)
-+++ common/i386/pixel-sse2.asm (working copy)
-@@ -36,15 +36,6 @@
- %endmacro
--%ifdef FORMAT_COFF
--SECTION .rodata data
--%else
--SECTION .rodata data align=16
--%endif
--
--pd_0000ffff: times 4 dd 0x0000ffff
--
--
- SECTION .text
-@@ -531,3 +522,15 @@
-     SATD_END
-+;=============================================================================
-+; Local Data (Read Only)
-+;=============================================================================
-+%ifdef FORMAT_COFF
-+SECTION .rodata data
-+%else
-+SECTION .rodata data align=16
-+%endif
-+
-+pd_0000ffff: times 4 dd 0x0000ffff
-+
-+
-Index: common/i386/mc-a2.asm
-===================================================================
---- common/i386/mc-a2.asm      (revision 346)
-+++ common/i386/mc-a2.asm      (working copy)
-@@ -33,22 +33,6 @@
-     %endif
- %endmacro
--;=============================================================================
--; Read only data
--;=============================================================================
--
--SECTION .rodata data align=16
--
--ALIGN 16
--mmx_dw_one:
--    times 4 dw 16
--mmx_dd_one:
--    times 2 dd 512
--mmx_dw_20:
--    times 4 dw 20
--mmx_dw_5:
--    times 4 dw -5
--
- %assign twidth  0
- %assign theight 4
- %assign tdstp1  8
-@@ -374,3 +358,20 @@
-     pop         edi
-     ret
-+
-+;=============================================================================
-+; Read only data
-+;=============================================================================
-+
-+SECTION .rodata data align=16
-+
-+ALIGN 16
-+mmx_dw_one:
-+    times 4 dw 16
-+mmx_dd_one:
-+    times 2 dd 512
-+mmx_dw_20:
-+    times 4 dw 20
-+mmx_dw_5:
-+    times 4 dw -5
-+
---- configure.crosscompile~    2005-10-23 14:48:21.000000000 +0200
-+++ configure  2005-10-27 17:04:09.000000000 +0200
+--- configure  (revision 473)
++++ configure  (working copy)
 @@ -7,6 +7,7 @@
  echo "available options:"
  echo ""
@@ -233,7 +10,7 @@ Index: common/i386/mc-a2.asm
  echo "  --enable-avis-input      enables avisynth input (win32 only)"
  echo "  --enable-mp4-output      enables mp4 output (using gpac)"
  echo "  --enable-vfw             compiles the VfW frontend"
-@@ -45,43 +46,138 @@
+@@ -64,43 +65,143 @@
  
  EXE=""
  
@@ -250,29 +27,29 @@ Index: common/i386/mc-a2.asm
 +for opt do
 +    optarg="${opt#*=}"
 +    case "$opt" in
-+      --crosscompile=*)
-+          CROSS="$optarg"
-+          CC="$CROSS-gcc"
-+          AR="$CROSS-ar"
-+          RANLIB="$CROSS-ranlib"
-+          UNAMES="`echo $CROSS | cut -d- -f2`"
-+          UNAMEM="`echo $CROSS | cut -d- -f1`"
-+          ;;
-+      --prefix=*)
-+          prefix="$optarg"
-+          ;;
-+      --exec-prefix=*)
-+          eprefix="$optarg"
-+          ;;
-+      --bindir=*)
-+          bindir="$optarg"
-+          ;;
-+      --libdir=*)
-+          libdir="$optarg"
-+          ;;
-+      --includedir=*)
-+          includedir="$optarg"
-+          ;;
++       --crosscompile=*)
++           CROSS="$optarg"
++           CC="$CROSS-gcc"
++           AR="$CROSS-ar"
++           RANLIB="$CROSS-ranlib"
++           UNAMES="`echo $CROSS | cut -d- -f2`"
++           UNAMEM="`echo $CROSS | cut -d- -f1`"
++           ;;
++       --prefix=*)
++           prefix="$optarg"
++           ;;
++       --exec-prefix=*)
++           eprefix="$optarg"
++           ;;
++       --bindir=*)
++           bindir="$optarg"
++           ;;
++       --libdir=*)
++           libdir="$optarg"
++           ;;
++       --includedir=*)
++           includedir="$optarg"
++           ;;
 +        --enable-avis-input)
 +            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
 +                CFLAGS="$CFLAGS -DAVIS_INPUT"
@@ -319,6 +96,11 @@ Index: common/i386/mc-a2.asm
 +            LDFLAGS="$LDFLAGS -pg"
 +            gprof="yes"
 +            ;;
++        --enable-pic)
++            CFLAGS="$CFLAGS -fPIC"
++            ASFLAGS="$ASFLAGS -D__PIC__"
++            pic="yes"
++            ;;
 +        --enable-vfw)
 +            vfw="yes"
 +            ;;
@@ -367,21 +149,21 @@ Index: common/i386/mc-a2.asm
      SYS="CYGWIN"
      CFLAGS="$CFLAGS -mno-cygwin"
      LDFLAGS="$LDFLAGS -mno-cygwin"
-     ASFLAGS="-f win32 -DPREFIX"
      EXE=".exe"
+     DEVNULL="NUL"
      ;;
 -  MINGW*)
 +  mingw*)
      SYS="MINGW"
-     ASFLAGS="-f win32 -DPREFIX"
      EXE=".exe"
+     DEVNULL="NUL"
      ;;
 -  SunOS)
 +  sunos)
      SYS="SunOS"
      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
      LDFLAGS="$LDFLAGS -lm"
-@@ -93,9 +189,8 @@
+@@ -112,9 +213,8 @@
      ;;
  esac
  
@@ -391,8 +173,8 @@ Index: common/i386/mc-a2.asm
 +  i386|i486|i586|i686|bepc)
      ARCH="X86"
      CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
-     ;;
-@@ -105,7 +200,7 @@
+     AS="nasm"
+@@ -135,7 +235,7 @@
      AS="yasm"
      ASFLAGS="-f elf -m amd64"
      ;;
@@ -401,12 +183,12 @@ Index: common/i386/mc-a2.asm
      ARCH="PPC"
      if [ $SYS = MACOSX ]
      then
-@@ -150,86 +245,6 @@
+@@ -183,90 +283,7 @@
  
  CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
  
 -# parse options
--
 -for opt do
 -    optarg="${opt#*=}"
 -    case "$opt" in
@@ -414,7 +196,7 @@ Index: common/i386/mc-a2.asm
 -            prefix="$optarg"
 -            ;;
 -        --exec-prefix=*)
--            eprefix="$optarg"
+-            exec_prefix="$optarg"
 -            ;;
 -        --bindir=*)
 -            bindir="$optarg"
@@ -426,20 +208,17 @@ Index: common/i386/mc-a2.asm
 -            includedir="$optarg"
 -            ;;
 -        --enable-avis-input)
--            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
--                CFLAGS="$CFLAGS -DAVIS_INPUT"
--                LDFLAGS="$LDFLAGS -lvfw32"
--                avis_input="yes"
--            fi
+-            avis_input="yes"
+-            ;;
+-        --disable-avis-input)
+-            avis_input="no"
 -            ;;
 -        --enable-mp4-output)
--            CFLAGS="$CFLAGS -DMP4_OUTPUT"
--            LDFLAGS="$LDFLAGS -lgpac_static"
--            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
--                LDFLAGS="$LDFLAGS -lwinmm"
--            fi
 -            mp4_output="yes"
 -            ;;
+-        --disable-mp4-output)
+-            mp4_output="no"
+-            ;;
 -        --extra-asflags=*)
 -            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
 -            ;;
@@ -452,15 +231,10 @@ Index: common/i386/mc-a2.asm
 -            VFW_LDFLAGS="${opt#--extra-ldflags=}"
 -            ;;
 -        --enable-pthread)
--            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
 -            pthread="yes"
--            case $SYS in
--              MINGW|CYGWIN|BEOS)
--                ;;
--              *)
--                LDFLAGS="$LDFLAGS -lpthread"
--                ;;
--            esac
+-            ;;
+-        --disable-pthread)
+-            pthread="no"
 -            ;;
 -        --enable-debug)
 -            CFLAGS="$CFLAGS -g"
@@ -471,9 +245,21 @@ Index: common/i386/mc-a2.asm
 -            LDFLAGS="$LDFLAGS -pg"
 -            gprof="yes"
 -            ;;
+-        --enable-pic)
+-            pic="yes"
+-            ;;
 -        --enable-vfw)
 -            vfw="yes"
 -            ;;
+-        --disable-vfw)
+-            vfw="no"
+-            ;;
+-        --enable-shared)
+-            shared="yes"
+-            if [ $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" ] ; then
+-                pic="yes"
+-            fi
+-            ;;
 -        --enable-visualize)
 -            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
 -            CFLAGS="$CFLAGS -DVISUALIZE=1"
@@ -485,10 +271,10 @@ Index: common/i386/mc-a2.asm
 -    esac
 -done
 -
- VFWFLAGS=
- if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
-     CFLAGS="$CFLAGS -s -fomit-frame-pointer"
-@@ -253,6 +268,9 @@
+ # autodetect options that weren't forced nor disabled
+ if test "$pthread" = "auto" ; then
+@@ -351,6 +368,9 @@
  ASFLAGS=$ASFLAGS
  VFW=$vfw
  EXE=$EXE
@@ -497,33 +283,37 @@ Index: common/i386/mc-a2.asm
 +RANLIB=$RANLIB
  VIS=$vis
  HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
- EOF
---- Makefile.crosscompile~     2005-10-27 17:01:35.000000000 +0200
-+++ Makefile   2005-10-27 17:02:51.000000000 +0200
-@@ -62,8 +62,8 @@
+ DEVNULL=$DEVNULL
+Index: Makefile
+===================================================================
+--- Makefile   (revision 473)
++++ Makefile   (working copy)
+@@ -64,8 +64,8 @@
  default: $(DEP) x264$(EXE)
  
  libx264.a: .depend $(OBJS) $(OBJASM)
 -      ar rc libx264.a $(OBJS) $(OBJASM)
 -      ranlib libx264.a
-+      $(AR) $(AROPTS) libx264.a $(OBJS) $(OBJASM)
++      $(AR) rc libx264.a $(OBJS) $(OBJASM)
 +      $(RANLIB) libx264.a
  
- x264$(EXE): libx264.a x264.o matroska.o
-       $(CC) -o $@ x264.o matroska.o libx264.a $(LDFLAGS)
-@@ -100,12 +100,12 @@
+ $(SONAME): .depend $(OBJS) $(OBJASM)
+       $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME)
+@@ -133,14 +133,14 @@
  distclean: clean
-       rm -f config.mak vfw/build/cygwin/config.mak
+       rm -f config.mak config.h vfw/build/cygwin/config.mak x264.pc
  
--install: x264
+-install: x264 $(SONAME)
 +install: x264$(EXE)
-       install -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
+       install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
+       install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig
        install -m 644 x264.h $(DESTDIR)$(includedir)
        install -m 644 libx264.a $(DESTDIR)$(libdir)
+       install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
 -      install x264 $(DESTDIR)$(bindir)
 -      ranlib $(DESTDIR)$(libdir)/libx264.a
 +      install x264$(EXE) $(DESTDIR)$(bindir)
 +      $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
- etags: TAGS
+       $(if $(SONAME), ln -sf $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.so)
+       $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))