[Ffmpeg-cvslog] r5959 - in trunk: . Makefile configure libavcodec/Makefile libavcodec/imgconvert.c
lucabe
subversion
Tue Aug 8 20:51:39 CEST 2006
Author: lucabe
Date: Tue Aug 8 20:51:38 2006
New Revision: 5959
Modified:
trunk/ (props changed)
trunk/Makefile
trunk/configure
trunk/libavcodec/Makefile
trunk/libavcodec/imgconvert.c
Log:
Enable swscale usage in ffmpeg
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Aug 8 20:51:38 2006
@@ -11,6 +11,10 @@
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
LDFLAGS+= -g
+ifeq ($(CONFIG_SWSCALER),yes)
+CFLAGS := -I$(SRC_PATH)/libswscale $(CFLAGS)
+endif
+
MANPAGES=doc/ffmpeg.1
PROGS_G+=ffmpeg_g$(EXESUF)
PROGS+=ffmpeg$(EXESUF)
@@ -58,6 +62,11 @@
FFLIBDIRS = -L./libavformat -L./libavcodec -L./libavutil
FFLIBS = -lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF)
+ifeq ($(CONFIG_SWSCALER),yes)
+FFLIBDIRS+=-L./libswscale
+FFLIBS+=-lswscale$(BUILDSUF)
+endif
+
all: version.h lib $(PROGS_G) $(PROGS) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
lib:
@@ -67,6 +76,9 @@
ifeq ($(CONFIG_PP),yes)
$(MAKE) -C libpostproc all
endif
+ifeq ($(CONFIG_SWSCALER),yes)
+ $(MAKE) -C libswscale all
+endif
ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
$(CC) $(FFLIBDIRS) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
@@ -141,6 +153,10 @@
ifeq ($(CONFIG_PP),yes)
$(MAKE) -C libpostproc install-libs
endif
+ifeq ($(CONFIG_SWSCALER),yes)
+ $(MAKE) -C libswscale install-libs
+endif
+
ifeq ($(BUILD_SHARED),yes)
-$(LDCONFIG)
endif
@@ -152,6 +168,9 @@
ifeq ($(CONFIG_PP),yes)
$(MAKE) -C libpostproc install-headers
endif
+ifeq ($(CONFIG_SWSCALER),yes)
+ $(MAKE) -C libswscale install-headers
+endif
uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
@@ -202,6 +221,7 @@
$(MAKE) -C libavcodec clean
$(MAKE) -C libavformat clean
$(MAKE) -C libpostproc clean
+ $(MAKE) -C libswscale clean
$(MAKE) -C tests clean
$(MAKE) -C vhook clean
$(MAKE) -C doc clean
@@ -214,6 +234,7 @@
$(MAKE) -C libavcodec distclean
$(MAKE) -C libavformat distclean
$(MAKE) -C libpostproc distclean
+ $(MAKE) -C libswscale distclean
$(MAKE) -C tests distclean
$(MAKE) -C vhook distclean
rm -f .depend version.h config.* *.pc
Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Tue Aug 8 20:51:38 2006
@@ -57,6 +57,7 @@
echo " --enable-pthreads use pthreads [default=no]"
echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
echo " and libraw1394 [default=no]"
+ echo " --enable-swscaler software scaler support [default=no]"
echo " --enable-gpl allow use of GPL code, the resulting libav*"
echo " and ffmpeg will be under GPL [default=no]"
echo ""
@@ -464,6 +465,7 @@
amr_if2="no"
sunmlib="no"
pthreads="no"
+swscaler="no"
gpl="no"
memalignhack="no"
@@ -802,6 +804,8 @@
;;
--enable-pthreads) pthreads="yes"
;;
+ --enable-swscaler) swscaler="yes"
+ ;;
--enable-gpl) gpl="yes"
;;
--enable-memalign-hack) memalignhack="yes"
@@ -963,6 +967,10 @@
fi
fi
+ if test "$swscaler" != "no"; then
+ echo "The software scaler is under GPL and --enable-gpl is not specified."
+ fail="yes"
+ fi
if test "$fail" = "yes"; then
exit 1
@@ -1501,6 +1509,7 @@
echo "a52 dlopened $a52bin"
echo "DTS support $dts"
echo "pp support $pp"
+echo "Software Scaler enabled $swscaler"
echo "debug symbols $debug"
echo "strip symbols $dostrip"
echo "optimize $optimize"
@@ -1718,6 +1727,7 @@
echo "#define HAVE_VHOOK 1" >> $TMPH
fi
+sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
@@ -1737,6 +1747,8 @@
echo "LAVFVERSION=$lavf_version" >> config.mak
echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
echo "LAVUVERSION=$lavu_version" >> config.mak
+ echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
+ echo "SWSVERSION=$sws_version" >> config.mak
echo "SLIBNAME=${SLIBNAME}" >> config.mak
echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
@@ -1791,6 +1803,11 @@
echo "CONFIG_PP=yes" >> config.mak
fi
+if test "$swscaler" = "yes" ; then
+ echo "#define CONFIG_SWSCALER 1" >> $TMPH
+ echo "CONFIG_SWSCALER=yes" >> config.mak
+fi
+
# MPEG audio high precision mode
if test "$mpegaudio_hp" = "yes" ; then
echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
@@ -2011,6 +2028,7 @@
libavcodec/liba52 \
libpostproc \
libavutil \
+ libswscale \
tests \
vhook \
"
@@ -2020,6 +2038,7 @@
libavcodec/Makefile \
libpostproc/Makefile \
libavutil/Makefile \
+ libswscale/Makefile \
tests/Makefile \
vhook/Makefile \
doc/Makefile \
@@ -2219,3 +2238,34 @@
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
Cflags: -I\${includedir}
EOF
+
+# libswscale.pc
+cat <<EOF >libswscale.pc
+prefix=$PREFIX
+exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib
+includedir=\${prefix}/include
+
+Name: libswscale
+Description: FFmpeg image rescaling library
+Version: $sws_version
+Requires: $pkg_requires libavutil = $lavu_version
+Conflicts:
+Libs: -L\${libdir} -lswscale
+Cflags: -I\${includedir} -I\${includedir}/swscale
+EOF
+
+cat <<EOF >libswscale-uninstalled.pc
+prefix=
+exec_prefix=
+libdir=\${pcfiledir}/libswscale
+includedir=\${pcfiledir}/libswscale
+
+Name: libswscale
+Description: FFmpeg image rescaling library
+Version: $sws_version
+Requires: $pkg_requires libavutil = $lavu_version
+Conflicts:
+Libs: \${libdir}/${LIBPREF}swscale${LIBSUF}
+Cflags: -I\${includedir}
+EOF
Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile (original)
+++ trunk/libavcodec/Makefile Tue Aug 8 20:51:38 2006
@@ -11,7 +11,7 @@
OBJS= bitstream.o utils.o allcodecs.o \
mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
mjpeg.o resample.o resample2.o dsputil.o \
- motion_est.o imgconvert.o imgresample.o \
+ motion_est.o imgconvert.o \
mpeg12.o mpegaudiodec.o simple_idct.o \
ratecontrol.o eval.o error_resilience.o \
fft.o mdct.o raw.o golomb.o cabac.o\
@@ -22,6 +22,9 @@
HEADERS = avcodec.h
+ifneq ($(CONFIG_SWSCALER),yes)
+HEADERS += swscale.h
+endif
OBJS-$(CONFIG_AASC_DECODER) += aasc.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o
@@ -277,6 +280,10 @@
OBJS-$(HAVE_XVMC_ACCEL) += xvmcvideo.o
+ifneq ($(CONFIG_SWSCALER),yes)
+OBJS += imgresample.o
+endif
+
# i386 mmx specific stuff
ifeq ($(TARGET_MMX),yes)
OBJS += i386/fdct_mmx.o i386/cputest.o \
Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c (original)
+++ trunk/libavcodec/imgconvert.c Tue Aug 8 20:51:38 2006
@@ -2048,6 +2048,7 @@
return 0;
}
+#ifndef CONFIG_SWSCALER
/* XXX: always use linesize. Return -1 if not supported */
int img_convert(AVPicture *dst, int dst_pix_fmt,
const AVPicture *src, int src_pix_fmt,
@@ -2289,6 +2290,7 @@
avpicture_free(tmp);
return ret;
}
+#endif
/* NOTE: we scan all the pixels to have an exact information */
static int get_alpha_info_pal8(const AVPicture *src, int width, int height)
More information about the ffmpeg-cvslog
mailing list