Browse code

fixed config for direct mplayer build compatibility

Originally committed as revision 8 to svn://svn.ffmpeg.org/ffmpeg/trunk

Fabrice Bellard authored on 2001/07/24 05:06:54
Showing 11 changed files
... ...
@@ -1,11 +1,11 @@
1 1
 # Main ffmpeg Makefile
2 2
 # (c) 2000, 2001 Gerard Lantau
3 3
 #
4
-include config.mk
4
+include config.mak
5 5
 
6
-CFLAGS= -O2 -Wall -g -I./libavcodec -I./libav 
6
+CFLAGS= $(OPTFLAGS) -Wall -g -I./libavcodec -I./libav 
7 7
 LDFLAGS= -g 
8
-ifdef CONFIG_GPROF
8
+ifeq ($(TARGET_GPROF),yes)
9 9
 CFLAGS+=-p
10 10
 LDFLAGS+=-p
11 11
 endif
... ...
@@ -28,7 +28,7 @@ ffserver: ffserver.o libav/libav.a libavcodec/libavcodec.a
28 28
 	gcc $(CFLAGS) -c -o $@ $< 
29 29
 
30 30
 install: all
31
-	install -s -m 755 $(PROG) $(PREFIX)/bin
31
+	install -s -m 755 $(PROG) $(prefix)/bin
32 32
 
33 33
 clean: 
34 34
 	make -C libavcodec clean
... ...
@@ -36,7 +36,7 @@ clean:
36 36
 	rm -f *.o *~ gmon.out TAGS $(PROG) 
37 37
 
38 38
 distclean: clean
39
-	rm -f Rules.mk config.h
39
+	rm -f config.mak config.h
40 40
 
41 41
 TAGS:
42 42
 	etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
... ...
@@ -53,23 +53,24 @@ echo "CPU              $cpu"
53 53
 echo "MMX enabled      $mmx"
54 54
 echo "gprof enabled    $gprof"
55 55
 
56
-echo "Creating config.mk and config.h"
56
+echo "Creating config.mak and config.h"
57 57
 
58
-echo "# Automatically generated by configure - do not modify" > config.mk
58
+echo "# Automatically generated by configure - do not modify" > config.mak
59 59
 echo "/* Automatically generated by configure - do not modify */" > config.h
60 60
 
61
-echo "PREFIX=$prefix" >> config.mk
62
-echo "CC=$cc" >> config.mk
63
-echo "AR=$ar" >> config.mk
61
+echo "prefix=$prefix" >> config.mak
62
+echo "CC=$cc" >> config.mak
63
+echo "AR=$ar" >> config.mak
64
+echo "OPTFLAGS=-O2" >> config.mak
64 65
 if [ "$cpu" = "x86" ] ; then
65
-  echo "CONFIG_CPU_X86=y" >> config.mk
66
-  echo "#define CONFIG_CPU_X86 1" >> config.h
66
+  echo "TARGET_ARCH_X86=yes" >> config.mak
67
+  echo "#define ARCH_X86 1" >> config.h
67 68
 fi
68 69
 if [ "$mmx" = "yes" ] ; then
69
-  echo "CONFIG_MMX=y" >> config.mk
70
-  echo "#define CONFIG_MMX 1" >> config.h
70
+  echo "TARGET_MMX=yes" >> config.mak
71
+  echo "#define HAVE_MMX 1" >> config.h
71 72
 fi
72 73
 if [ "$gprof" = "yes" ] ; then
73
-  echo "CONFIG_GPROF=y" >> config.mk
74
-  echo "#define CONFIG_GPROF 1" >> config.h
74
+  echo "TARGET_GPROF=yes" >> config.mak
75
+  echo "#define HAVE_GPROF 1" >> config.h
75 76
 fi
... ...
@@ -8,7 +8,15 @@
8 8
   demux code for several formats). (no example yet, the API is likely
9 9
   to evolve).
10 10
 
11
-2) Coding Rules
11
+2) Integrating libavXXX in your GPL'ed program
12
+----------------------------------------------
13
+
14
+You can integrate all the source code of the libraries to link them
15
+statically to avoid any version problem. All you need is to provide a
16
+'config.mak' and a 'config.h' in the parent directory. See the defines
17
+generated by ./configure to understand what is needed.
18
+
19
+3) Coding Rules
12 20
 ---------------
13 21
 
14 22
 ffmpeg is programmed in ANSI C language. GCC extension are
... ...
@@ -16,7 +16,11 @@ Planned in next release:
16 16
 (DONE) - add RV10 decoding.
17 17
 (DONE) - add true pgm support.
18 18
 (DONE) - msmpeg4 0x18 fix.
19
+- add encode and ac3/mpglib disabling option
19 20
 - add qscale out.
21
+- add decode quant optimisation.
22
+- see black region optimization (Arpi request).
23
+- check ffmpeg mpeg1 encoding (Happy Camer mail)
20 24
 - add format autodetect with content (for example to distinguish
21 25
   mpegvideo/mpegmux).
22 26
 - add external alloc for libavcodec (avifile request).
... ...
@@ -1,5 +1,5 @@
1
-include ../config.mk
2
-CFLAGS= -O2 -Wall -g -I../libavcodec
1
+include ../config.mak
2
+CFLAGS= $(OPTFLAGS) -Wall -g -I../libavcodec
3 3
 
4 4
 OBJS= rm.o mpeg.o asf.o avienc.o jpegenc.o swf.o wav.o raw.o \
5 5
 	 avidec.o ffm.o \
... ...
@@ -1,11 +1,13 @@
1
-include ../config.mk
2
-CFLAGS= -O2 -Wall -g
1
+include ../config.mak
2
+
3
+CFLAGS= $(OPTFLAGS) -Wall -g
3 4
 LDFLAGS= -g
4 5
 
5 6
 OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \
6 7
       mpegaudio.o ac3enc.o mjpegenc.o resample.o dsputil.o \
7 8
       motion_est.o imgconvert.o imgresample.o msmpeg4.o \
8 9
       mpeg12.o h263dec.o rv10.o
10
+ASM_OBJS=
9 11
 
10 12
 # currently using libac3 for ac3 decoding
11 13
 OBJS+= ac3dec.o \
... ...
@@ -18,19 +20,22 @@ OBJS+= mpegaudiodec.o \
18 18
        mpglib/dct64_i386.o mpglib/decode_i386.o  mpglib/tabinit.o
19 19
 
20 20
 # i386 mmx specific stuff
21
-ifdef CONFIG_MMX
22
-OBJS += i386/fdct_mmx.o i386/fdctdata.o i386/sad_mmx.o i386/cputest.o \
21
+ifeq ($(TARGET_MMX),yes)
22
+ASM_OBJS += i386/fdct_mmx.o i386/sad_mmx.o
23
+OBJS += i386/fdctdata.o i386/cputest.o \
23 24
 	i386/dsputil_mmx.o
24 25
 endif
25 26
 
27
+SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
28
+
26 29
 LIB= libavcodec.a
27 30
 TESTS= imgresample-test dct-test
28 31
 
29 32
 all: $(LIB) apiexample
30 33
 
31
-$(LIB): $(OBJS)
34
+$(LIB): $(OBJS) $(ASM_OBJS)
32 35
 	rm -f $@
33
-	$(AR) rcs $@ $(OBJS)
36
+	$(AR) rcs $@ $(OBJS) $(ASM_OBJS)
34 37
 
35 38
 dsputil.o: dsputil.c dsputil.h
36 39
 
... ...
@@ -40,12 +45,21 @@ dsputil.o: dsputil.c dsputil.h
40 40
 %.o: %.s
41 41
 	nasm -f elf -o $@ $<
42 42
 
43
+# depend only used by mplayer now
44
+dep:	depend
45
+
46
+depend:
47
+	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
48
+
43 49
 clean: 
44 50
 	rm -f *.o *~ *.a i386/*.o i386/*~ \
45 51
            libac3/*.o libac3/*~ \
46 52
            mpglib/*.o mpglib/*~ \
47 53
            apiexample $(TESTS)
48 54
 
55
+distclean: clean
56
+	rm -f Makefile.bak .depend
57
+
49 58
 # api example program
50 59
 apiexample: apiexample.c $(LIB)
51 60
 	$(CC) $(CFLAGS) -o $@ $< $(LIB) -lm
... ...
@@ -3,8 +3,8 @@
3 3
 
4 4
 #include "../config.h"
5 5
 
6
-#ifndef USE_LIBAVCODEC
7
-// workaround for typedef conflict in MPlayer
6
+#ifndef __WINE_WINDEF16_H
7
+/* workaround for typedef conflict in MPlayer (wine typedefs) */
8 8
 typedef unsigned short UINT16;
9 9
 typedef signed short INT16;
10 10
 #endif
... ...
@@ -21,7 +21,7 @@
21 21
 #include "avcodec.h"
22 22
 #include "dsputil.h"
23 23
 
24
-#ifdef CONFIG_MMX
24
+#ifdef HAVE_MMX
25 25
 int mm_flags; /* multimedia extension flags */
26 26
 #endif
27 27
 
... ...
@@ -377,7 +377,7 @@ void dsputil_init(void)
377 377
     pix_abs16x16_xy2 = pix_abs16x16_xy2_c;
378 378
     av_fdct = jpeg_fdct_ifast;
379 379
 
380
-#ifdef CONFIG_MMX
380
+#ifdef HAVE_MMX
381 381
     dsputil_init_mmx();
382 382
 #endif
383 383
 }
... ...
@@ -61,7 +61,7 @@ int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
61 61
 int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
62 62
 int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h);
63 63
 
64
-#ifdef CONFIG_MMX
64
+#ifdef HAVE_MMX
65 65
 
66 66
 #define MM_MMX    0x0001 /* standard MMX */
67 67
 #define MM_3DNOW  0x0004 /* AMD 3DNOW */
... ...
@@ -130,7 +130,7 @@ static void v_resample(UINT8 *dst, int dst_width, UINT8 *src, int wrap,
130 130
     }
131 131
 }
132 132
 
133
-#ifdef CONFIG_MMX
133
+#ifdef HAVE_MMX
134 134
 
135 135
 #include "i386/mmx.h"
136 136
 
... ...
@@ -317,7 +317,7 @@ static void h_resample(UINT8 *dst, int dst_width, UINT8 *src, int src_width,
317 317
     } else {
318 318
         n = dst_width;
319 319
     }
320
-#ifdef CONFIG_MMX
320
+#ifdef HAVE_MMX
321 321
     if ((mm_flags & MM_MMX) && NB_TAPS == 4)
322 322
         h_resample_fast4_mmx(dst, n, 
323 323
                              src, src_width, src_start, src_incr, filters);
... ...
@@ -374,7 +374,7 @@ static void component_resample(ImgReSampleContext *s,
374 374
         }
375 375
         /* apply vertical filter */
376 376
         phase_y = get_phase(src_y);
377
-#ifdef CONFIG_MMX
377
+#ifdef HAVE_MMX
378 378
         /* desactivated MMX because loss of precision */
379 379
         if ((mm_flags & MM_MMX) && NB_TAPS == 4 && 0)
380 380
             v_resample4_mmx(output, owidth, 
... ...
@@ -516,7 +516,7 @@ static void dump_filter(INT16 *filter)
516 516
     }
517 517
 }
518 518
 
519
-#ifdef CONFIG_MMX
519
+#ifdef HAVE_MMX
520 520
 int mm_flags;
521 521
 #endif
522 522
 
... ...
@@ -588,7 +588,7 @@ int main(int argc, char **argv)
588 588
     }
589 589
 
590 590
     /* mmx test */
591
-#ifdef CONFIG_MMX
591
+#ifdef HAVE_MMX
592 592
     printf("MMX test\n");
593 593
     fact = 0.72;
594 594
     xsize = (int)(XSIZE * fact);
... ...
@@ -434,7 +434,7 @@ int estimate_motion(MpegEncContext * s,
434 434
 	dmin = phods_motion_search(s, &mx, &my, range / 2, xmin, ymin, xmax, ymax);
435 435
         break;
436 436
     }
437
-#ifdef CONFIG_MMX
437
+#ifdef HAVE_MMX
438 438
     if (mm_flags & MM_MMX)
439 439
         emms();
440 440
 #endif