diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-02-14 21:27:25 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-02-14 21:27:25 +0000 |
commit | bba9b16c265f7a0ce3a1bc5dbf88d178ebec457a (patch) | |
tree | 16024959c1ac83c766f7dd0cf556a5ecaf6c4a19 | |
parent | 7d67e968a4ec375257c21e4658d91452aeba9a74 (diff) | |
download | ffmpeg-bba9b16c265f7a0ce3a1bc5dbf88d178ebec457a.tar.gz |
moving postprocess to ffmpeg/libavcodec
Originally committed as revision 1586 to svn://svn.ffmpeg.org/ffmpeg/trunk
Originally committed as revision 9427 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Originally committed as revision 9428 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
-rwxr-xr-x | configure | 21 | ||||
-rw-r--r-- | libavcodec/Makefile | 12 | ||||
-rw-r--r-- | libavcodec/libpostproc/Makefile | 64 | ||||
-rw-r--r-- | libavcodec/libpostproc/mangle.h | 19 | ||||
-rw-r--r-- | libavcodec/libpostproc/postprocess.c (renamed from postproc/postprocess.c) | 7 | ||||
-rw-r--r-- | libavcodec/libpostproc/postprocess.h (renamed from postproc/postprocess.h) | 0 | ||||
-rw-r--r-- | libavcodec/libpostproc/postprocess_internal.h (renamed from postproc/postprocess_internal.h) | 0 | ||||
-rw-r--r-- | libavcodec/libpostproc/postprocess_template.c (renamed from postproc/postprocess_template.c) | 0 | ||||
-rw-r--r-- | postproc/Makefile | 32 |
9 files changed, 121 insertions, 34 deletions
@@ -60,6 +60,8 @@ mp3lame="no" vorbis="no" a52="yes" a52bin="no" +pp="yes" +shared_pp="no" win32="no" mingw32="no" cygwin="no" @@ -281,6 +283,10 @@ for opt do ;; --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs" ;; + --disable-pp) pp="no" + ;; + --enable-shared-pp) shared_pp="yes" + ;; --enable-mp3lame) mp3lame="yes" ;; --enable-vorbis) vorbis="yes" @@ -578,6 +584,8 @@ echo " --enable-win32 enable win32 cross compile" echo " --enable-mingw32 enable mingw32 native windows compile" echo " --disable-a52 disable GPL'ed A52 support [default=no]" echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" +echo " --disable-pp disable GPL'ed post processing support [default=no]" +echo " --enable-shared-pp use libpostproc.so [default=no]" echo " --enable-shared build shared libraries [default=no]" echo "" echo "Advanced options (experts only):" @@ -631,6 +639,8 @@ echo "mp3lame enabled $mp3lame" echo "vorbis enabled $vorbis" echo "a52 support $a52" echo "a52 dlopened $a52bin" +echo "pp support $pp" +echo "shared pp $shared_pp" echo "Video hooking $vhook" echo "risky / patent encumbered codecs $risky" @@ -754,6 +764,17 @@ if test "$a52" = "yes" ; then fi fi +# PP +if test "$pp" = "yes" ; then + echo "#define CONFIG_PP 1" >> $TMPH + echo "CONFIG_PP=yes" >> config.mak + + if test "$shared_pp" = "yes" ; then + echo "#define SHARED_PP 1" >> $TMPH + echo "SHARED_PP=yes" >> config.mak + fi +fi + # mpeg audio high precision mode if test "$mpegaudio_hp" = "yes" ; then echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f8be2a83fa..62454621b8 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -35,6 +35,15 @@ OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \ endif endif +ifeq ($(CONFIG_PP),yes) +ifeq ($(SHARED_PP),yes) +EXTRALIBS += -lpostproc +else +# LIBS += libpostproc/libpostproc.a ... should be fixed +OBJS += libpostproc/postprocess.o +endif +endif + ifeq ($(CONFIG_MP3LAME),yes) OBJS += mp3lameaudio.o EXTRALIBS += -lmp3lame @@ -125,6 +134,9 @@ $(SLIB): $(OBJS) dsputil.o: dsputil.c dsputil.h +libpostproc/libpostproc.a: + $(MAKE) -C libpostproc + %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< diff --git a/libavcodec/libpostproc/Makefile b/libavcodec/libpostproc/Makefile new file mode 100644 index 0000000000..095dec91ae --- /dev/null +++ b/libavcodec/libpostproc/Makefile @@ -0,0 +1,64 @@ + +include ../../config.mak + +ifeq ($(SHARED_PP),yes) +SPPLIB = libpostproc.so +SPPVERSION = 0.0.1 +endif +PPLIB = libpostproc.a + +PPOBJS=postprocess.o +SPPOBJS=postprocess_pic.o + +CFLAGS = $(OPTFLAGS) $(MLIB_INC) -I. -I.. $(EXTRA_INC) +# -I/usr/X11R6/include/ + +.SUFFIXES: .c .o + +# .PHONY: all clean + +.c.o: + $(CC) -c $(CFLAGS) -I.. -I../.. -o $@ $< + +all: $(SWSLIB) $(PPLIB) $(SPPLIB) + +clean: + rm -f *.o *.a *~ *.so + +distclean: + rm -f Makefile.bak *.o *.a *~ *.so .depend + +dep: depend + +depend: + $(CC) -MM $(CFLAGS) postprocess.c 1>.depend + +ifeq ($(SHARED_PP),yes) +postprocess_pic.o: postprocess.c + $(CC) -c $(CFLAGS) -fomit-frame-pointer -fPIC -DPIC -I.. -I../.. -o $@ $< + +$(SPPLIB): $(SPPOBJS) + $(CC) -shared -Wl,-soname,$(SPPLIB).0 \ + -o $(SPPLIB) $(SPPOBJS) +endif + +$(PPLIB): $(PPOBJS) + $(AR) r $(PPLIB) $(PPOBJS) + +install: all +ifeq ($(SHARED_PP),yes) + install -d $(prefix)/lib + install -s -m 755 $(SPPLIB) $(prefix)/lib/$(SPPLIB).$(SPPVERSION) + ln -sf $(SPPLIB).$(SPPVERSION) $(prefix)/lib/$(SPPLIB) + ldconfig || true + mkdir -p $(prefix)/include/postproc + install -m 644 postprocess.h $(prefix)/include/postproc/postprocess.h +endif + + +# +# include dependency files if they exist +# +ifneq ($(wildcard .depend),) +include .depend +endif diff --git a/libavcodec/libpostproc/mangle.h b/libavcodec/libpostproc/mangle.h new file mode 100644 index 0000000000..5f5dc48499 --- /dev/null +++ b/libavcodec/libpostproc/mangle.h @@ -0,0 +1,19 @@ +/* mangle.h - This file has some CPP macros to deal with different symbol + * mangling across binary formats. + * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net> + * File licensed under the GPL, see http://www.fsf.org/ for more info. + */ + +#ifndef __MANGLE_H +#define __MANGLE_H + +/* Feel free to add more to the list, eg. a.out IMO */ +#if defined(__CYGWIN__) || defined(__OS2__) || \ + (defined(__OpenBSD__) && !defined(__ELF__)) +#define MANGLE(a) "_" #a +#else +#define MANGLE(a) #a +#endif + +#endif /* !__MANGLE_H */ + diff --git a/postproc/postprocess.c b/libavcodec/libpostproc/postprocess.c index e470fd0389..d9261b4b1c 100644 --- a/postproc/postprocess.c +++ b/libavcodec/libpostproc/postprocess.c @@ -75,12 +75,13 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks //#undef HAVE_MMX //#undef ARCH_X86 //#define DEBUG_BRIGHTNESS -#ifndef PIC -#include "../libvo/fastmemcpy.h" +#ifdef USE_FASTMEMCPY +#include "libvo/fastmemcpy.h" #endif #include "postprocess.h" #include "postprocess_internal.h" -#include "mangle.h" + +#include "mangle.h" //FIXME should be supressed #define MIN(a,b) ((a) > (b) ? (b) : (a)) #define MAX(a,b) ((a) < (b) ? (b) : (a)) diff --git a/postproc/postprocess.h b/libavcodec/libpostproc/postprocess.h index c8af1b11b4..c8af1b11b4 100644 --- a/postproc/postprocess.h +++ b/libavcodec/libpostproc/postprocess.h diff --git a/postproc/postprocess_internal.h b/libavcodec/libpostproc/postprocess_internal.h index f45a0cf85b..f45a0cf85b 100644 --- a/postproc/postprocess_internal.h +++ b/libavcodec/libpostproc/postprocess_internal.h diff --git a/postproc/postprocess_template.c b/libavcodec/libpostproc/postprocess_template.c index af48cdcba8..af48cdcba8 100644 --- a/postproc/postprocess_template.c +++ b/libavcodec/libpostproc/postprocess_template.c diff --git a/postproc/Makefile b/postproc/Makefile index 2ef7bbc8cf..a817718f63 100644 --- a/postproc/Makefile +++ b/postproc/Makefile @@ -2,16 +2,9 @@ include ../config.mak SWSLIB = libswscale.a -ifeq ($(SHARED_PP),yes) -SPPLIB = libpostproc.so -SPPVERSION = 0.0.1 -endif -PPLIB = libpostproc.a SWSSRCS=swscale.c rgb2rgb.c yuv2rgb.c SWSOBJS=$(SWSSRCS:.c=.o) -PPOBJS=postprocess.o -SPPOBJS=postprocess_pic.o CS_TEST_OBJS=cs_test.o rgb2rgb.o ../cpudetect.o ../mp_msg.o ../libvo/aclib.o CFLAGS = $(OPTFLAGS) $(MLIB_INC) -I. -I.. $(EXTRA_INC) @@ -24,7 +17,7 @@ CFLAGS = $(OPTFLAGS) $(MLIB_INC) -I. -I.. $(EXTRA_INC) .c.o: $(CC) -c $(CFLAGS) -I.. -o $@ $< -all: $(SWSLIB) $(PPLIB) $(SPPLIB) +all: $(SWSLIB) $(SWSLIB): $(SWSOBJS) $(AR) r $(SWSLIB) $(SWSOBJS) @@ -43,29 +36,6 @@ depend: cs_test: $(CS_TEST_OBJS) $(CC) $(CS_TEST_OBJS) -o cs_test -ifeq ($(SHARED_PP),yes) -postprocess_pic.o: postprocess.c - $(CC) -c $(CFLAGS) -fomit-frame-pointer -fPIC -DPIC -I.. -o $@ $< - -$(SPPLIB): $(SPPOBJS) - $(CC) -shared -Wl,-soname,$(SPPLIB).0 \ - -o $(SPPLIB) $(SPPOBJS) -endif - -$(PPLIB): $(PPOBJS) - $(AR) r $(PPLIB) $(PPOBJS) - -install: all -ifeq ($(SHARED_PP),yes) - install -d $(prefix)/lib - install -s -m 755 $(SPPLIB) $(prefix)/lib/$(SPPLIB).$(SPPVERSION) - ln -sf $(SPPLIB).$(SPPVERSION) $(prefix)/lib/$(SPPLIB) - ldconfig || true - mkdir -p $(prefix)/include/postproc - install -m 644 postprocess.h $(prefix)/include/postproc/postprocess.h -endif - - # # include dependency files if they exist # |