]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/x264-svn-win32.patch
631f1861386fd90dca19868b4ceaea0b0407fee6
[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.crosscompile~     2005-10-23 14:48:21.000000000 +0200
227 +++ configure   2005-10-27 17:04:09.000000000 +0200
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 @@ -45,43 +46,138 @@
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 +           eprefix="$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      ASFLAGS="-f win32 -DPREFIX"
371      EXE=".exe"
372      ;;
373 -  MINGW*)
374 +  mingw*)
375      SYS="MINGW"
376      ASFLAGS="-f win32 -DPREFIX"
377      EXE=".exe"
378      ;;
379 -  SunOS)
380 +  sunos)
381      SYS="SunOS"
382      CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
383      LDFLAGS="$LDFLAGS -lm"
384 @@ -93,9 +189,8 @@
385      ;;
386  esac
387  
388 -UNAMEM="`uname -m`"
389  case "$UNAMEM" in
390 -  i386|i486|i586|i686|BePC)
391 +  i386|i486|i586|i686|bepc)
392      ARCH="X86"
393      CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
394      ;;
395 @@ -105,7 +200,7 @@
396      AS="yasm"
397      ASFLAGS="-f elf -m amd64"
398      ;;
399 -  "Power Macintosh"|ppc)
400 +  "power macintosh"|ppc)
401      ARCH="PPC"
402      if [ $SYS = MACOSX ]
403      then
404 @@ -150,86 +245,6 @@
405  
406  CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
407  
408 -# parse options
409 -
410 -for opt do
411 -    optarg="${opt#*=}"
412 -    case "$opt" in
413 -        --prefix=*)
414 -            prefix="$optarg"
415 -            ;;
416 -        --exec-prefix=*)
417 -            eprefix="$optarg"
418 -            ;;
419 -        --bindir=*)
420 -            bindir="$optarg"
421 -            ;;
422 -        --libdir=*)
423 -            libdir="$optarg"
424 -            ;;
425 -        --includedir=*)
426 -            includedir="$optarg"
427 -            ;;
428 -        --enable-avis-input)
429 -            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
430 -                CFLAGS="$CFLAGS -DAVIS_INPUT"
431 -                LDFLAGS="$LDFLAGS -lvfw32"
432 -                avis_input="yes"
433 -            fi
434 -            ;;
435 -        --enable-mp4-output)
436 -            CFLAGS="$CFLAGS -DMP4_OUTPUT"
437 -            LDFLAGS="$LDFLAGS -lgpac_static"
438 -            if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
439 -                LDFLAGS="$LDFLAGS -lwinmm"
440 -            fi
441 -            mp4_output="yes"
442 -            ;;
443 -        --extra-asflags=*)
444 -            ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
445 -            ;;
446 -        --extra-cflags=*)
447 -            CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
448 -            VFW_CFLAGS="${opt#--extra-cflags=}"
449 -            ;;
450 -        --extra-ldflags=*)
451 -            LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
452 -            VFW_LDFLAGS="${opt#--extra-ldflags=}"
453 -            ;;
454 -        --enable-pthread)
455 -            CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
456 -            pthread="yes"
457 -            case $SYS in
458 -              MINGW|CYGWIN|BEOS)
459 -                ;;
460 -              *)
461 -                LDFLAGS="$LDFLAGS -lpthread"
462 -                ;;
463 -            esac
464 -            ;;
465 -        --enable-debug)
466 -            CFLAGS="$CFLAGS -g"
467 -            debug="yes"
468 -            ;;
469 -        --enable-gprof)
470 -            CFLAGS="$CFLAGS -pg"
471 -            LDFLAGS="$LDFLAGS -pg"
472 -            gprof="yes"
473 -            ;;
474 -        --enable-vfw)
475 -            vfw="yes"
476 -            ;;
477 -        --enable-visualize)
478 -            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
479 -            CFLAGS="$CFLAGS -DVISUALIZE=1"
480 -            vis="yes"
481 -            ;;
482 -        *)
483 -            echo "Unknown option $opt, ignored"
484 -            ;;
485 -    esac
486 -done
487 -
488  VFWFLAGS=
489  if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
490      CFLAGS="$CFLAGS -s -fomit-frame-pointer"
491 @@ -253,6 +268,9 @@
492  ASFLAGS=$ASFLAGS
493  VFW=$vfw
494  EXE=$EXE
495 +AR=$AR
496 +AROPTS=$AROPTS
497 +RANLIB=$RANLIB
498  VIS=$vis
499  HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
500  EOF
501 --- Makefile.crosscompile~      2005-10-27 17:01:35.000000000 +0200
502 +++ Makefile    2005-10-27 17:02:51.000000000 +0200
503 @@ -62,8 +62,8 @@
504  default: $(DEP) x264$(EXE)
505  
506  libx264.a: .depend $(OBJS) $(OBJASM)
507 -       ar rc libx264.a $(OBJS) $(OBJASM)
508 -       ranlib libx264.a
509 +       $(AR) $(AROPTS) libx264.a $(OBJS) $(OBJASM)
510 +       $(RANLIB) libx264.a
511  
512  x264$(EXE): libx264.a x264.o matroska.o
513         $(CC) -o $@ x264.o matroska.o libx264.a $(LDFLAGS)
514 @@ -100,12 +100,12 @@
515  distclean: clean
516         rm -f config.mak vfw/build/cygwin/config.mak
517  
518 -install: x264
519 +install: x264$(EXE)
520         install -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
521         install -m 644 x264.h $(DESTDIR)$(includedir)
522         install -m 644 libx264.a $(DESTDIR)$(libdir)
523 -       install x264 $(DESTDIR)$(bindir)
524 -       ranlib $(DESTDIR)$(libdir)/libx264.a
525 +       install x264$(EXE) $(DESTDIR)$(bindir)
526 +       $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
527  
528  etags: TAGS
529