]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/x264-svn-win32.patch
x264-svn-win32.patch: updated for x264 rev 380
[vlc] / extras / contrib / src / Patches / x264-svn-win32.patch
1 Index: common/i386/mc-a.asm
2 ===================================================================
3 --- common/i386/mc-a.asm        (revision 346)
4 +++ common/i386/mc-a.asm        (working copy)
5 @@ -46,22 +46,6 @@
6  %endmacro
7  
8  ;=============================================================================
9 -; Constants
10 -;=============================================================================
11 -
12 -%ifdef FORMAT_COFF
13 -SECTION .rodata data
14 -%else
15 -SECTION .rodata data align=16
16 -%endif
17 -
18 -ALIGN 16
19 -pw_4:  times 4 dw  4
20 -pw_8:  times 4 dw  8
21 -pw_32: times 4 dw 32
22 -pw_64: times 4 dw 64
23 -
24 -;=============================================================================
25  ; Code
26  ;=============================================================================
27  
28 @@ -589,3 +573,20 @@
29  .finish
30      pop     edi
31      ret
32 +
33 +;=============================================================================
34 +; Constants
35 +;=============================================================================
36 +
37 +%ifdef FORMAT_COFF
38 +SECTION .rodata data
39 +%else
40 +SECTION .rodata data align=16
41 +%endif
42 +
43 +ALIGN 16
44 +pw_4:  times 4 dw  4
45 +pw_8:  times 4 dw  8
46 +pw_32: times 4 dw 32
47 +pw_64: times 4 dw 64
48 +
49 Index: common/i386/deblock-a.asm
50 ===================================================================
51 --- common/i386/deblock-a.asm   (revision 346)
52 +++ common/i386/deblock-a.asm   (working copy)
53 @@ -31,11 +31,6 @@
54      %endif
55  %endmacro
56  
57 -SECTION .rodata align=16
58 -pb_01: times 16 db 0x01
59 -pb_3f: times 16 db 0x3f
60 -pb_ff: times 16 db 0xff
61 -
62  SECTION .text
63  cglobal x264_deblock_v8_luma_mmxext
64  cglobal x264_deblock_h_luma_mmxext
65 @@ -525,3 +520,11 @@
66      pop  ebp
67      CHROMA_END
68  
69 +;=============================================================================
70 +; Local Data (Read Only)
71 +;=============================================================================
72 +SECTION .rodata align=16
73 +pb_01: times 16 db 0x01
74 +pb_3f: times 16 db 0x3f
75 +pb_ff: times 16 db 0xff
76 +
77 Index: common/i386/dct-a.asm
78 ===================================================================
79 --- common/i386/dct-a.asm       (revision 346)
80 +++ common/i386/dct-a.asm       (working copy)
81 @@ -124,31 +124,6 @@
82  %endmacro
83  
84  ;=============================================================================
85 -; Local Data (Read Only)
86 -;=============================================================================
87 -
88 -%ifdef FORMAT_COFF
89 -SECTION .rodata data
90 -%else
91 -SECTION .rodata data align=16
92 -%endif
93 -
94 -;-----------------------------------------------------------------------------
95 -; Various memory constants (trigonometric values or rounding values)
96 -;-----------------------------------------------------------------------------
97 -
98 -ALIGN 16
99 -x264_mmx_1:        dw  1,  1,  1,  1
100 -x264_mmx_32:       dw 32, 32, 32, 32
101 -x264_mmx_PPNN:     dw  1,  1, -1, -1
102 -x264_mmx_PNPN:     dw  1, -1,  1, -1 
103 -x264_mmx_PNNP:     dw  1, -1, -1,  1 
104 -x264_mmx_PPPN:     dw  1,  1,  1, -1 
105 -x264_mmx_PPNP:     dw  1,  1, -1,  1 
106 -x264_mmx_2121:     dw  2,  1,  2,  1 
107 -x264_mmx_p2n2p1p1: dw  2, -2,  1,  1
108 -
109 -;=============================================================================
110  ; Code
111  ;=============================================================================
112  
113 @@ -729,3 +704,28 @@
114      %endrep
115      ret
116  
117 +;=============================================================================
118 +; Local Data (Read Only)
119 +;=============================================================================
120 +
121 +%ifdef FORMAT_COFF
122 +SECTION .rodata data
123 +%else
124 +SECTION .rodata data align=16
125 +%endif
126 +
127 +;-----------------------------------------------------------------------------
128 +; Various memory constants (trigonometric values or rounding values)
129 +;-----------------------------------------------------------------------------
130 +
131 +ALIGN 16
132 +x264_mmx_1:        dw  1,  1,  1,  1
133 +x264_mmx_32:       dw 32, 32, 32, 32
134 +x264_mmx_PPNN:     dw  1,  1, -1, -1
135 +x264_mmx_PNPN:     dw  1, -1,  1, -1 
136 +x264_mmx_PNNP:     dw  1, -1, -1,  1 
137 +x264_mmx_PPPN:     dw  1,  1,  1, -1 
138 +x264_mmx_PPNP:     dw  1,  1, -1,  1 
139 +x264_mmx_2121:     dw  2,  1,  2,  1 
140 +x264_mmx_p2n2p1p1: dw  2, -2,  1,  1
141 +
142 Index: common/i386/pixel-sse2.asm
143 ===================================================================
144 --- common/i386/pixel-sse2.asm  (revision 346)
145 +++ common/i386/pixel-sse2.asm  (working copy)
146 @@ -36,15 +36,6 @@
147  %endmacro
148  
149  
150 -%ifdef FORMAT_COFF
151 -SECTION .rodata data
152 -%else
153 -SECTION .rodata data align=16
154 -%endif
155 -
156 -pd_0000ffff: times 4 dd 0x0000ffff
157 -
158 -
159  SECTION .text
160  
161  
162 @@ -531,3 +522,15 @@
163  
164      SATD_END
165  
166 +;=============================================================================
167 +; Local Data (Read Only)
168 +;=============================================================================
169 +%ifdef FORMAT_COFF
170 +SECTION .rodata data
171 +%else
172 +SECTION .rodata data align=16
173 +%endif
174 +
175 +pd_0000ffff: times 4 dd 0x0000ffff
176 +
177 +
178 Index: common/i386/mc-a2.asm
179 ===================================================================
180 --- common/i386/mc-a2.asm       (revision 346)
181 +++ common/i386/mc-a2.asm       (working copy)
182 @@ -33,22 +33,6 @@
183      %endif
184  %endmacro
185  
186 -;=============================================================================
187 -; Read only data
188 -;=============================================================================
189 -
190 -SECTION .rodata data align=16
191 -
192 -ALIGN 16
193 -mmx_dw_one:
194 -    times 4 dw 16
195 -mmx_dd_one:
196 -    times 2 dd 512
197 -mmx_dw_20:
198 -    times 4 dw 20
199 -mmx_dw_5:
200 -    times 4 dw -5
201 -
202  %assign twidth  0
203  %assign theight 4
204  %assign tdstp1  8
205 @@ -374,3 +358,20 @@
206      pop         edi
207  
208      ret
209 +
210 +;=============================================================================
211 +; Read only data
212 +;=============================================================================
213 +
214 +SECTION .rodata data align=16
215 +
216 +ALIGN 16
217 +mmx_dw_one:
218 +    times 4 dw 16
219 +mmx_dd_one:
220 +    times 2 dd 512
221 +mmx_dw_20:
222 +    times 4 dw 20
223 +mmx_dw_5:
224 +    times 4 dw -5
225 +
226 --- configure   2005-11-28 15:42:12.390625000 +0000
227 +++ configure.new       2005-11-28 15:52:48.687500000 +0000
228 @@ -7,6 +7,7 @@
229  echo "available options:"
230  echo ""
231  echo "  --help                   print this message"
232 +echo "  --crosscompile=ARCH      crosscompile for ARCH"
233  echo "  --enable-avis-input      enables avisynth input (win32 only)"
234  echo "  --enable-mp4-output      enables mp4 output (using gpac)"
235  echo "  --enable-vfw             compiles the VfW frontend"
236 @@ -46,31 +47,126 @@
237  
238  EXE=""
239  
240 -UNAMES="`uname -s`"
241 +AR="ar"
242 +AROPTS="rc"
243 +RANLIB="ranlib"
244 +
245 +UNAMES="`uname -s |tr A-Z a-z`"
246 +UNAMEM="`uname -m |tr A-Z a-z`"
247 +
248 +# parse options
249 +
250 +for opt do
251 +    optarg="${opt#*=}"
252 +    case "$opt" in
253 +       --crosscompile=*)
254 +           CROSS="$optarg"
255 +           CC="$CROSS-gcc"
256 +           AR="$CROSS-ar"
257 +           RANLIB="$CROSS-ranlib"
258 +           UNAMES="`echo $CROSS | cut -d- -f2`"
259 +           UNAMEM="`echo $CROSS | cut -d- -f1`"
260 +           ;;
261 +       --prefix=*)
262 +           prefix="$optarg"
263 +           ;;
264 +       --exec-prefix=*)
265 +           exec_prefix="$optarg"
266 +           ;;
267 +       --bindir=*)
268 +           bindir="$optarg"
269 +           ;;
270 +       --libdir=*)
271 +           libdir="$optarg"
272 +           ;;
273 +       --includedir=*)
274 +           includedir="$optarg"
275 +           ;;
276 +        --enable-avis-input)
277 +            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
278 +                CFLAGS="$CFLAGS -DAVIS_INPUT"
279 +                LDFLAGS="$LDFLAGS -lvfw32"
280 +                avis_input="yes"
281 +            fi
282 +            ;;
283 +        --enable-mp4-output)
284 +            CFLAGS="$CFLAGS -DMP4_OUTPUT"
285 +            LDFLAGS="$LDFLAGS -lgpac_static"
286 +            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
287 +                LDFLAGS="$LDFLAGS -lwinmm"
288 +            fi
289 +            mp4_output="yes"
290 +            ;;
291 +        --extra-asflags=*)
292 +            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
293 +            ;;
294 +        --extra-cflags=*)
295 +            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
296 +            VFW_CFLAGS="${opt#--extra-cflags=}"
297 +            ;;
298 +        --extra-ldflags=*)
299 +            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
300 +            VFW_LDFLAGS="${opt#--extra-ldflags=}"
301 +            ;;
302 +        --enable-pthread)
303 +            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
304 +            pthread="yes"
305 +            case $SYS in
306 +              MINGW|CYGWIN|BEOS)
307 +                ;;
308 +              *)
309 +                LDFLAGS="$LDFLAGS -lpthread"
310 +                ;;
311 +            esac
312 +            ;;
313 +        --enable-debug)
314 +            CFLAGS="$CFLAGS -g"
315 +            debug="yes"
316 +            ;;
317 +        --enable-gprof)
318 +            CFLAGS="$CFLAGS -pg"
319 +            LDFLAGS="$LDFLAGS -pg"
320 +            gprof="yes"
321 +            ;;
322 +        --enable-vfw)
323 +            vfw="yes"
324 +            ;;
325 +        --enable-visualize)
326 +            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
327 +            CFLAGS="$CFLAGS -DVISUALIZE=1"
328 +            vis="yes"
329 +            ;;
330 +        *)
331 +            echo "Unknown option $opt, ignored"
332 +            ;;
333 +    esac
334 +done
335 +
336 +
337  case "$UNAMES" in
338 -  BeOS)
339 +  beos)
340      SYS="BEOS"
341      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
342      ;;
343 -  Darwin)
344 +  darwin)
345      SYS="MACOSX"
346      CFLAGS="$CFLAGS -falign-loops=16"
347      LDFLAGS="$LDFLAGS -lm -lmx"
348      ;;
349 -  FreeBSD)
350 +  freebsd)
351      SYS="FREEBSD"
352      LDFLAGS="$LDFLAGS -lm"
353      ;;
354 -  NetBSD)
355 +  netbsd)
356      SYS="NETBSD"
357      LDFLAGS="$LDFLAGS -lm"
358      ;;
359 -  Linux)
360 +  linux)
361      SYS="LINUX"
362      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
363      LDFLAGS="$LDFLAGS -lm"
364      ;;
365 -  CYGWIN*)
366 +  cygwin*)
367      SYS="CYGWIN"
368      CFLAGS="$CFLAGS -mno-cygwin"
369      LDFLAGS="$LDFLAGS -mno-cygwin"
370 @@ -78,13 +174,13 @@
371      EXE=".exe"
372      DEVNULL="NUL"
373      ;;
374 -  MINGW*)
375 +  mingw*)
376      SYS="MINGW"
377      ASFLAGS="-f win32 -DPREFIX"
378      EXE=".exe"
379      DEVNULL="NUL"
380      ;;
381 -  SunOS)
382 +  sunos)
383      SYS="SunOS"
384      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
385      LDFLAGS="$LDFLAGS -lm"
386 @@ -96,9 +192,8 @@
387      ;;
388  esac
389  
390 -UNAMEM="`uname -m`"
391  case "$UNAMEM" in
392 -  i386|i486|i586|i686|BePC)
393 +  i386|i486|i586|i686|bepc)
394      ARCH="X86"
395      CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
396      ;;
397 @@ -108,7 +203,7 @@
398      AS="yasm"
399      ASFLAGS="-f elf -m amd64"
400      ;;
401 -  "Power Macintosh"|ppc)
402 +  "power macintosh"|ppc)
403      ARCH="PPC"
404      if [ $SYS = MACOSX ]
405      then
406 @@ -156,86 +251,6 @@
407  
408  CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
409  
410 -# parse options
411 -
412 -for opt do
413 -    optarg="${opt#*=}"
414 -    case "$opt" in
415 -        --prefix=*)
416 -            prefix="$optarg"
417 -            ;;
418 -        --exec-prefix=*)
419 -            exec_prefix="$optarg"
420 -            ;;
421 -        --bindir=*)
422 -            bindir="$optarg"
423 -            ;;
424 -        --libdir=*)
425 -            libdir="$optarg"
426 -            ;;
427 -        --includedir=*)
428 -            includedir="$optarg"
429 -            ;;
430 -        --enable-avis-input)
431 -            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
432 -                CFLAGS="$CFLAGS -DAVIS_INPUT"
433 -                LDFLAGS="$LDFLAGS -lvfw32"
434 -                avis_input="yes"
435 -            fi
436 -            ;;
437 -        --enable-mp4-output)
438 -            CFLAGS="$CFLAGS -DMP4_OUTPUT"
439 -            LDFLAGS="$LDFLAGS -lgpac_static"
440 -            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
441 -                LDFLAGS="$LDFLAGS -lwinmm"
442 -            fi
443 -            mp4_output="yes"
444 -            ;;
445 -        --extra-asflags=*)
446 -            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
447 -            ;;
448 -        --extra-cflags=*)
449 -            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
450 -            VFW_CFLAGS="${opt#--extra-cflags=}"
451 -            ;;
452 -        --extra-ldflags=*)
453 -            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
454 -            VFW_LDFLAGS="${opt#--extra-ldflags=}"
455 -            ;;
456 -        --enable-pthread)
457 -            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
458 -            pthread="yes"
459 -            case $SYS in
460 -              MINGW|CYGWIN|BEOS)
461 -                ;;
462 -              *)
463 -                LDFLAGS="$LDFLAGS -lpthread"
464 -                ;;
465 -            esac
466 -            ;;
467 -        --enable-debug)
468 -            CFLAGS="$CFLAGS -g"
469 -            debug="yes"
470 -            ;;
471 -        --enable-gprof)
472 -            CFLAGS="$CFLAGS -pg"
473 -            LDFLAGS="$LDFLAGS -pg"
474 -            gprof="yes"
475 -            ;;
476 -        --enable-vfw)
477 -            vfw="yes"
478 -            ;;
479 -        --enable-visualize)
480 -            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
481 -            CFLAGS="$CFLAGS -DVISUALIZE=1"
482 -            vis="yes"
483 -            ;;
484 -        *)
485 -            echo "Unknown option $opt, ignored"
486 -            ;;
487 -    esac
488 -done
489 -
490  VFWFLAGS=
491  if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
492      CFLAGS="$CFLAGS -s -fomit-frame-pointer"
493 @@ -259,6 +274,9 @@
494  ASFLAGS=$ASFLAGS
495  VFW=$vfw
496  EXE=$EXE
497 +AR=$AR
498 +AROPTS=$AROPTS
499 +RANLIB=$RANLIB
500  VIS=$vis
501  HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
502  DEVNULL=$DEVNULL
503 --- Makefile.old        2005-11-23 17:25:15.953125000 +0000
504 +++ Makefile    2005-11-23 17:38:09.796875000 +0000
505 @@ -62,8 +62,8 @@
506  default: $(DEP) x264$(EXE)
507  
508  libx264.a: .depend $(OBJS) $(OBJASM)
509 -       ar rc libx264.a $(OBJS) $(OBJASM)
510 -       ranlib libx264.a
511 +       $(AR) rc libx264.a $(OBJS) $(OBJASM)
512 +       $(RANLIB) libx264.a
513  
514  x264$(EXE): libx264.a x264.o matroska.o
515         $(CC) -o $@ x264.o matroska.o libx264.a $(LDFLAGS)
516 @@ -106,8 +106,8 @@
517         install -m 644 x264.h $(DESTDIR)$(includedir)
518         install -m 644 libx264.a $(DESTDIR)$(libdir)
519         install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
520 -       install x264 $(DESTDIR)$(bindir)
521 -       ranlib $(DESTDIR)$(libdir)/libx264.a
522 +       install x264$(EXE) $(DESTDIR)$(bindir)
523 +       $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
524  
525  .PHONY: uninstall
526  uninstall: