diffstat for xvidcore-1.3.5 xvidcore-1.3.2 ChangeLog | 229 - README | 11 build/generic/Makefile | 25 build/generic/config.guess | 411 +- build/generic/config.sub | 243 - build/generic/configure | 729 +--- build/generic/configure.in | 130 build/generic/install-sh | 29 build/generic/missing | 376 ++ build/generic/platform.inc.in | 5 build/win32/libxvidcore.vcproj | 43 debian/changelog | 497 +-- debian/clean | 1 debian/compat | 2 debian/control | 48 debian/copyright | 106 debian/gbp.conf | 3 debian/install | 1 debian/libxvidcore-dev.install | 5 debian/libxvidcore4.install | 1 debian/libxvidcore4.symbols | 12 debian/rules | 47 debian/source/format | 1 debian/watch | 7 dshow/src/CXvidDecoder.cpp | 4799 +++++++++++++++---------------- dshow/src/CXvidDecoder.h | 23 dshow/src/config.c | 593 +-- dshow/src/config.h | 7 dshow/src/resource.h | 85 dshow/src/xvid.ax.rc | 7 dshow/src/xvid.ico |binary examples/Makefile | 9 examples/xvid_encraw.c | 459 +- src/decoder.c | 12 src/encoder.c | 4 src/global.h | 6 src/image/x86_asm/colorspace_rgb_mmx.asm | 22 src/motion/estimation_bvop.c | 28 src/plugins/plugin_lumimasking.c | 2 src/portab.h | 13 src/utils/mbtransquant.c | 4 src/xvid.c | 10 src/xvid.h | 8 vfw/src/codec.c | 13 44 files changed, 4226 insertions(+), 4840 deletions(-) diff -Nru xvidcore-1.3.5/ChangeLog xvidcore-1.3.2/ChangeLog --- xvidcore-1.3.5/ChangeLog 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/ChangeLog 2011-05-21 16:55:38.000000000 +0000 @@ -1,231 +1,4 @@ -# Note that this ChangeLog covers only main changes to the release branch - -2017-07-12 08:23 Isibaar - * xvidcore/vfw/src/codec.c: Re-add support to decode raw YV12 - input FourCC video - -2017-01-27 13:43 Isibaar - * xvidcore/dshow/src/CXvidDecoder.cpp: Fix output buffer stride - calculation in MFT - -2016-10-18 22:01 Isibaar - * xvidcore/src/portab.h: AmigaOS patch by Fredrik Wikstrom. - -2016-10-18 22:01 Isibaar - * xvidcore/build/generic/configure.in: AmigaOS patch by Fredrik - Wikstrom. - -2016-09-27 15:39 Isibaar - * xvidcore/vfw/src/codec.c: Debug output only when debug option - enabled. - -2016-01-12 13:55 Isibaar - * xvidcore/dshow/src/CXvidDecoder.cpp: MFT pixel aspect ratio - - backport from HEAD - -2016-01-11 17:02 Isibaar - * xvidcore/dshow/src/CXvidDecoder.cpp: Setting interlaced flag - on output pins - backport from HEAD - -2016-01-08 17:44 Isibaar - * xvidcore/dshow/src/CXvidDecoder.cpp - xvidcore/dshow/src/CXvidDecoder.h: Set interlacing flags in - VIDEOINFOHEADER2 struct of output pin - -2016-01-08 17:40 Isibaar - * xvidcore/src/decoder.c - xvidcore/src/xvid.c - xvidcore/src/xvid.h: Set interlacing flags in decoder - -2015-07-08 17:32 Isibaar - * xvidcore/examples/xvid_encraw.c: Making the applevel - multithreading work also for AVI output - -2015-06-14 21:18 Isibaar - * xvidcore/dshow/src/CXvidDecoder.cpp - xvidcore/dshow/src/CXvidDecoder.h - xvidcore/dshow/src/config.c - xvidcore/dshow/src/config.h: Fixed thumbnail creation under - Windows 10, faster rendering in MediaFoundation, various other - MFT-specific fixes... - -2015-06-11 02:51 Isibaar - * xvidcore/src/image/x86_asm/colorspace_rgb_mmx.asm: Attempt at - fixing a crash in RGB24->YV12 conversions - not yet really - tested... - -2015-06-08 21:15 Isibaar - * xvidcore/dshow/src/CXvidDecoder.cpp - xvidcore/dshow/src/CXvidDecoder.h: Changed friendly name of - MFT to match common conventions. - -2014-11-26 00:17 Isibaar - * xvidcore/src/encoder.c: Fix for multi-threading bug in case of - input video height <= 16 pixels. Patch by Lukasz Marek. - -2014-09-25 19:41 Isibaar - - * xvidcore/build/win32/libxvidcore.vcproj: Enabled multi-threaded - builds in MSVC by default - -2014-03-05 08:37 Isibaar - - * xvidcore/examples/xvid_encraw.c: Help info about zones usage and - various fixes for compiler warnings - Patch by Elio Blanca - -2014-02-11 14:48 Isibaar - - * xvidcore/examples/xvid_encraw.c: Improved help texts and defaults - handling. Patch by Elio Blanca. - -2014-02-09 16:51 Isibaar - - * xvidcore/examples/Makefile, xvidcore/examples/xvid_encraw.c: - Better environment detection for Makefile - Patch by Elio Blanca - -2014-02-07 16:00 Isibaar - - * xvidcore/examples/xvid_encraw.c: Fix out of bound access to - framestats struct. Thanks to Elio Blanca. - -2013-02-18 16:24 Isibaar - - * xvidcore/build/generic/configure.in: bring version number in - configure.in in sync with rest of code - -2013-01-29 19:12 Isibaar - - * xvidcore/build/generic/configure.in: Patch for QNX support by - Mike Gorchak - -2012-10-04 14:26 Isibaar - - * xvidcore/build/generic/configure.in: remove obsolete - '-mno-cygwin' option for gcc version >= 4 - -2012-06-21 09:55 Isibaar - - * xvidcore/examples/xvid_encraw.c: Fixed bug in PGM header parser - - thanks to Jim Bennett! - -2012-02-22 19:00 Isibaar - - * xvidcore/dshow/src/CXvidDecoder.cpp, - xvidcore/dshow/src/CXvidDecoder.h, xvidcore/dshow/src/config.c, - xvidcore/dshow/src/config.h, xvidcore/dshow/src/resource.h, - xvidcore/dshow/src/xvid.ax.rc: Ported tray icon patch from HEAD - branch - -2011-12-30 13:04 Isibaar - - * xvidcore/src/global.h: #define MIN/MAX macros only when not yet - otherwise defined... - -2011-11-09 14:12 Isibaar - - * xvidcore/src/plugins/plugin_lumimasking.c: Reverted change to - max_quant calculation. Users prefer the former behavior... - -2011-11-04 15:23 Isibaar - - * xvidcore/src/utils/mbtransquant.c, xvidcore/src/xvid.c, - xvidcore/src/xvid.h: Fix for possible overflow in trellis - quant... - -2011-10-25 10:57 Isibaar - - * xvidcore/src/xvid.c, xvidcore/src/xvid.h: Ramp up version - number... - -2011-10-25 10:53 Isibaar - - * xvidcore/src/motion/estimation_bvop.c: Fix for encoder crash that - is possible with the following combination of encoder options: - Turbo, VHQ for B-VOPs and Qpel... - -2011-10-06 18:05 Isibaar - - * xvidcore/src/plugins/plugin_lumimasking.c: Make sure max_quant is - at least frame_quant+2 for lumi/variance masking - -2011-09-19 09:32 Isibaar - - * xvidcore/build/generic/Makefile, - xvidcore/build/generic/configure.in, - xvidcore/build/generic/platform.inc.in: Install symlinks for - shared library. Patch by Andres Mejia. - -2011-09-19 08:18 Isibaar - - * xvidcore/build/generic/configure.in: Remove rhapsody OS case. - Patch by Ryan Schmidt. - -2011-09-16 12:34 Isibaar - - * xvidcore/build/generic/configure.in: Double check for pthread on - MinGW. Patch by Motofumi Oka. - -2011-09-15 10:36 Isibaar - - * xvidcore/build/generic/Makefile, - xvidcore/build/generic/platform.inc.in: install xvidcore.dll to - under Cygwin. Patch by Motofumi Oka. - -2011-09-15 09:34 Isibaar - - * xvidcore/build/generic/configure.in: Try to autodetect name - mangling variations for WIN64 cross-compiling. Patch by Motofumi - Oka. - -2011-09-14 15:08 Isibaar - - * xvidcore/build/generic/configure.in: removed obsolete -mno-cygwin - -2011-09-14 10:45 Isibaar - - * xvidcore/build/generic/configure.in: platform-independent gcc - versio check - patch by Motofumi Oka - -2011-08-19 16:20 Isibaar - - * xvidcore/build/generic/configure.in, - xvidcore/build/generic/platform.inc.in: User-supplied LDFLAGS. - Patch by Ryan Schmidt and the MacPorts project. - -2011-07-28 07:48 Isibaar - - * xvidcore/build/generic/configure.in: Added support for GNU Hurd - as target_os - -2011-05-23 07:47 Isibaar - - * xvidcore/src/xvid.c: removed deprecated call to idct_int32_init() - -2011-05-21 16:55 Isibaar - - * xvidcore/ChangeLog: Updated ChangeLog - -2011-05-19 12:48 Isibaar - - * xvidcore/dshow/src/CAbout.cpp, - xvidcore/dshow/src/CXvidDecoder.cpp, - xvidcore/dshow/src/Configure.cpp: autoprops property set also for - .cpp files - -2011-05-19 12:24 Isibaar - - * xvidcore/dshow/src/CXvidDecoder.cpp: Added #ifdef ENABLE_MFT - check - -2011-05-19 12:23 Isibaar - - * xvidcore/dshow/dshow.vcproj: Added special configurations for - MFT-enabled builds - -2011-05-19 08:27 Isibaar - - * xvidcore/build/generic/Makefile: Don't include platform.inc on - make clean - Patch by Fabian Greffrath +# Note that this ChangeLog covers only changes to the release branch 2011-05-18 16:13 Isibaar diff -Nru xvidcore-1.3.5/README xvidcore-1.3.2/README --- xvidcore-1.3.5/README 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/README 2010-12-22 16:52:52.000000000 +0000 @@ -4,14 +4,13 @@ Xvid is a high performance and high quality MPEG-4 video de-/encoding solution. -The Xvid package currently consists of four parts: +The Xvid package currently consists of three parts: -- xvidcore: the main MPEG-4 de-/encoding library. - -- examples: xvid_decraw and xvid_encraw de-/encoder example programs. +- xvidcore: the main MPEG-4 de-/encoding library, and simple example + programs - dshow: windows direct show decoder filter which links against xvidcore to allow MPEG-4 playback on Windows based OS. -- vfw: video for windows GUI. +- vfw: video for windows GUI 2) Documentation @@ -25,6 +24,6 @@ ------------ - Xvid is licensed as a whole under the terms of the Xvid license - described in the file LICENSE. This is true for all files belonging + described in the file LICENSE This is true for all files belonging to Xvid except for those which specifically carry a different license header. \ No newline at end of file diff -Nru xvidcore-1.3.5/build/generic/Makefile xvidcore-1.3.2/build/generic/Makefile --- xvidcore-1.3.5/build/generic/Makefile 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/Makefile 2011-05-19 08:27:26.000000000 +0000 @@ -141,29 +141,16 @@ #----------------------------------------------------------------------------- install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB) - @echo " D: $(includedir)" - @$(INSTALL) -d $(DESTDIR)$(includedir) - @echo " I: $(includedir)/xvid.h" - @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h @echo " D: $(libdir)" @$(INSTALL) -d $(DESTDIR)$(libdir) - @echo " I: $(libdir)/$(STATIC_LIB)" - @$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB) -ifeq ($(SHARED_EXTENSION),dll) - @echo " I: $(libdir)/$(SHARED_LIB).a" - @$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB).a $(DESTDIR)$(libdir)/$(SHARED_LIB).a - @echo " D: $(bindir)" - @$(INSTALL) -d $(DESTDIR)$(bindir) - @echo " I: $(bindir)/$(SHARED_LIB)" - @$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(bindir)/$(SHARED_LIB) -else @echo " I: $(libdir)/$(SHARED_LIB)" @$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB) - @test -z "$(SO_API_MAJOR_LINK)" || \ - $(LN_S) $(SHARED_LIB) $(DESTDIR)$(libdir)/$(SO_API_MAJOR_LINK) - @test -z "$(SO_LINK)" || \ - $(LN_S) $(SHARED_LIB) $(DESTDIR)$(libdir)/$(SO_LINK) -endif + @echo " I: $(libdir)/$(STATIC_LIB)" + @$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB) + @echo " D: $(includedir)" + @$(INSTALL) -d $(DESTDIR)$(includedir) + @echo " I: $(includedir)/xvid.h" + @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h #----------------------------------------------------------------------------- # Platorm specific file -- dumb rules for people executing make before diff -Nru xvidcore-1.3.5/build/generic/config.guess xvidcore-1.3.2/build/generic/config.guess --- xvidcore-1.3.5/build/generic/config.guess 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/config.guess 2011-05-23 10:23:48.000000000 +0000 @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2010-08-21' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,22 +17,26 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # -# Originally written by Per Bothner. +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +56,9 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +92,7 @@ exit 1 fi -trap 'exit 1' 1 2 15 +trap 'exit 1' HUP INT TERM # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -98,7 +106,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -132,33 +140,12 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - ;; -esac - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -194,7 +181,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -215,10 +202,6 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -241,7 +224,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -287,10 +270,7 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -316,12 +296,12 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) + arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -415,23 +395,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -501,8 +481,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -515,7 +495,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -615,52 +595,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include + sed 's/^ //' << EOF >$dummy.c - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -751,22 +731,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -790,14 +770,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -809,35 +789,30 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -874,22 +849,15 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -899,56 +867,52 @@ EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi + echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -967,63 +931,54 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-tilera-linux-gnu exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1032,11 +987,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1068,7 +1023,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1096,13 +1051,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1137,8 +1092,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1181,10 +1136,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1210,11 +1165,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1227,9 +1182,6 @@ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1256,21 +1208,19 @@ exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1284,10 +1234,7 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) + NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1332,13 +1279,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1356,11 +1303,11 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; esac +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + eval $set_cc_for_build cat >$dummy.c < printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru xvidcore-1.3.5/build/generic/config.sub xvidcore-1.3.2/build/generic/config.sub --- xvidcore-1.3.5/build/generic/config.sub 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/config.sub 2011-05-23 10:23:45.000000000 +0000 @@ -1,31 +1,38 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-04-24' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. + +timestamp='2010-09-11' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). +# the same distribution terms that you use for the rest of that program. -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +75,9 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -116,17 +125,13 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -149,12 +154,12 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -170,10 +175,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -218,12 +223,6 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; -lynx*) os=-lynxos ;; @@ -248,27 +247,20 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -286,32 +278,30 @@ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ + | nios | nios2 \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | rl78 | rx \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | v850 | v850e \ | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -324,7 +314,8 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; @@ -334,21 +325,6 @@ basic_machine=mt-unknown ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -363,13 +339,11 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ - | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ - | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -378,15 +352,12 @@ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -404,34 +375,31 @@ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ + | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ + | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -456,7 +424,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -539,7 +507,7 @@ basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -571,7 +539,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16 | cr16-*) + cr16) basic_machine=cr16-unknown os=-elf ;; @@ -729,6 +697,7 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -786,13 +755,9 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze*) + microblaze) basic_machine=microblaze-xilinx ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -829,18 +794,10 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; - msys) - basic_machine=i386-pc - os=-msys - ;; mvs) basic_machine=i370-ibm os=-mvs ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -905,10 +862,10 @@ np1) basic_machine=np1-gould ;; - neo-tandem) + neo-tandem) basic_machine=neo-tandem ;; - nse-tandem) + nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) @@ -993,10 +950,9 @@ ;; power) basic_machine=power-ibm ;; - ppc | ppcbe) basic_machine=powerpc-unknown + ppc) basic_machine=powerpc-unknown ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1006,7 +962,7 @@ ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown @@ -1021,11 +977,7 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) + rdos) basic_machine=i386-pc os=-rdos ;; @@ -1094,9 +1046,6 @@ basic_machine=i860-stratus os=-sysv4 ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; sun2) basic_machine=m68000-sun ;; @@ -1153,8 +1102,13 @@ basic_machine=t90-cray os=-unicos ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; tile*) - basic_machine=$basic_machine-unknown + basic_machine=tile-unknown os=-linux-gnu ;; tx39) @@ -1224,9 +1178,6 @@ xps | xps100) basic_machine=xps100-honeywell ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1324,11 +1275,11 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1352,21 +1303,21 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1413,7 +1364,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1462,7 +1413,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1498,14 +1449,17 @@ -aros*) os=-aros ;; + -kaos*) + os=-kaos + ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1528,10 +1482,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1543,11 +1497,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; - hexagon-*) - os=-elf + c4x-* | tic4x-*) + os=-coff ;; tic54x-*) os=-coff @@ -1576,11 +1527,14 @@ ;; m68000-sun) os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1589,9 +1543,6 @@ mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; @@ -1610,7 +1561,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff -Nru xvidcore-1.3.5/build/generic/configure xvidcore-1.3.2/build/generic/configure --- xvidcore-1.3.5/build/generic/configure 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/configure 2011-05-23 10:22:01.000000000 +0000 @@ -1,11 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Xvid 1.3.5. +# Generated by GNU Autoconf 2.68 for Xvid 1.3.2. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,31 +136,6 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -192,8 +169,7 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" +test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -238,25 +214,21 @@ if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -359,14 +331,6 @@ } # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -488,10 +452,6 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -526,16 +486,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' + as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -547,8 +507,28 @@ as_mkdir_p=false fi -as_test_x='test -x' -as_executable_p=as_fn_executable_p +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -580,8 +560,8 @@ # Identity of this package. PACKAGE_NAME='Xvid' PACKAGE_TARNAME='xvid' -PACKAGE_VERSION='1.3.5' -PACKAGE_STRING='Xvid 1.3.5' +PACKAGE_VERSION='1.3.2' +PACKAGE_STRING='Xvid 1.3.2' PACKAGE_BUGREPORT='xvid-devel@xvid.org' PACKAGE_URL='' @@ -627,8 +607,6 @@ LIBOBJS ALTIVEC_CFLAGS SHARED_LIB -SO_LINK -SO_API_MAJOR_LINK PRE_SHARED_LIB STATIC_LIB API_MINOR @@ -652,10 +630,9 @@ FEATURES ac_nasm ac_yasm -CPP -LN_S EGREP GREP +CPP AR RANLIB INSTALL_DATA @@ -1192,6 +1169,8 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1277,7 +1256,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Xvid 1.3.5 to adapt to many kinds of systems. +\`configure' configures Xvid 1.3.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1343,7 +1322,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Xvid 1.3.5:";; + short | recursive ) echo "Configuration of Xvid 1.3.2:";; esac cat <<\_ACEOF @@ -1434,10 +1413,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Xvid configure 1.3.5 -generated by GNU Autoconf 2.69 +Xvid configure 1.3.2 +generated by GNU Autoconf 2.68 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1545,8 +1524,7 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; @@ -1562,8 +1540,7 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; @@ -1589,8 +1566,7 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; @@ -1606,8 +1582,7 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; @@ -1641,8 +1616,7 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; @@ -1897,7 +1871,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - test -x conftest$ac_exeext + $as_test_x conftest$ac_exeext }; then : ac_retval=0 else @@ -1919,8 +1893,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Xvid $as_me 1.3.5, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by Xvid $as_me 1.3.2, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2530,7 +2504,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2570,7 +2544,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2623,7 +2597,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2664,7 +2638,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2722,7 +2696,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2766,7 +2740,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3212,7 +3186,8 @@ /* end confdefs.h. */ #include #include -struct stat; +#include +#include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3336,7 +3311,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -3411,7 +3386,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3451,7 +3426,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3503,7 +3478,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3543,7 +3518,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3580,151 +3555,6 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - - - ARCHITECTURE="" @@ -3909,6 +3739,136 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : @@ -4316,7 +4276,7 @@ STATIC_EXTENSION="" OBJECT_EXTENSION="" case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*|gnu*|*qnx*) + *bsd*|linux*|beos|irix*|solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: .so .a .o" >&5 $as_echo ".so .a .o" >&6; } STATIC_EXTENSION="a" @@ -4330,7 +4290,7 @@ SHARED_EXTENSION="dll" OBJECT_EXTENSION="obj" ;; - darwin*) + darwin*|raphsody*) if test x"$macosx_module" = x"yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: .so .a .o" >&5 $as_echo ".so .a .o" >&6; } @@ -4343,13 +4303,6 @@ STATIC_EXTENSION="a" OBJECT_EXTENSION="o" ;; - amigaos) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: .so .a .o" >&5 - $as_echo ".so .a .o" >&6; } - STATIC_EXTENSION="a" - SHARED_EXTENSION="so" - OBJECT_EXTENSION="o" - ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown OS - Using .so .a .o" >&5 $as_echo "Unknown OS - Using .so .a .o" >&6; } @@ -4366,16 +4319,12 @@ SPECIFIC_CFLAGS="" ALTIVEC_CFLAGS="" PRE_SHARED_LIB="" -SO_API_MAJOR_LINK="" -SO_LINK="" case "$target_os" in - linux*|solaris*|gnu*|*qnx*) + linux*|solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" - SO_API_MAJOR_LINK="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR)" - SO_LINK="libxvidcore.\$(SHARED_EXTENSION)" SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -Wl,--version-script=libxvidcore.ld -lc -lm" SPECIFIC_CFLAGS="-fPIC" ;; @@ -4384,8 +4333,6 @@ $as_echo "ok" >&6; } STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" - SO_API_MAJOR_LINK="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR)" - SO_LINK="libxvidcore.\$(SHARED_EXTENSION)" SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -lc -lm" SPECIFIC_CFLAGS="-fPIC" ;; @@ -4394,10 +4341,10 @@ $as_echo "ok" >&6; } STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" - SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" + SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" SPECIFIC_CFLAGS="-mno-cygwin" ;; - darwin*) + darwin*|raphsody*) STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SPECIFIC_CFLAGS="-fPIC -fno-common -no-cpp-precomp" if test x"$macosx_module" = x"no"; then @@ -4421,16 +4368,6 @@ SPECIFIC_LDFLAGS="-nostart" SPECIFIC_CFLAGS="-fPIC" ;; - amigaos) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 - $as_echo "ok" >&6; } - STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" - SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" - SO_API_MAJOR_LINK="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR)" - SO_LINK="libxvidcore.\$(SHARED_EXTENSION)" - SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -lc -lm" - SPECIFIC_CFLAGS="-fPIC" - ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown Platform (Using default -shared -lc -lm)" >&5 $as_echo "Unknown Platform (Using default -shared -lc -lm)" >&6; } @@ -4476,7 +4413,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "yes"; then ac_prog_rejected=yes continue @@ -4551,7 +4488,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "yes"; then ac_prog_rejected=yes continue @@ -4617,7 +4554,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asm object format" >&5 $as_echo_n "checking for asm object format... " >&6; } case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*|gnu*|*qnx*) + *bsd*|linux*|beos|irix*|solaris*) if test "$ARCHITECTURE" = "X86_64" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: elf64" >&5 $as_echo "elf64" >&6; } @@ -4640,16 +4577,8 @@ $as_echo "win32" >&6; } NASM_FORMAT="win32" fi - PREFIX="-DWINDOWS" - if test "$GCC" = "yes" ; then - echo 'int main(void) {return 0;}' > conftest.c - $CC -S -o conftest conftest.c - if test `$EGREP -c '_main:' conftest` -eq 0 ; then - PREFIX="$PREFIX -DNO_PREFIX" - fi - rm -f conftest* - fi - MARK_FUNCS="" + PREFIX="-DWINDOWS" + MARK_FUNCS="" ;; *darwin*) if test "$ARCHITECTURE" = "X86_64" ; then @@ -4802,105 +4731,7 @@ if test x"$pthread" = x"yes" ; then - case "$target_os" in - mingw32*) - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreadGC2" >&5 -$as_echo_n "checking for pthread_create in -lpthreadGC2... " >&6; } -if ${ac_cv_lib_pthreadGC2_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthreadGC2 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int -main () -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthreadGC2_pthread_create=yes -else - ac_cv_lib_pthreadGC2_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreadGC2_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthreadGC2_pthread_create" >&6; } -if test "x$ac_cv_lib_pthreadGC2_pthread_create" = xyes; then : - SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthreadGC2" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int -main () -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes -else - ac_cv_lib_pthread_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Pthread not supported. No SMP support" >&5 -$as_echo "$as_me: WARNING: Pthread not supported. No SMP support" >&2;} -fi - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Pthread not supported. No SMP support" >&5 -$as_echo "$as_me: WARNING: Pthread not supported. No SMP support" >&2;} -fi - - - ;; - *) - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } @@ -4940,62 +4771,18 @@ $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc" >&5 -$as_echo_n "checking for pthread_create in -lc... " >&6; } -if ${ac_cv_lib_c_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); -int -main () -{ -return pthread_create (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_pthread_create=yes -else - ac_cv_lib_c_pthread_create=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_create" >&5 -$as_echo "$ac_cv_lib_c_pthread_create" >&6; } -if test "x$ac_cv_lib_c_pthread_create" = xyes; then : - SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS" + SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Pthread not supported. No SMP support" >&5 $as_echo "$as_me: WARNING: Pthread not supported. No SMP support" >&2;} fi -fi - else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Pthread not supported. No SMP support" >&5 $as_echo "$as_me: WARNING: Pthread not supported. No SMP support" >&2;} fi - ;; - esac else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Pthread support disabled. No SMP support" >&5 $as_echo "$as_me: WARNING: Pthread support disabled. No SMP support" >&2;} @@ -5016,9 +4803,26 @@ if test "$GCC" = "yes" ; then +cat << EOF > test.c +#include +int main(int argc, char **argv) +{ + if (*argv[1] == 'M') { + printf("%d", __GNUC__); + } + if (*argv[1] == 'm') { + printf("%d", __GNUC_MINOR__); + } + return 0; +} +EOF + $CC -o gcc-ver test.c - GCC_MAJOR=`$CC -dumpversion | cut -d . -f 1` - GCC_MINOR=`$CC -dumpversion | cut -d . -f 2` + GCC_MAJOR=`./gcc-ver M` + GCC_MINOR=`./gcc-ver m` + + rm -f test.c + rm -f gcc-ver # GCC 4.x if test "${GCC_MAJOR}" -gt 3 ; then @@ -5027,7 +4831,6 @@ CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g` CFLAGS=`echo $CFLAGS | sed s,'-fnew-ra','',g` CFLAGS=`echo $CFLAGS | sed s,'-fwritable-strings','',g` - SPECIFIC_CFLAGS=`echo $SPECIFIC_CFLAGS | sed s,'-mno-cygwin','',g` fi # GCC 3.4.x @@ -5067,10 +4870,6 @@ - - - - ac_config_files="$ac_config_files platform.inc" @@ -5518,16 +5317,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' + as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5587,16 +5386,28 @@ as_mkdir_p=false fi - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -5617,8 +5428,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Xvid $as_me 1.3.5, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by Xvid $as_me 1.3.2, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5670,11 +5481,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Xvid config.status 1.3.5 -configured by $0, generated by GNU Autoconf 2.69, +Xvid config.status 1.3.2 +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5752,7 +5563,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff -Nru xvidcore-1.3.5/build/generic/configure.in xvidcore-1.3.2/build/generic/configure.in --- xvidcore-1.3.5/build/generic/configure.in 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/configure.in 2011-05-18 07:59:28.000000000 +0000 @@ -8,7 +8,7 @@ AC_PREREQ([2.50]) -AC_INIT([Xvid], [1.3.5], [xvid-devel@xvid.org]) +AC_INIT([Xvid], [1.3.2], [xvid-devel@xvid.org]) AC_CONFIG_SRCDIR(configure.in) dnl Do not forget to increase that when needed. @@ -144,18 +144,6 @@ AC_CHECK_TOOL([AR], [ar], [ar-not-found]) dnl ========================================================================== -dnl Check for the egrep program -dnl ========================================================================== - -AC_PROG_EGREP - -dnl ========================================================================== -dnl Check how the system supports symlinks. -dnl ========================================================================== - -AC_PROG_LN_S - -dnl ========================================================================== dnl dnl This part looks for: dnl @@ -249,7 +237,7 @@ STATIC_EXTENSION="" OBJECT_EXTENSION="" case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*|gnu*|*qnx*) + *bsd*|linux*|beos|irix*|solaris*) AC_MSG_RESULT([.so .a .o]) STATIC_EXTENSION="a" SHARED_EXTENSION="so" @@ -261,7 +249,7 @@ SHARED_EXTENSION="dll" OBJECT_EXTENSION="obj" ;; - darwin*) + darwin*|raphsody*) if test x"$macosx_module" = x"yes"; then AC_MSG_RESULT([.so .a .o]) SHARED_EXTENSION="so" @@ -272,13 +260,6 @@ STATIC_EXTENSION="a" OBJECT_EXTENSION="o" ;; - amigaos) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: .so .a .o" >&5 - $as_echo ".so .a .o" >&6; } - STATIC_EXTENSION="a" - SHARED_EXTENSION="so" - OBJECT_EXTENSION="o" - ;; *) AC_MSG_RESULT([Unknown OS - Using .so .a .o]) STATIC_EXTENSION="a" @@ -299,15 +280,11 @@ SPECIFIC_CFLAGS="" ALTIVEC_CFLAGS="" PRE_SHARED_LIB="" -SO_API_MAJOR_LINK="" -SO_LINK="" case "$target_os" in - linux*|solaris*|gnu*|*qnx*) + linux*|solaris*) AC_MSG_RESULT([ok]) STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" - SO_API_MAJOR_LINK="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR)" - SO_LINK="libxvidcore.\$(SHARED_EXTENSION)" SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -Wl,--version-script=libxvidcore.ld -lc -lm" SPECIFIC_CFLAGS="-fPIC" ;; @@ -315,8 +292,6 @@ AC_MSG_RESULT([ok]) STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" - SO_API_MAJOR_LINK="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR)" - SO_LINK="libxvidcore.\$(SHARED_EXTENSION)" SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -lc -lm" SPECIFIC_CFLAGS="-fPIC" ;; @@ -324,10 +299,10 @@ AC_MSG_RESULT([ok]) STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" - SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" + SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" SPECIFIC_CFLAGS="-mno-cygwin" ;; - darwin*) + darwin*|raphsody*) STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SPECIFIC_CFLAGS="-fPIC -fno-common -no-cpp-precomp" if test x"$macosx_module" = x"no"; then @@ -348,16 +323,6 @@ SPECIFIC_LDFLAGS="-nostart" SPECIFIC_CFLAGS="-fPIC" ;; - amigaos) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 - $as_echo "ok" >&6; } - STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" - SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" - SO_API_MAJOR_LINK="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR)" - SO_LINK="libxvidcore.\$(SHARED_EXTENSION)" - SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -lc -lm" - SPECIFIC_CFLAGS="-fPIC" - ;; *) AC_MSG_RESULT([Unknown Platform (Using default -shared -lc -lm)]) STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" @@ -454,7 +419,7 @@ if test "$found_nasm_comp_prog" = "yes" ; then AC_MSG_CHECKING([for asm object format]) case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*|gnu*|*qnx*) + *bsd*|linux*|beos|irix*|solaris*) if test "$ARCHITECTURE" = "X86_64" ; then AC_MSG_RESULT([elf64]) NASM_FORMAT="elf64" @@ -473,16 +438,8 @@ AC_MSG_RESULT([win32]) NASM_FORMAT="win32" fi - PREFIX="-DWINDOWS" - if test "$GCC" = "yes" ; then - echo 'int main(void) {return 0;}' > conftest.c - $CC -S -o conftest conftest.c - if test `$EGREP -c '_main:' conftest` -eq 0 ; then - PREFIX="$PREFIX -DNO_PREFIX" - fi - rm -f conftest* - fi - MARK_FUNCS="" + PREFIX="-DWINDOWS" + MARK_FUNCS="" ;; *darwin*) if test "$ARCHITECTURE" = "X86_64" ; then @@ -649,40 +606,15 @@ dnl ========================================================================== if test x"$pthread" = x"yes" ; then - case "$target_os" in - mingw32*) - AC_CHECK_HEADER( - [pthread.h], - [AC_CHECK_LIB( - [pthreadGC2], - [pthread_create], - [SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthreadGC2"], - [AC_CHECK_LIB( - [pthread], - [pthread_create], - [SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread"], - AC_MSG_WARN(Pthread not supported. No SMP support))])], - AC_MSG_WARN(Pthread not supported. No SMP support)) - ;; - *) - AC_CHECK_HEADER( - [pthread.h], - [AC_CHECK_LIB( - [pthread], - [pthread_create], - [SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread"], - [AC_CHECK_LIB( - [c], - [pthread_create], - [SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS"], - AC_MSG_WARN(Pthread not supported. No SMP support))])], - AC_MSG_WARN(Pthread not supported. No SMP support)) - ;; - esac + AC_CHECK_HEADER( + [pthread.h], + [AC_CHECK_LIB( + [pthread], + [pthread_create], + [SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" + SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread"], + AC_MSG_WARN(Pthread not supported. No SMP support))], + AC_MSG_WARN(Pthread not supported. No SMP support)) else AC_MSG_WARN(Pthread support disabled. No SMP support) fi @@ -717,9 +649,26 @@ dnl ========================================================================== if test "$GCC" = "yes" ; then +cat << EOF > test.c +#include +int main(int argc, char **argv) +{ + if (*argv[[1]] == 'M') { + printf("%d", __GNUC__); + } + if (*argv[[1]] == 'm') { + printf("%d", __GNUC_MINOR__); + } + return 0; +} +EOF + $CC -o gcc-ver test.c + + GCC_MAJOR=`./gcc-ver M` + GCC_MINOR=`./gcc-ver m` - GCC_MAJOR=`$CC -dumpversion | cut -d . -f 1` - GCC_MINOR=`$CC -dumpversion | cut -d . -f 2` + rm -f test.c + rm -f gcc-ver # GCC 4.x if test "${GCC_MAJOR}" -gt 3 ; then @@ -728,7 +677,6 @@ CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g` CFLAGS=`echo $CFLAGS | sed s,'-fnew-ra','',g` CFLAGS=`echo $CFLAGS | sed s,'-fwritable-strings','',g` - SPECIFIC_CFLAGS=`echo $SPECIFIC_CFLAGS | sed s,'-mno-cygwin','',g` fi # GCC 3.4.x @@ -759,20 +707,16 @@ AC_SUBST(ASSEMBLY_SOURCES) AC_SUBST(CC) AC_SUBST(CFLAGS) -AC_SUBST(LDFLAGS) AC_SUBST(SPECIFIC_LDFLAGS) AC_SUBST(SPECIFIC_CFLAGS) AC_SUBST(DCT_IA64_SOURCES) AC_SUBST(PPC_ALTIVEC_SOURCES) -AC_SUBST(LN_S) AC_SUBST(RANLIB) AC_SUBST(AR) AC_SUBST(API_MAJOR) AC_SUBST(API_MINOR) AC_SUBST(STATIC_LIB) AC_SUBST(PRE_SHARED_LIB) -AC_SUBST(SO_API_MAJOR_LINK) -AC_SUBST(SO_LINK) AC_SUBST(SHARED_LIB) AC_SUBST(ALTIVEC_CFLAGS) diff -Nru xvidcore-1.3.5/build/generic/install-sh xvidcore-1.3.2/build/generic/install-sh --- xvidcore-1.3.5/build/generic/install-sh 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/install-sh 2011-05-23 10:27:09.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2010-02-06.18; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it +# `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,10 +156,6 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -202,7 +194,7 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call 'install-sh -d' without argument. + # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,9 +232,9 @@ for src do - # Protect names problematic for 'test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +256,12 @@ echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -354,7 +351,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. + # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -392,7 +389,7 @@ case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +407,7 @@ for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru xvidcore-1.3.5/build/generic/missing xvidcore-1.3.2/build/generic/missing --- xvidcore-1.3.5/build/generic/missing 1970-01-01 00:00:00.000000000 +0000 +++ xvidcore-1.3.2/build/generic/missing 2011-05-23 10:25:42.000000000 +0000 @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru xvidcore-1.3.5/build/generic/platform.inc.in xvidcore-1.3.2/build/generic/platform.inc.in --- xvidcore-1.3.5/build/generic/platform.inc.in 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/generic/platform.inc.in 2011-01-11 11:39:13.000000000 +0000 @@ -33,7 +33,6 @@ SPECIFIC_CFLAGS=@SPECIFIC_CFLAGS@ ALTIVEC_CFLAGS=@ALTIVEC_CFLAGS@ CFLAGS=@CFLAGS@ -LDFLAGS=@LDFLAGS@ # ============================================================================ # Assembler @@ -58,11 +57,9 @@ # ============================================================================ INSTALL=@INSTALL@ -LN_S=@LN_S@ DESTDIR= prefix=@prefix@ exec_prefix=@exec_prefix@ -bindir=@bindir@ libdir=@libdir@ includedir=@includedir@ @@ -82,5 +79,3 @@ STATIC_LIB=@STATIC_LIB@ SHARED_LIB=@SHARED_LIB@ PRE_SHARED_LIB=@PRE_SHARED_LIB@ -SO_API_MAJOR_LINK=@SO_API_MAJOR_LINK@ -SO_LINK=@SO_LINK@ diff -Nru xvidcore-1.3.5/build/win32/libxvidcore.vcproj xvidcore-1.3.2/build/win32/libxvidcore.vcproj --- xvidcore-1.3.5/build/win32/libxvidcore.vcproj 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/build/win32/libxvidcore.vcproj 2011-05-25 07:49:35.000000000 +0000 @@ -1,10 +1,9 @@ @@ -109,6 +106,9 @@ Name="VCAppVerifierTool" /> + @@ -147,7 +147,7 @@ AdditionalOptions="/Qipo " Optimization="2" InlineFunctionExpansion="1" - PreprocessorDefinitions="NDEBUG;HAVE_PTHREAD;ARCH_IS_X86_64;WIN32;_WINDOWS;ARCH_IS_64BIT;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="NDEBUG;ARCH_IS_X86_64;WIN32;_WINDOWS;ARCH_IS_64BIT;_CRT_SECURE_NO_WARNINGS" StringPooling="true" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -178,8 +178,6 @@ ModuleDefinitionFile="..\generic\libxvidcore.def" ProgramDatabaseFile="$(IntDir)/xvidcore.pdb" SubSystem="2" - RandomizedBaseAddress="1" - DataExecutionPrevention="0" ImportLibrary="bin\x64\xvidcore.dll.a" TargetMachine="17" /> @@ -204,6 +202,9 @@ Name="VCAppVerifierTool" /> + @@ -240,7 +241,7 @@ @@ -299,6 +298,9 @@ Name="VCAppVerifierTool" /> + @@ -335,7 +337,7 @@ @@ -394,6 +394,9 @@ Name="VCAppVerifierTool" /> + @@ -425,11 +428,11 @@ > + + @@ -3489,10 +3496,6 @@ - - Sun, 28 Jan 2018 21:45:50 +0100 + -- Christian Marillat Wed, 20 Jun 2012 17:06:35 +0200 -xvidcore (2:1.3.4-1) unstable; urgency=medium +xvidcore (3:1.3.2-0.6) unstable; urgency=low - * Imported Upstream version 1.3.4 - * Update source download location in debian/copyright and debian/watch. - * Bump Build-Depends to debhelper (>= 9). - * Bump Standards-Version to 3.9.6. - * Refrain from mangling CFLAGS in debian/confflags, move the remainder - of this file into debian/rules. - * Remove debian/source/local-options, they are default now. + * debian/control correctly set yasm in Build-Depends. - -- Fabian Greffrath Mon, 29 Jun 2015 09:47:36 +0200 + -- Christian Marillat Tue, 03 Apr 2012 22:31:22 +0200 -xvidcore (2:1.3.3-1) unstable; urgency=medium +xvidcore (3:1.3.2-0.5) unstable; urgency=low - * Team upload. + * Added Multi-Arch: field in debian/control. - [ Alessio Treglia ] - * Use the autotools-dev dh addon to update config.guess/config.sub for arm64. - Thanks to Colin Watson for the report and patch. (Closes: #726428) + -- Christian Marillat Tue, 03 Apr 2012 10:39:35 +0200 - [ Fabian Greffrath ] - * Imported Upstream version 1.3.3 - * Remove all patches, applied upstream. - * Remove Andres Mejia from Uploaders list (Closes: #743557). +xvidcore (3:1.3.2-0.4) unstable; urgency=low - [ IOhannes m zmölnig ] - * Bumped standards version to 3.9.5 - * Removed deprecated "DM-Upload-Allowed" + * Added ccache in Build-depends. - -- IOhannes m zmölnig (Debian/GNU) Tue, 22 Apr 2014 13:11:17 +0200 + -- Christian Marillat Thu, 28 Jul 2011 03:07:19 +0200 -xvidcore (2:1.3.2-9) unstable; urgency=low +xvidcore (3:1.3.2-0.3) unstable; urgency=low - * Pass hardened CPPFLAGS to CFLAGS. (Closes: #664512) + * Changes -dev package name to libxvidcore-dev. - -- Andres Mejia Sun, 18 Mar 2012 10:15:39 -0400 + -- Christian Marillat Wed, 27 Jul 2011 07:23:30 +0200 -xvidcore (2:1.3.2-8) unstable; urgency=low +xvidcore (2:1.3.2-0.2) unstable; urgency=low - * Add in hardened CFLAGS. + * debian/rules Add missing --prefix configure option and remove empty -j + make option. - -- Andres Mejia Sat, 17 Mar 2012 13:49:24 -0400 + -- Christian Marillat Mon, 27 Jun 2011 18:34:31 +0200 -xvidcore (2:1.3.2-7) unstable; urgency=low +xvidcore (2:1.3.2-0.1) unstable; urgency=low - * Allow dev package to be multiarch installable. - * Bump to Standards-Version 3.9.3. + * Build for multiarch. - -- Andres Mejia Fri, 16 Mar 2012 18:33:18 -0400 + -- Christian Marillat Mon, 27 Jun 2011 15:29:55 +0200 -xvidcore (2:1.3.2-6) unstable; urgency=low +xvidcore (2:1.3.2-0.0) unstable; urgency=low - * Convert package to support multiarch library. + * New upstream release. + + -- Christian Marillat Tue, 31 May 2011 19:12:44 +0200 + +xvidcore (2:1.3.1-0.0) unstable; urgency=low + + * New upstream release. + + -- Christian Marillat Fri, 25 Mar 2011 08:46:40 +0100 + +xvidcore (2:1.3.0-0.0) unstable; urgency=low + + * New upstream release. + * debian/control doesn't build with yasm for kfreebsd-amd64, only with nasm. + + -- Christian Marillat Thu, 24 Feb 2011 10:42:00 +0100 + +xvidcore (2:1.2.2-0.1) unstable; urgency=low + + * debian/watch updated, should work now. + * Updated patch from Russell Coker to not demand an executable stack. + + -- Christian Marillat Sun, 24 Jan 2010 13:21:34 +0100 + +xvidcore (2:1.2.2-0.0) unstable; urgency=low + + * New upstream release. + + -- Christian Marillat Fri, 29 May 2009 14:48:31 +0200 + +xvidcore (2:1.2.1-0.0) unstable; urgency=low + + * New upstream release. + + -- Christian Marillat Wed, 29 Apr 2009 14:49:06 +0200 + +xvidcore (2:1.1.3-0.6) unstable; urgency=low + + * Patch from Russell Coker to not demand an executable stack. + + -- Christian Marillat Mon, 12 Jan 2009 15:47:42 +0100 + +xvidcore (2:1.1.3-0.5) unstable; urgency=high + + * Do not rerun build/generic/bootstrap.sh but instead update config.sub + and config.guess otherwise the configure script doesn't find yasm for + amd64 arch. + * Patch configure (doesn't find nasm). + + -- Christian Marillat Sat, 03 May 2008 21:12:05 +0200 + +xvidcore (2:1.1.3-0.4) unstable; urgency=low + + * Move to quilt. + * Added Homepage field. + * Re-run build/generic/bootstrap.sh + + -- Christian Marillat Wed, 09 Apr 2008 17:18:45 +0200 + +xvidcore (2:1.1.3-0.3) unstable; urgency=low + + * Of course nasm is for i386 only. Last uplaod for today :) + + -- Christian Marillat Wed, 05 Sep 2007 10:24:56 +0200 + +xvidcore (2:1.1.3-0.2) unstable; urgency=low + + * Add nasm in Build-Depends. + + -- Christian Marillat Wed, 05 Sep 2007 10:20:48 +0200 + +xvidcore (2:1.1.3-0.1) unstable; urgency=high + + * Add support for NCPUS and set urgency to high (CVE-2007-3329). + + -- Christian Marillat Wed, 05 Sep 2007 09:34:57 +0200 + +xvidcore (2:1.1.3-0.0) unstable; urgency=low + + * New upstream release. + + -- Christian Marillat Wed, 05 Sep 2007 09:19:14 +0200 + +xvidcore (2:1.1.2-0.1) unstable; urgency=low + + * New patch to fix build on ia64. + + -- Christian Marillat Thu, 2 Nov 2006 14:01:17 +0100 + +xvidcore (2:1.1.2-0.0) unstable; urgency=low + + * New upstream release. + + -- Christian Marillat Wed, 1 Nov 2006 16:27:54 +0100 + +xvidcore (2:1.1.0-final-0.1) unstable; urgency=low + + * Patch to fix ia64 build. Thanks to Thibaut VARENE. + + -- Christian Marillat Sun, 7 May 2006 13:08:28 +0200 + +xvidcore (2:1.1.0-final-0.0) unstable; urgency=low - -- Andres Mejia Sat, 17 Sep 2011 12:36:05 -0400 + * New upstream release. + + -- Christian Marillat Thu, 12 Jan 2006 09:20:35 +0100 + +xvidcore (2:1.1.0-beta2+cvs-0.0) unstable; urgency=low + + * Patch from CVS to fix build problem with amd64. + * Patch to not build with -freduce-all-givs -xvidcore (2:1.3.2-5) unstable; urgency=low + -- Christian Marillat Thu, 22 Sep 2005 02:47:35 -0700 - * Introduce a debian/confflags file to conditionally disable - assembly optimizations on certain archs until we introduce flavours. - * Disable yasm support for kfreebsd-amd64 again, it is known - to be broken and also disabled in FreeBSD (Closes: #635719). +xvidcore (2:1.1.0-beta2-0.0) unstable; urgency=low - -- Fabian Greffrath Fri, 29 Jul 2011 10:07:49 +0200 + * New upstream release -xvidcore (2:1.3.2-4) unstable; urgency=low + -- Christian Marillat Mon, 25 Apr 2005 12:43:51 +0200 - * Add patch by Pino Toscano to add support for GNU Hurd as target OS, - requires running autoconf (Closes: #635662). - * Extend Build-Depends on yasm to [any-i386 any-amd64]. +xvidcore (2:1.1.0-beta1-0.1) unstable; urgency=low - -- Fabian Greffrath Thu, 28 Jul 2011 09:46:20 +0200 + * From Guido, in debian/control : + o Type architectures must be seperated by space, not comma -xvidcore (2:1.3.2-3) unstable; urgency=low + -- Christian Marillat Fri, 22 Apr 2005 15:15:18 +0200 - * Fix typo to location of LGPL-2 on Debian systems. +xvidcore (2:1.1.0-beta1-0.0) unstable; urgency=low - -- Andres Mejia Tue, 26 Jul 2011 06:50:31 -0400 + * New upstream release -xvidcore (2:1.3.2-2) unstable; urgency=low + -- Christian Marillat Sat, 26 Mar 2005 00:01:05 +0100 - [ Fabian Greffrath ] - * Build-Depend on yasm. A recent enough version is in Debian now and - the configure script prefers it over nasm. +xvidcore (2:1.0.3-0.0) unstable; urgency=low - [ Reinhard Tartler ] - * document copyright and license of altivec assembler + * New upstream release - -- Reinhard Tartler Tue, 26 Jul 2011 11:02:05 +0200 + -- Christian Marillat Sat, 25 Dec 2004 07:06:28 +0100 -xvidcore (2:1.3.2-1) unstable; urgency=low +xvidcore (2:1.0.2-0.1) unstable; urgency=low - [ Fabian Greffrath ] - * Imported Upstream version 1.3.2 (Closes: #531040) - + dropped the debian/ directory from release tarballs. - + updated the configure helper scripts. - + Makefile does not include platform.inc in clean rules anymore. - + Makefile now shows build infos in the default build rule. + * The lib package Provides libxvidcore and the -dev package libxvidcore-dev - [ Andres Mejia ] - * Update to my @debian.org email. - * Update debian/copyright to reflect licensing of new upstream release. - * Update debian/copyright to DEP-5 spec. + -- Christian Marillat Wed, 24 Nov 2004 17:52:37 +0100 + +xvidcore (2:1.0.2-0.0) unstable; urgency=low + + * New upstream release. - -- Andres Mejia Mon, 25 Jul 2011 21:07:23 -0400 + -- Christian Marillat Sun, 5 Sep 2004 10:38:57 +0200 -xvidcore (2:1.3.1-1) UNRELEASED; urgency=low +xvidcore (2:1.0.1-0.0) unstable; urgency=low - [ Fabian Greffrath ] - * Imported Upstream version 1.3.1 - * Remove configure.in-fix.patch and no-exec-stack-elf32.patch, - applied upstream. - * Upstream updated their configure script, so drop autoconf. - * Update debian/gbp.conf and document filtering in git-import-orig. - * Fix so-symlink in debian/libxvidcore-dev.links. - * Simplify the changes to show build options during build. + * New upstream release. - [ Andres Mejia ] - * Show build options during build. - * Simplify setting of CFLAGS. - * Bump to Standards-Version 3.9.2. - * Fix description-synopsis-starts-with-article lintian warnings. - * Support parallel builds. - * Enable -O3 instead of -O2. - * Include Vcs-* entries. - * Add DM-Upload-Allowed: yes. - * Include local options to unapply all patches and abort on any upstream - changes. + -- Christian Marillat Tue, 8 Jun 2004 09:37:08 +0200 - -- Andres Mejia Tue, 03 May 2011 18:56:05 -0400 +xvidcore (2:1.0.0-0.0) unstable; urgency=low -xvidcore (2:1.3.0-1) UNRELEASED; urgency=low + * New upstream release. - * Imported Upstream version 1.3.0 - * Use 3.0 (quilt) source format. - * Refresh build system patches. - * yasm (> 1.0) is required but not in Debian yet, - build-depend on nasm (>= 2.0) - * Avoid running configure in the clean rule. - * Remove unused lintian overrides. - * Fix ldconfig-symlink-referencing-wrong-file. - * Update libxvidcore4.symbols file. - * Drop build-system-update.patch, use autotools-dev and autoconf - at build-time instead. - * Backup and restore build/generic/configure instead of removing it. - * Really disable the executable bit for GNU-stack for elf32 archs. + -- Christian Marillat Tue, 18 May 2004 14:56:43 +0200 - -- Fabian Greffrath Fri, 25 Feb 2011 11:49:07 +0100 +xvidcore (1:1.0.0-rc4-0.0) unstable; urgency=low -xvidcore (2:1.2.2+debian-3) UNRELEASED; urgency=low + * New upstream release. - [ Fabian Greffrath ] - * Update my e-mail address. - * Make use of dh --sourcedirectory, instead of overriding all of - dh_auto_*. - * Remove ltmain.sh from debian/patches/build-system-update.patch, - xvidcore does not even use libtool. - * Update debian/patches/build-system-update.patch with a recent - autoconf and autotools-dev. + -- Christian Marillat Tue, 6 Apr 2004 15:25:57 +0200 - [ Andres Mejia ] - * Fix issue where autoconf outputs badly formatted configure script. - * Update build-system-update.patch description with instructions on - how to update build system. - * Update Standards-Version to 3.9.1. No changes needed. +xvidcore (1:1.0.0-rc2-0.0) unstable; urgency=low - -- Andres Mejia Sat, 11 Sep 2010 15:38:00 -0400 + * New upstream release. -xvidcore (2:1.2.2+debian-2) unstable; urgency=low + -- Christian Marillat Sun, 8 Feb 2004 22:49:17 +0100 - [ Maia Kozheva ] - * Merged README.Source and README.source. +xvidcore (1:1.0.0-rc1-0.0) unstable; urgency=low - [ Reinhard Tartler ] - * Upload to Debian, Closes: #531040 + * New upstream release. - -- Reinhard Tartler Sat, 31 Jul 2010 21:52:24 -0400 + -- Christian Marillat Sat, 7 Feb 2004 16:39:26 +0100 -xvidcore (2:1.2.2+debian-1ubuntu2) maverick; urgency=low +xvidcore (1:1.0.0-beta3-0.0) unstable; urgency=low - * Really merge README.Source and README.source now. + * News Beta release. - -- Maia Kozheva Sat, 05 Jun 2010 18:02:44 +0700 + -- Christian Marillat Sun, 28 Dec 2003 14:43:28 +0100 -xvidcore (2:1.2.2+debian-1ubuntu1) maverick; urgency=low +xvidcore (1:1.0.0-beta2-0.0) unstable; urgency=low - * Merged from debian-unofficial release 2:1.2.2+debian-1, remaining - Ubuntu changes: - - Merged README.Source and README.source. + * News Beta release. - -- Maia Kozheva Sat, 05 Jun 2010 17:47:10 +0700 + -- Christian Marillat Sat, 20 Dec 2003 23:32:59 +0100 -xvidcore (2:1.2.2+debian-1) unstable; urgency=low +xvidcore (1:0.9.2-0.3) unstable; urgency=low - * Prepare release for Debian. - * Set appropriate debian-branch default for master branch. - * Fix Maintainer field and set myself as an uploader. - * Bump Standards-Version to 4. - * Remove dependence on cdbs and just use debhelper. - * Update the build system via a quilt patch. - * Add lintian overrides with appropriate messages for overrides. + * Add a versioned shlibs and remove generated libxvidcore.def - -- Andres Mejia Sat, 08 May 2010 01:37:15 -0400 + -- Christian Marillat Fri, 22 Aug 2003 00:53:38 +0200 -xvidcore (2:1.2.2+debian-0ubuntu2) lucid; urgency=low +xvidcore (1:0.9.2-0.2) unstable; urgency=low - * Non-exec patches got broken upstream by invoking yasm -f elf64/elf32, - so the __OUTPUT_FORMAT__==elf test no longer works. Instead, trigger - the section in the global include file, thanks to Russell Coker - (LP: #530876). + * Forgot to change the internal library name. - -- Kees Cook Tue, 02 Mar 2010 11:20:39 -0800 + -- Christian Marillat Fri, 22 Aug 2003 00:53:34 +0200 -xvidcore (2:1.2.2+debian-0ubuntu1) lucid; urgency=low +xvidcore (1:0.9.2-0.1) unstable; urgency=low - * Fakesynced new upstream release from the debian-multimedia git repository. - (LP: #306399) - * Dropped Ubuntu patches, all applied upstream: - - 01_ia64_fix.dpatch - - 50_non-exec-stack.dpatch - - CVE-2007-3329.dpatch + * debian/control libxvidcore-dev should depends on libxvidcore2 not libxvidencore2 - -- Maia Kozheva Fri, 20 Nov 2009 12:48:09 +0600 + -- Christian Marillat Thu, 21 Aug 2003 22:58:11 +0200 -xvidcore (1.2.2+debian-0debimedia1) unstable; urgency=low +xvidcore (1:0.9.2-0.0) unstable; urgency=low - * Added debian/README.Source. - * Updated Maintainer and Uploaders fields. - * Build-Depend on yasm (>= 0.8), since it's in squeeze now. - * Bumped Standards-Version to 3.8.2. + * New upstream release. + * Install example files in the -doc packages. + * Change package name to libxvidcore2, libxvidcore-dev and libxvidcore-doc - -- Fabian Greffrath Wed, 12 Aug 2009 08:38:39 +0200 + -- Christian Marillat Thu, 21 Aug 2003 22:43:12 +0200 -xvidcore (1.2.2+debian-0fab5) unstable; urgency=low +xvidcore (1:0.9.1-0.2) unstable; urgency=low - * debian/copyright: Finalized. + * Some package re-arrangement before packaging 0.9.2 - -- Fabian Greffrath Fri, 26 Jun 2009 09:00:00 +0200 + -- Christian Marillat Wed, 20 Aug 2003 15:23:24 +0200 -xvidcore (1.2.2+debian-0fab4) unstable; urgency=low +xvidcore (1:0.9.1-0.1) unstable; urgency=low - * debian/control: Prefer yasm (>= 0.8) over nasm (>= 2.0). - * debian/copyright: Simplified. + * Change section for -doc package. + * Include portab.h - -- Fabian Greffrath Thu, 25 Jun 2009 11:00:00 +0200 + -- Christian Marillat Fri, 11 Jul 2003 10:25:24 +0200 -xvidcore (1.2.2+debian-0fab3) unstable; urgency=low +xvidcore (1:0.9.1-0.0) unstable; urgency=low - * debian/control, debian/rules: Ported from debhelper (>= 7.2) to cdbs. - * debian/control: Wrapped Build-Depends and Depends fields. - * debian/control: Removed Build-Depends on quilt. - * debian/patches/: Removed. + * New upstream release. - -- Fabian Greffrath Wed, 24 Jun 2009 16:30:00 +0200 + -- Christian Marillat Sat, 15 Feb 2003 17:33:56 +0100 -xvidcore (1.2.2+debian-0fab2) unstable; urgency=low +xvidcore (1:0.9.0-0.4) unstable; urgency=low - * debian/control: Bumped Build-Depends to debhelper (>= 7.2). - * debian/control: Adjusted Build-Depends on nasm and yasm. - * debian/copyright: Improved based on an approach by - Loïc Martin . - * debian/libxvidcore4.symbols: Added. - * debian/rules: Added reasonable defaults to CFLAGS. - * debian/rules: Added execute permissions to the configure script - after the patch rule instead of before the configure rule. - * debian/watch: Added. + * debian/control Change Architecture to any - -- Fabian Greffrath Wed, 24 Jun 2009 15:00:00 +0200 + -- Christian Marillat Tue, 11 Feb 2003 01:01:20 +0100 -xvidcore (1.2.2+debian-0fab1) unstable; urgency=low +xvidcore (1:0.9.0-0.3) unstable; urgency=low + + * Add sparc build and fix ia64 + + -- Christian Marillat Tue, 11 Feb 2003 00:34:20 +0100 + +xvidcore (1:0.9.0-0.2) unstable; urgency=low + + * Use the right Makefile for ppc and ia64. + + -- Christian Marillat Tue, 21 Jan 2003 21:44:55 +0100 + +xvidcore (1:0.9.0-0.1) unstable; urgency=low + + * Bump Standards-Version to 3.5.8 + * Add a new -doc package. + * Remove gcc-3.2 build-dependency now gcc-3.2 is the default gcc + + -- Christian Marillat Tue, 7 Jan 2003 23:39:53 +0100 + +xvidcore (1:0.9.0-0.0) unstable; urgency=low * New upstream release. - -- Fabian Greffrath Tue, 02 Jun 2009 00:00:00 +0200 + -- Christian Marillat Wed, 27 Nov 2002 01:05:39 +0100 + +xvid (20020822-0.0) unstable; urgency=low + + * New cvs snapshot. + * Build with gcc-3.2 + + -- Christian Marillat Mon, 23 Sep 2002 15:48:08 +0200 + +xvid (20020728-0.0) unstable; urgency=low + + * New cvs snapshot. + * Add DEB_BUILD_OPTIONS support + + -- Christian Marillat Wed, 14 Aug 2002 18:21:31 +0200 + +xvid (20020412-2) unstable; urgency=low + + * Add divx4.h in the package. + + -- Christian Marillat Tue, 6 Aug 2002 15:34:00 +0200 + +xvid (20020412-1) unstable; urgency=low + + * New cvs snapshot. + + -- Christian Marillat Fri, 12 Apr 2002 11:49:15 +0200 + +xvid (20020404-1) unstable; urgency=low + + * New cvs snapshot. + + -- Christian Marillat Sun, 7 Apr 2002 15:13:18 +0200 + +xvid (20020317-1) unstable; urgency=low + + * New cvs snapshot. + + -- Christian Marillat Wed, 27 Mar 2002 15:07:57 +0100 + +xvid (20020121-2) unstable; urgency=low + + * Include the header file. + * Don't compile for pentium-pro + + -- Christian Marillat Mon, 4 Mar 2002 18:39:53 +0100 + +xvid (20020121-1) unstable; urgency=low + + * New cvs snapshot. + + -- Christian Marillat Mon, 11 Feb 2002 18:52:55 +0100 + +xvid (20020120-1) unstable; urgency=low + + * New cvs snapshot. + + -- Christian Marillat Mon, 21 Jan 2002 19:15:41 +0100 + +xvid (20020105-1) unstable; urgency=low + + * New cvs snapshot. + + -- Christian Marillat Sat, 12 Jan 2002 15:29:23 +0100 + +xvid (20011128-1) unstable; urgency=low -xvidcore (1.2.1+debian-0fab1) unstable; urgency=low + * Initial Release. - * Initial release. - * Rebuilt upstream tarball without debian/ directory. - * Patched a build environment into the top level source directory. + -- Christian Marillat Fri, 30 Nov 2001 16:42:45 +0100 - -- Fabian Greffrath Mon, 01 Jun 2009 00:00:00 +0200 +Local variables: +mode: debian-changelog +End: diff -Nru xvidcore-1.3.5/debian/clean xvidcore-1.3.2/debian/clean --- xvidcore-1.3.5/debian/clean 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/clean 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -build/generic/configure diff -Nru xvidcore-1.3.5/debian/compat xvidcore-1.3.2/debian/compat --- xvidcore-1.3.5/debian/compat 2018-01-28 20:35:29.000000000 +0000 +++ xvidcore-1.3.2/debian/compat 2019-03-09 04:30:29.000000000 +0000 @@ -1 +1 @@ -11 +9 diff -Nru xvidcore-1.3.5/debian/control xvidcore-1.3.2/debian/control --- xvidcore-1.3.5/debian/control 2018-01-28 20:36:53.000000000 +0000 +++ xvidcore-1.3.2/debian/control 2019-03-09 04:30:29.000000000 +0000 @@ -1,45 +1,29 @@ Source: xvidcore Section: libs Priority: optional -Maintainer: Debian Multimedia Maintainers -Uploaders: Loïc Martin , - Reinhard Tartler , - Fabian Greffrath -Build-Depends: debhelper (>= 11~), - yasm (>= 1.0) [any-i386 amd64] -Standards-Version: 4.1.3 +Maintainer: Christian Marillat +Bugs: mailto:marillat@deb-multimedia.org Homepage: http://www.xvid.org/ -Vcs-Git: https://salsa.debian.org/multimedia-team/xvidcore.git -Vcs-Browser: https://salsa.debian.org/multimedia-team/xvidcore +Standards-Version: 3.9.3 +Build-Conflicts: yasm [kfreebsd-amd64] +Build-Depends: debhelper (>= 9), nasm [kfreebsd-amd64], autotools-dev, + ccache, yasm [amd64 i386 kfreebsd-i386] Package: libxvidcore4 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Open source MPEG-4 video codec (library) - Xvid (formerly XviD) is an open source MPEG-4 video codec, implementing MPEG-4 - Simple Profile, Advanced Simple Profile, and Advanced Video Coding standards. - It is written in C with assembler optimizations for quality and speed - (including MMX, SSE, and 3Dnow! code for i386 and AltiVec for PowerPC), and is - especially optimized towards offline, multi-pass compression for storage and - archival purposes. - . - This package contains the shared library. +Depends: ${shlibs:Depends}, ${misc:Depends} +Provides: libxvidcore +Description: High quality ISO MPEG4 codec library + XviD is a high quality/performance ISO MPEG4 codec. Package: libxvidcore-dev -Section: libdevel Architecture: any Multi-Arch: same -Depends: libxvidcore4 (= ${binary:Version}), - ${misc:Depends} -Description: Open source MPEG-4 video codec (development) - Xvid (formerly XviD) is an open source MPEG-4 video codec, implementing MPEG-4 - Simple Profile, Advanced Simple Profile, and Advanced Video Coding standards. - It is written in C with assembler optimizations for quality and speed - (including MMX, SSE, and 3Dnow! code for i386 and AltiVec for PowerPC), and is - especially optimized towards offline, multi-pass compression for storage and - archival purposes. - . - This package contains the development files. +Depends: libxvidcore4 (= ${binary:Version}), ${misc:Depends} +Section: libdevel +Replaces: libxvidencore0 (<= 1:0.9.1-0.1), libxvidcore4-dev +Conflicts: libxvidencore-dev, libxvidcore4-dev +Description: High quality ISO MPEG4 codec library -- development files + XviD is a high quality/performance ISO MPEG4 codec. diff -Nru xvidcore-1.3.5/debian/copyright xvidcore-1.3.2/debian/copyright --- xvidcore-1.3.5/debian/copyright 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/copyright 2019-03-09 04:30:29.000000000 +0000 @@ -1,101 +1,13 @@ -Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=174&view=markup -Upstream-Name: xvidcore -Upstream-Contact: xvid-devel@xvid.org -Source: https://labs.xvid.com/source/ +This package was debianized by Christian Marillat on +Fri, 30 Nov 2001 16:42:45 +0100. -Files: * -Copyright: © 1999, Intel Corporation - © 2000-2001, Michel Lespinasse - © 2000, Royce Shih-Wea Liao - © 2000-2001, Peter Gubanov - © 2001, Fabrice Bellard - © 2001, Michael Niedermayer - © 2001-2003, xvid team - © 2001-2004, Peter Ross - © 2001-2011, Michael Militzer - © 2002, Alexander Viehl - © 2002, Benjamin Herrenschmidt - © 2002, Christian Engel - © 2002, Christian Schwarz - © 2002, Christopher Özbek - © 2002, Daniel Kallfass - © 2002, Daniel Smith - © 2002, Daniel Winkler - © 2002, Dirk Knop - © 2002, Dmitry Rozhdestvensky - © 2002, Haiko Gaisser - © 2002, Hannes Jütting - © 2002, Hans-Joachim Daniels - © 2002, Ingo-Marc Weber - © 2002, Johannes Singler - © 2002, Kai Kühn - © 2002, Max Stengel - © 2002, MinChen - © 2002, Sebastian Felis - © 2002, Sebastian Hack - © 2002, Stephan Krause - © 2002-2003, Christoph Lampert - © 2002-2003, Jaan Kalda - © 2002-2004, Benjamin Lambert - © 2002-2004, Edouard Gomez - © 2002-2005, Radoslaw Czyz - © 2002-2006, Pascal Massimino - © 2004, Dcoder - © 2004, Jean-Marc Bastide - © 2004, Marc Fauconneau - © 2004, Christoph Naegeli - © 2004-2005, Christoph Naegeli - © 2005, Carlo Bramini - © 2005-2006, Johannes Reinhardt - © 2006-2011, Xvid Solutions GmbH - © 2008, Jason Garrett-Glaser - © Johannes Singler -License: GPL-2+ +It was downloaded from http://www.videocoding.de/index.php?section=Download -Files: debian/* -Copyright: © 2001, Christian Marillat - © 2003, Edouard Gomez - © 2005-2009, Fabian Greffrath - © 2009, Loïc Martin - © 2009-2011, Reinhard Tartler , - © 2009-2011, Andres Mejia -License: GPL-2+ +Upstream Author: peter ross -Files: src/dct/ppc_asm/* -Copyright: © 2001, Michel Lespinasse - © 2004, Christoph Naegeli -License: LGPL-2+ +Copyright: (c)2001 peter ross -License: GPL-2+ - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public License - can be found at '/usr/share/common-licenses/GPL-2'. - -License: LGPL-2+ - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - . - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public License - can be found at '/usr/share/common-licenses/LGPL-2'. + You should have received a copy of the GNU General Public License with the + Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; if + not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth + Floor, Boston, MA 02110-1301, USA. diff -Nru xvidcore-1.3.5/debian/gbp.conf xvidcore-1.3.2/debian/gbp.conf --- xvidcore-1.3.5/debian/gbp.conf 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[DEFAULT] -debian-branch = master -pristine-tar = True diff -Nru xvidcore-1.3.5/debian/install xvidcore-1.3.2/debian/install --- xvidcore-1.3.5/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ xvidcore-1.3.2/debian/install 2019-03-09 04:30:29.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*/libxvidcore.so.4.3 diff -Nru xvidcore-1.3.5/debian/libxvidcore-dev.install xvidcore-1.3.2/debian/libxvidcore-dev.install --- xvidcore-1.3.5/debian/libxvidcore-dev.install 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/libxvidcore-dev.install 2019-03-09 04:30:29.000000000 +0000 @@ -1,3 +1,2 @@ -usr/include -usr/lib/*/*.a -usr/lib/*/*.so +usr/include/xvid.h +usr/lib/*/libxvidcore.a diff -Nru xvidcore-1.3.5/debian/libxvidcore4.install xvidcore-1.3.2/debian/libxvidcore4.install --- xvidcore-1.3.5/debian/libxvidcore4.install 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/libxvidcore4.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/*/*.so.* diff -Nru xvidcore-1.3.5/debian/libxvidcore4.symbols xvidcore-1.3.2/debian/libxvidcore4.symbols --- xvidcore-1.3.5/debian/libxvidcore4.symbols 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/libxvidcore4.symbols 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -libxvidcore.so.4 libxvidcore4 #MINVER# - xvid_decore@Base 1.2.2 - xvid_encore@Base 1.2.2 - xvid_global@Base 1.2.2 - xvid_plugin_2pass1@Base 1.2.2 - xvid_plugin_2pass2@Base 1.2.2 - xvid_plugin_dump@Base 1.2.2 - xvid_plugin_lumimasking@Base 1.2.2 - xvid_plugin_psnr@Base 1.2.2 - xvid_plugin_psnrhvsm@Base 2:1.3.0 - xvid_plugin_single@Base 1.2.2 - xvid_plugin_ssim@Base 1.2.2 diff -Nru xvidcore-1.3.5/debian/rules xvidcore-1.3.2/debian/rules --- xvidcore-1.3.5/debian/rules 2018-01-28 20:40:54.000000000 +0000 +++ xvidcore-1.3.2/debian/rules 2019-03-09 04:30:29.000000000 +0000 @@ -1,27 +1,36 @@ #!/usr/bin/make -f -export DEB_BUILD_MAINT_OPTIONS = hardening=+all +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) -export DEB_CFLAGS_MAINT_APPEND += $(shell dpkg-buildflags --get CPPFLAGS) -export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,--no-undefined +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) +CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS) -export DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) -export DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) - -# Explicitely disable Altivec support on powerpc until we introduce flavours -ifeq ($(DEB_HOST_ARCH_CPU),powerpc) - confflags += --disable-assembly -endif - -# Explicitely disable yasm support on kfreebsd, it's broken on 64bit; -# see: http://www.freebsd.org/cgi/cvsweb.cgi/ports/multimedia/xvid/Makefile?rev=1.36 -ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) - confflags += --disable-assembly -endif +CC:=ccache $(CC) %: - dh $@ --sourcedirectory=build/generic + dh $@ --parallel --with autotools_dev override_dh_auto_configure: - cd build/generic && autoconf - dh_auto_configure -- $(confflags) + cd build/generic && ./configure --prefix=/usr \ + --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ + CC="$(CC)" + +override_dh_auto_build: + cd build/generic && $(MAKE) + +override_dh_install: + $(MAKE) -C build/generic install prefix=$(CURDIR)/debian/tmp/usr + + dh_install --fail-missing + + dh_link -plibxvidcore-dev usr/lib/$(DEB_HOST_MULTIARCH)/libxvidcore.so.4.3 usr/lib/$(DEB_HOST_MULTIARCH)/libxvidcore.so + dh_link -plibxvidcore4 usr/lib/$(DEB_HOST_MULTIARCH)/libxvidcore.so.4.3 usr/lib/$(DEB_HOST_MULTIARCH)/libxvidcore.so.4 + +override_dh_builddeb: + dh_builddeb -- -Zbzip2 + +override_dh_clean: + touch build/generic/platform.inc + cd build/generic && $(MAKE) distclean + + dh_clean diff -Nru xvidcore-1.3.5/debian/source/format xvidcore-1.3.2/debian/source/format --- xvidcore-1.3.5/debian/source/format 2018-01-28 20:24:12.000000000 +0000 +++ xvidcore-1.3.2/debian/source/format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -3.0 (quilt) diff -Nru xvidcore-1.3.5/debian/watch xvidcore-1.3.2/debian/watch --- xvidcore-1.3.5/debian/watch 2018-01-28 20:26:42.000000000 +0000 +++ xvidcore-1.3.2/debian/watch 2019-03-09 04:30:29.000000000 +0000 @@ -1,3 +1,4 @@ -version=4 -https://labs.xvid.com/source/ \ -https://downloads.xvid.com/downloads/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ +version=3 + + +http://www.xvid.org/Downloads.43.0.html http://downloads.xvid.org/downloads/xvidcore-(.*)\.tar\.gz diff -Nru xvidcore-1.3.5/dshow/src/CXvidDecoder.cpp xvidcore-1.3.2/dshow/src/CXvidDecoder.cpp --- xvidcore-1.3.5/dshow/src/CXvidDecoder.cpp 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/dshow/src/CXvidDecoder.cpp 2011-05-19 12:48:59.000000000 +0000 @@ -1,2476 +1,2323 @@ -/***************************************************************************** - * - * XVID MPEG-4 VIDEO CODEC - * - Xvid Decoder part of the DShow Filter - - * - * Copyright(C) 2002-2011 Peter Ross - * 2003-2012 Michael Militzer - * - * This program is free software ; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation ; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY ; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program ; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: CXvidDecoder.cpp 2156 2017-01-27 13:43:32Z Isibaar $ - * - ****************************************************************************/ - - /* - this requires the directx sdk - place these paths at the top of the Tools|Options|Directories list - - headers: - C:\DX90SDK\Include - C:\DX90SDK\Samples\C++\DirectShow\BaseClasses - - C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Release - C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug -*/ - -#ifdef ENABLE_MFT -#define XVID_USE_MFT -#endif - -#include - -#include -#include -#include -#if (1100 > _MSC_VER) -#include -#endif -#include // VIDEOINFOHEADER2 - -#if defined(XVID_USE_MFT) -#define MFT_UNIQUE_METHOD_NAMES -#include -#include -#include -#include -#endif - -#include - -#include // Xvid API - -#include "resource.h" - -#include "IXvidDecoder.h" -#include "CXvidDecoder.h" -#include "CAbout.h" -#include "config.h" -#include "debug.h" - -static bool USE_IYUV; -static bool USE_YV12; -static bool USE_YUY2; -static bool USE_YVYU; -static bool USE_UYVY; -static bool USE_RGB32; -static bool USE_RGB24; -static bool USE_RG555; -static bool USE_RG565; - -const AMOVIESETUP_MEDIATYPE sudInputPinTypes[] = -{ - { &MEDIATYPE_Video, &CLSID_XVID }, - { &MEDIATYPE_Video, &CLSID_XVID_UC }, - { &MEDIATYPE_Video, &CLSID_DIVX }, - { &MEDIATYPE_Video, &CLSID_DIVX_UC }, - { &MEDIATYPE_Video, &CLSID_DX50 }, - { &MEDIATYPE_Video, &CLSID_DX50_UC }, - { &MEDIATYPE_Video, &CLSID_3IVX }, - { &MEDIATYPE_Video, &CLSID_3IVX_UC }, - { &MEDIATYPE_Video, &CLSID_3IV0 }, - { &MEDIATYPE_Video, &CLSID_3IV0_UC }, - { &MEDIATYPE_Video, &CLSID_3IV1 }, - { &MEDIATYPE_Video, &CLSID_3IV1_UC }, - { &MEDIATYPE_Video, &CLSID_3IV2 }, - { &MEDIATYPE_Video, &CLSID_3IV2_UC }, - { &MEDIATYPE_Video, &CLSID_LMP4 }, - { &MEDIATYPE_Video, &CLSID_LMP4_UC }, - { &MEDIATYPE_Video, &CLSID_RMP4 }, - { &MEDIATYPE_Video, &CLSID_RMP4_UC }, - { &MEDIATYPE_Video, &CLSID_SMP4 }, - { &MEDIATYPE_Video, &CLSID_SMP4_UC }, - { &MEDIATYPE_Video, &CLSID_HDX4 }, - { &MEDIATYPE_Video, &CLSID_HDX4_UC }, - { &MEDIATYPE_Video, &CLSID_MP4V }, - { &MEDIATYPE_Video, &CLSID_MP4V_UC }, -}; - -const AMOVIESETUP_MEDIATYPE sudOutputPinTypes[] = -{ - { &MEDIATYPE_Video, &MEDIASUBTYPE_NULL } -}; - - -const AMOVIESETUP_PIN psudPins[] = -{ - { - L"Input", // String pin name - FALSE, // Is it rendered - FALSE, // Is it an output - FALSE, // Allowed none - FALSE, // Allowed many - &CLSID_NULL, // Connects to filter - L"Output", // Connects to pin - sizeof(sudInputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE), // Number of types - &sudInputPinTypes[0] // The pin details - }, - { - L"Output", // String pin name - FALSE, // Is it rendered - TRUE, // Is it an output - FALSE, // Allowed none - FALSE, // Allowed many - &CLSID_NULL, // Connects to filter - L"Input", // Connects to pin - sizeof(sudOutputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE), // Number of types - sudOutputPinTypes // The pin details - } -}; - - -const AMOVIESETUP_FILTER sudXvidDecoder = -{ - &CLSID_XVID, // Filter CLSID - XVID_NAME_L, // Filter name - MERIT_PREFERRED+2, // Its merit - sizeof(psudPins) / sizeof(AMOVIESETUP_PIN), // Number of pins - psudPins // Pin details -}; - - -// List of class IDs and creator functions for the class factory. This -// provides the link between the OLE entry point in the DLL and an object -// being created. The class factory will call the static CreateInstance - -CFactoryTemplate g_Templates[] = -{ - { - XVID_NAME_L, - &CLSID_XVID, - CXvidDecoder::CreateInstance, - NULL, - &sudXvidDecoder - }, - { - XVID_NAME_L L"About", - &CLSID_CABOUT, - CAbout::CreateInstance - } - -}; - -/* note: g_cTemplates must be global; used by strmbase.lib(dllentry.cpp,dllsetup.cpp) */ -int g_cTemplates = sizeof(g_Templates) / sizeof(CFactoryTemplate); - -extern HINSTANCE g_xvid_hInst; - -static int GUI_Page = 0; -static HWND MSG_hwnd = NULL; /* message handler window */ - -extern "C" void CALLBACK Configure(HWND hWndParent, HINSTANCE hInstParent, LPSTR lpCmdLine, int nCmdShow ); - -LRESULT CALLBACK msg_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch ( uMsg ) - { - case WM_ICONMESSAGE: - switch(lParam) - { - case WM_LBUTTONUP: - case WM_LBUTTONDBLCLK: - if (!GUI_Page) { - GUI_Page = 1; - Configure(hwnd, g_xvid_hInst, "", 1); - GUI_Page = 0; - } - break; - default: - return DefWindowProc(hwnd, uMsg, wParam, lParam); - }; - break; - - case WM_DESTROY: - NOTIFYICONDATA nid; - ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); - - nid.cbSize = sizeof(NOTIFYICONDATA); - nid.hWnd = hwnd; - nid.uID = 1456; - Shell_NotifyIcon(NIM_DELETE, &nid); - default: - return DefWindowProc(hwnd, uMsg, wParam, lParam); - } - - return TRUE; /* ok */ -} - -STDAPI DllRegisterServer() -{ -#if defined(XVID_USE_MFT) - int inputs_num = sizeof(sudInputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE); - int outputs_num = sizeof(sudOutputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE); - MFT_REGISTER_TYPE_INFO * mft_bs = new MFT_REGISTER_TYPE_INFO[inputs_num]; - MFT_REGISTER_TYPE_INFO * mft_csp = new MFT_REGISTER_TYPE_INFO[outputs_num]; - - { - int i; - for(i=0;i(XVID_NAME_MFT_L), // Friendly name - 0, // Flags - inputs_num, // Number of input types - mft_bs, // Input types - outputs_num, // Number of output types - mft_csp, // Output types - NULL // Attributes (optional) - ); - - delete[] mft_bs; - delete[] mft_csp; -#endif /* XVID_USE_MFT */ - - return AMovieDllRegisterServer2( TRUE ); -} - - -STDAPI DllUnregisterServer() -{ -#if defined(XVID_USE_MFT) - MFTUnregister(CLSID_XVID); -#endif - return AMovieDllRegisterServer2( FALSE ); -} - - -/* create instance */ - -CUnknown * WINAPI CXvidDecoder::CreateInstance(LPUNKNOWN punk, HRESULT *phr) -{ - CXvidDecoder * pNewObject = new CXvidDecoder(punk, phr); - if (pNewObject == NULL) - { - *phr = E_OUTOFMEMORY; - } - return pNewObject; -} - - -/* query interfaces */ - -STDMETHODIMP CXvidDecoder::NonDelegatingQueryInterface(REFIID riid, void **ppv) -{ - CheckPointer(ppv, E_POINTER); - - if (riid == IID_IXvidDecoder) - { - return GetInterface((IXvidDecoder *) this, ppv); - } - - if (riid == IID_ISpecifyPropertyPages) - { - return GetInterface((ISpecifyPropertyPages *) this, ppv); - } - -#if defined(XVID_USE_MFT) - if (riid == IID_IMFTransform) - { - return GetInterface((IMFTransform *) this, ppv); - } -#endif - - return CVideoTransformFilter::NonDelegatingQueryInterface(riid, ppv); -} - - - -/* constructor */ - -CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : - CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) -{ - DPRINTF("Constructor"); - - xvid_decore_func = NULL; // Hmm, some strange errors appearing if I try to initialize... - xvid_global_func = NULL; // ...this in constructor's init-list. So, they assigned here. - - m_tray_icon = 0; - m_startClock = clock(); - interlaced = 0; - -#if defined(XVID_USE_MFT) - InitializeCriticalSection(&m_mft_lock); - m_pInputType = NULL; - m_pOutputType = NULL; - m_pOutputTypeBPP = 32; - m_rtFrame = 0; - m_duration = 0; - m_discont = 0; - m_frameRate.Denominator = 1; - m_frameRate.Numerator = 1; - m_thread_handle = NULL; -#endif - - LoadRegistryInfo(); - - *phr = OpenLib(); - - { - TCHAR lpFilename[MAX_PATH]; - int sLen = GetModuleFileName(NULL, lpFilename, MAX_PATH); -#ifdef _UNICODE - if ((sLen >= 11) && (_wcsnicmp(&(lpFilename[sLen - 11]), TEXT("dllhost.exe"), 11) == 0)) { -#else - if ((sLen >= 11) && (_strnicmp(&(lpFilename[sLen - 11]), TEXT("dllhost.exe"), 11) == 0)) { -#endif - if (m_tray_icon == 0) m_tray_icon = -1; // create no tray icon upon thumbnail generation - } - } - -} - -HRESULT CXvidDecoder::OpenLib() -{ - DPRINTF("OpenLib"); - - if (m_hdll != NULL) - return E_UNEXPECTED; // Seems, that library already opened. - - xvid_gbl_init_t init; - memset(&init, 0, sizeof(init)); - init.version = XVID_VERSION; - init.cpu_flags = g_config.cpu; - - xvid_gbl_info_t info; - memset(&info, 0, sizeof(info)); - info.version = XVID_VERSION; - - m_hdll = LoadLibrary(XVID_DLL_NAME); - if (m_hdll == NULL) { - DPRINTF("dll load failed"); - MessageBox(0, XVID_DLL_NAME " not found","Error", MB_TOPMOST); - return E_FAIL; - } - - xvid_global_func = (int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global"); - if (xvid_global_func == NULL) { - FreeLibrary(m_hdll); - m_hdll = NULL; - MessageBox(0, "xvid_global() not found", "Error", MB_TOPMOST); - return E_FAIL; - } - - xvid_decore_func = (int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_decore"); - if (xvid_decore_func == NULL) { - xvid_global_func = NULL; - FreeLibrary(m_hdll); - m_hdll = NULL; - MessageBox(0, "xvid_decore() not found", "Error", MB_TOPMOST); - return E_FAIL; - } - - if (xvid_global_func(0, XVID_GBL_INIT, &init, NULL) < 0) - { - xvid_global_func = NULL; - xvid_decore_func = NULL; - FreeLibrary(m_hdll); - m_hdll = NULL; - MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); - return E_FAIL; - } - - if (xvid_global_func(0, XVID_GBL_INFO, &info, NULL) < 0) - { - xvid_global_func = NULL; - xvid_decore_func = NULL; - FreeLibrary(m_hdll); - m_hdll = NULL; - MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); - return E_FAIL; - } - - memset(&m_create, 0, sizeof(m_create)); - m_create.version = XVID_VERSION; - m_create.handle = NULL; - /* Decoder threads */ - if (g_config.cpu & XVID_CPU_FORCE) { - m_create.num_threads = g_config.num_threads; - } - else { - m_create.num_threads = info.num_threads; /* Autodetect */ - g_config.num_threads = info.num_threads; - } - - memset(&m_frame, 0, sizeof(m_frame)); - m_frame.version = XVID_VERSION; - - USE_IYUV = false; - USE_YV12 = false; - USE_YUY2 = false; - USE_YVYU = false; - USE_UYVY = false; - USE_RGB32 = false; - USE_RGB24 = false; - USE_RG555 = false; - USE_RG565 = false; - - switch ( g_config.nForceColorspace ) - { - case FORCE_NONE: - USE_IYUV = true; - USE_YV12 = true; - USE_YUY2 = true; - USE_YVYU = true; - USE_UYVY = true; - USE_RGB32 = true; - USE_RGB24 = true; - USE_RG555 = true; - USE_RG565 = true; - break; - case FORCE_YV12: - USE_IYUV = true; - USE_YV12 = true; - break; - case FORCE_YUY2: - USE_YUY2 = true; - break; - case FORCE_RGB24: - USE_RGB24 = true; - break; - case FORCE_RGB32: - USE_RGB32 = true; - break; - } - - switch (g_config.aspect_ratio) - { - case 0: - case 1: - break; - case 2: - ar_x = 4; - ar_y = 3; - break; - case 3: - ar_x = 16; - ar_y = 9; - break; - case 4: - ar_x = 47; - ar_y = 20; - break; - } - - return S_OK; -} - -void CXvidDecoder::CloseLib() -{ - DPRINTF("CloseLib"); - - if ((m_create.handle != NULL) && (xvid_decore_func != NULL)) - { - xvid_decore_func(m_create.handle, XVID_DEC_DESTROY, 0, 0); - m_create.handle = NULL; - } - - if (m_hdll != NULL) { - FreeLibrary(m_hdll); - m_hdll = NULL; - } - xvid_decore_func = NULL; - xvid_global_func = NULL; -} - -/* destructor */ - -CXvidDecoder::~CXvidDecoder() -{ - DPRINTF("Destructor"); - - if ((MSG_hwnd != NULL) && (m_tray_icon == 1)) { /* Destroy tray icon */ - SendMessage(MSG_hwnd, WM_CLOSE, 0, 0); - } - - /* Close xvidcore library */ - CloseLib(); - - clock_t endClock = clock(); - if (((endClock - m_startClock) / CLOCKS_PER_SEC) > 3) { - SaveRegistryInfo((endClock - m_startClock) / (CLOCKS_PER_SEC / 10)); - } - - if ((MSG_hwnd != 0) && (m_tray_icon == 1)) { /* Final clean-up */ - MSG_hwnd = 0; - Sleep(200); - m_tray_icon = 0; -#if defined(XVID_USE_MFT) - if (m_thread_handle) { - TerminateThread(m_thread_handle, 0); - CloseHandle(m_thread_handle); - m_thread_handle = NULL; - } -#endif - } - -#if defined(XVID_USE_MFT) - DeleteCriticalSection(&m_mft_lock); -#endif -} - - - -/* check input type */ - -HRESULT CXvidDecoder::CheckInputType(const CMediaType * mtIn) -{ - DPRINTF("CheckInputType"); - BITMAPINFOHEADER * hdr; - - ar_x = ar_y = 0; - - if (*mtIn->Type() != MEDIATYPE_Video) - { - DPRINTF("Error: Unknown Type"); - CloseLib(); - return VFW_E_TYPE_NOT_ACCEPTED; - } - - if (m_hdll == NULL) - { - HRESULT hr = OpenLib(); - - if (FAILED(hr) || (m_hdll == NULL)) // Paranoid checks. - return VFW_E_TYPE_NOT_ACCEPTED; - } - - if (*mtIn->FormatType() == FORMAT_VideoInfo) - { - VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtIn->Format(); - hdr = &vih->bmiHeader; - } - else if (*mtIn->FormatType() == FORMAT_VideoInfo2) - { - VIDEOINFOHEADER2 * vih2 = (VIDEOINFOHEADER2 *) mtIn->Format(); - hdr = &vih2->bmiHeader; - if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { - ar_x = vih2->dwPictAspectRatioX; - ar_y = vih2->dwPictAspectRatioY; - } - DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); - } - else if (*mtIn->FormatType() == FORMAT_MPEG2Video) { - MPEG2VIDEOINFO * mpgvi = (MPEG2VIDEOINFO*)mtIn->Format(); - VIDEOINFOHEADER2 * vih2 = &mpgvi->hdr; - hdr = &vih2->bmiHeader; - if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { - ar_x = vih2->dwPictAspectRatioX; - ar_y = vih2->dwPictAspectRatioY; - } - DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); - - /* haali media splitter reports VOL information in the format header */ - - if (mpgvi->cbSequenceHeader>0) { - - xvid_dec_stats_t stats; - memset(&stats, 0, sizeof(stats)); - stats.version = XVID_VERSION; - - if (m_create.handle == NULL) { - if (xvid_decore_func == NULL) - return E_FAIL; - if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) { - DPRINTF("*** XVID_DEC_CREATE error"); - return E_FAIL; - } - } - - m_frame.general = 0; - m_frame.bitstream = (void*)mpgvi->dwSequenceHeader; - m_frame.length = mpgvi->cbSequenceHeader; - m_frame.output.csp = XVID_CSP_NULL; - - int ret = 0; - if ((ret=xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats)) >= 0) { - /* honour video dimensions reported in VOL header */ - if (stats.type == XVID_TYPE_VOL) { - hdr->biWidth = stats.data.vol.width; - hdr->biHeight = stats.data.vol.height; - } - } - if (ret == XVID_ERR_MEMORY) return E_FAIL; - } - } - else - { - DPRINTF("Error: Unknown FormatType"); - CloseLib(); - return VFW_E_TYPE_NOT_ACCEPTED; - } - if (hdr->biHeight < 0) - { - DPRINTF("colorspace: inverted input format not supported"); - } - - m_create.width = hdr->biWidth; - m_create.height = hdr->biHeight; - - switch(hdr->biCompression) - { - case FOURCC_mp4v : - case FOURCC_MP4V : - case FOURCC_lmp4 : - case FOURCC_LMP4 : - case FOURCC_rmp4 : - case FOURCC_RMP4 : - case FOURCC_smp4 : - case FOURCC_SMP4 : - case FOURCC_hdx4 : - case FOURCC_HDX4 : - if (!(g_config.supported_4cc & SUPPORT_MP4V)) { - CloseLib(); - return VFW_E_TYPE_NOT_ACCEPTED; - } - break; - case FOURCC_divx : - case FOURCC_DIVX : - case FOURCC_dx50 : - case FOURCC_DX50 : - if (!(g_config.supported_4cc & SUPPORT_DIVX)) { - CloseLib(); - return VFW_E_TYPE_NOT_ACCEPTED; - } - break; - case FOURCC_3ivx : - case FOURCC_3IVX : - case FOURCC_3iv0 : - case FOURCC_3IV0 : - case FOURCC_3iv1 : - case FOURCC_3IV1 : - case FOURCC_3iv2 : - case FOURCC_3IV2 : - if (!(g_config.supported_4cc & SUPPORT_3IVX)) { - CloseLib(); - return VFW_E_TYPE_NOT_ACCEPTED; - } - case FOURCC_xvid : - case FOURCC_XVID : - break; - - - default : - DPRINTF("Unknown fourcc: 0x%08x (%c%c%c%c)", - hdr->biCompression, - (hdr->biCompression)&0xff, - (hdr->biCompression>>8)&0xff, - (hdr->biCompression>>16)&0xff, - (hdr->biCompression>>24)&0xff); - CloseLib(); - return VFW_E_TYPE_NOT_ACCEPTED; - } - - m_create.fourcc = hdr->biCompression; - - return S_OK; -} - - -/* get list of supported output colorspaces */ - - -HRESULT CXvidDecoder::GetMediaType(int iPosition, CMediaType *mtOut) -{ - BITMAPINFOHEADER * bmih; - DPRINTF("GetMediaType"); - - if (m_pInput->IsConnected() == FALSE) - { - return E_UNEXPECTED; - } - - if (!g_config.videoinfo_compat) { - VIDEOINFOHEADER2 * vih = (VIDEOINFOHEADER2 *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER2)); - if (vih == NULL) return E_OUTOFMEMORY; - - ZeroMemory(vih, sizeof (VIDEOINFOHEADER2)); - bmih = &(vih->bmiHeader); - mtOut->SetFormatType(&FORMAT_VideoInfo2); - - if (ar_x != 0 && ar_y != 0) { - vih->dwPictAspectRatioX = ar_x; - vih->dwPictAspectRatioY = ar_y; - forced_ar = true; - } else { // just to be safe - vih->dwPictAspectRatioX = m_create.width; - vih->dwPictAspectRatioY = abs(m_create.height); - forced_ar = false; - } - if (interlaced) { - vih->dwInterlaceFlags = AMINTERLACE_IsInterlaced; - if (interlaced > 1) { - vih->dwInterlaceFlags |= AMINTERLACE_Field1First; - } - } - else { - vih->dwInterlaceFlags = 0; - } - } else { - - VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER)); - if (vih == NULL) return E_OUTOFMEMORY; - - ZeroMemory(vih, sizeof (VIDEOINFOHEADER)); - bmih = &(vih->bmiHeader); - mtOut->SetFormatType(&FORMAT_VideoInfo); - } - - bmih->biSize = sizeof(BITMAPINFOHEADER); - bmih->biWidth = m_create.width; - bmih->biHeight = m_create.height; - bmih->biPlanes = 1; - - if (iPosition < 0) return E_INVALIDARG; - - switch(iPosition) - { - - case 0: -if ( USE_YUY2 ) -{ - bmih->biCompression = MEDIASUBTYPE_YUY2.Data1; - bmih->biBitCount = 16; - mtOut->SetSubtype(&MEDIASUBTYPE_YUY2); - break; -} - case 1 : -if ( USE_YVYU ) -{ - bmih->biCompression = MEDIASUBTYPE_YVYU.Data1; - bmih->biBitCount = 16; - mtOut->SetSubtype(&MEDIASUBTYPE_YVYU); - break; -} - case 2 : -if ( USE_UYVY ) -{ - bmih->biCompression = MEDIASUBTYPE_UYVY.Data1; - bmih->biBitCount = 16; - mtOut->SetSubtype(&MEDIASUBTYPE_UYVY); - break; -} - case 3 : - if ( USE_IYUV ) -{ - bmih->biCompression = CLSID_MEDIASUBTYPE_IYUV.Data1; - bmih->biBitCount = 12; - mtOut->SetSubtype(&CLSID_MEDIASUBTYPE_IYUV); - break; -} - case 4 : -if ( USE_YV12 ) -{ - bmih->biCompression = MEDIASUBTYPE_YV12.Data1; - bmih->biBitCount = 12; - mtOut->SetSubtype(&MEDIASUBTYPE_YV12); - break; -} - case 5 : -if ( USE_RGB32 ) -{ - bmih->biCompression = BI_RGB; - bmih->biBitCount = 32; - mtOut->SetSubtype(&MEDIASUBTYPE_RGB32); - break; -} - case 6 : -if ( USE_RGB24 ) -{ - bmih->biCompression = BI_RGB; - bmih->biBitCount = 24; - mtOut->SetSubtype(&MEDIASUBTYPE_RGB24); - break; -} - case 7 : -if ( USE_RG555 ) -{ - bmih->biCompression = BI_RGB; - bmih->biBitCount = 16; - mtOut->SetSubtype(&MEDIASUBTYPE_RGB555); - break; -} - case 8 : -if ( USE_RG565 ) -{ - bmih->biCompression = BI_RGB; - bmih->biBitCount = 16; - mtOut->SetSubtype(&MEDIASUBTYPE_RGB565); - break; -} - default : - return VFW_S_NO_MORE_ITEMS; - } - - bmih->biSizeImage = GetBitmapSize(bmih); - - mtOut->SetType(&MEDIATYPE_Video); - mtOut->SetTemporalCompression(FALSE); - mtOut->SetSampleSize(bmih->biSizeImage); - - return S_OK; -} - - -/* (internal function) change colorspace */ -#define CALC_BI_STRIDE(width, bitcount) ((((width * bitcount) + 31) & ~31) >> 3) - -HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void *format, int *bitdepth, int noflip) -{ - DWORD biWidth; - *bitdepth = 32; - - if (formattype == FORMAT_VideoInfo) - { - VIDEOINFOHEADER * vih = (VIDEOINFOHEADER * )format; - biWidth = vih->bmiHeader.biWidth; - *bitdepth = vih->bmiHeader.biBitCount; - out_stride = CALC_BI_STRIDE(vih->bmiHeader.biWidth, vih->bmiHeader.biBitCount); - rgb_flip = (vih->bmiHeader.biHeight < 0 ? 0 : XVID_CSP_VFLIP); - } - else if (formattype == FORMAT_VideoInfo2) - { - VIDEOINFOHEADER2 * vih2 = (VIDEOINFOHEADER2 * )format; - biWidth = vih2->bmiHeader.biWidth; - *bitdepth = vih2->bmiHeader.biBitCount; - out_stride = CALC_BI_STRIDE(vih2->bmiHeader.biWidth, vih2->bmiHeader.biBitCount); - rgb_flip = (vih2->bmiHeader.biHeight < 0 ? 0 : XVID_CSP_VFLIP); - } - else - { - return S_FALSE; - } - - if (noflip) rgb_flip = 0; - - if (subtype == CLSID_MEDIASUBTYPE_IYUV) - { - DPRINTF("IYUV"); - rgb_flip = 0; - m_frame.output.csp = XVID_CSP_I420; - out_stride = CALC_BI_STRIDE(biWidth, 8); /* planar format fix */ - } - else if (subtype == MEDIASUBTYPE_YV12) - { - DPRINTF("YV12"); - rgb_flip = 0; - m_frame.output.csp = XVID_CSP_YV12; - out_stride = CALC_BI_STRIDE(biWidth, 8); /* planar format fix */ - } - else if (subtype == MEDIASUBTYPE_YUY2) - { - DPRINTF("YUY2"); - rgb_flip = 0; - m_frame.output.csp = XVID_CSP_YUY2; - } - else if (subtype == MEDIASUBTYPE_YVYU) - { - DPRINTF("YVYU"); - rgb_flip = 0; - m_frame.output.csp = XVID_CSP_YVYU; - } - else if (subtype == MEDIASUBTYPE_UYVY) - { - DPRINTF("UYVY"); - rgb_flip = 0; - m_frame.output.csp = XVID_CSP_UYVY; - } - else if (subtype == MEDIASUBTYPE_RGB32) - { - DPRINTF("RGB32"); - m_frame.output.csp = rgb_flip | XVID_CSP_BGRA; - } - else if (subtype == MEDIASUBTYPE_RGB24) - { - DPRINTF("RGB24"); - m_frame.output.csp = rgb_flip | XVID_CSP_BGR; - } - else if (subtype == MEDIASUBTYPE_RGB555) - { - DPRINTF("RGB555"); - m_frame.output.csp = rgb_flip | XVID_CSP_RGB555; - } - else if (subtype == MEDIASUBTYPE_RGB565) - { - DPRINTF("RGB565"); - m_frame.output.csp = rgb_flip | XVID_CSP_RGB565; - } - else if (subtype == GUID_NULL) - { - m_frame.output.csp = XVID_CSP_NULL; - } - else - { - return S_FALSE; - } - - return S_OK; -} - - -/* set output colorspace */ - -HRESULT CXvidDecoder::SetMediaType(PIN_DIRECTION direction, const CMediaType *pmt) -{ - int bitdepth; - DPRINTF("SetMediaType"); - - if (direction == PINDIR_OUTPUT) - { - return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format(), &bitdepth, 0); - } - - return S_OK; -} - - -/* check input<->output compatiblity */ - -HRESULT CXvidDecoder::CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut) -{ - DPRINTF("CheckTransform"); - - return S_OK; -} - -/* input/output pin connection complete */ - -HRESULT CXvidDecoder::CompleteConnect(PIN_DIRECTION direction, IPin *pReceivePin) -{ - DPRINTF("CompleteConnect"); - - if ((direction == PINDIR_OUTPUT) && (MSG_hwnd == 0) && (m_tray_icon == 0) && (g_config.bTrayIcon != 0)) - { - WNDCLASSEX wc; - - wc.cbSize = sizeof(WNDCLASSEX); - wc.lpfnWndProc = msg_proc; - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.cbWndExtra = 0; - wc.cbClsExtra = 0; - wc.hInstance = (HINSTANCE) g_xvid_hInst; - wc.hbrBackground = (HBRUSH) GetStockObject(NULL_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = "XVID_MSG_WINDOW"; - wc.hIcon = NULL; - wc.hIconSm = NULL; - wc.hCursor = NULL; - RegisterClassEx(&wc); - - MSG_hwnd = CreateWindowEx(0, "XVID_MSG_WINDOW", NULL, 0, CW_USEDEFAULT, - CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE) g_xvid_hInst, NULL); - - /* display the tray icon */ - NOTIFYICONDATA nid; - ZeroMemory(&nid,sizeof(NOTIFYICONDATA)); - - nid.cbSize = sizeof(NOTIFYICONDATA); - nid.hWnd = MSG_hwnd; - nid.uID = 1456; - nid.uVersion = NOTIFYICON_VERSION; - nid.uCallbackMessage = WM_ICONMESSAGE; - nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); - strcpy_s(nid.szTip, 19, "Xvid Video Decoder"); - nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP | NIF_SHOWTIP; - - Shell_NotifyIcon(NIM_ADD, &nid); - Shell_NotifyIcon(NIM_SETVERSION, &nid); - - DestroyIcon(nid.hIcon); - m_tray_icon = 1; - } - - return S_OK; -} - -/* input/output pin disconnected */ -HRESULT CXvidDecoder::BreakConnect(PIN_DIRECTION direction) -{ - DPRINTF("BreakConnect"); - - return S_OK; -} - -/* alloc output buffer */ - -HRESULT CXvidDecoder::DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) -{ - DPRINTF("DecideBufferSize"); - HRESULT result; - ALLOCATOR_PROPERTIES ppropActual; - - if (m_pInput->IsConnected() == FALSE) - { - return E_UNEXPECTED; - } - - ppropInputRequest->cBuffers = 1; - ppropInputRequest->cbBuffer = m_create.width * m_create.height * 4; - // cbAlign causes problems with the resize filter */ - // ppropInputRequest->cbAlign = 16; - ppropInputRequest->cbPrefix = 0; - - result = pAlloc->SetProperties(ppropInputRequest, &ppropActual); - if (result != S_OK) - { - return result; - } - - if (ppropActual.cbBuffer < ppropInputRequest->cbBuffer) - { - return E_FAIL; - } - - return S_OK; -} - - -/* decode frame */ - -HRESULT CXvidDecoder::Transform(IMediaSample *pIn, IMediaSample *pOut) -{ - DPRINTF("Transform"); - xvid_dec_stats_t stats; - int length; - - memset(&stats, 0, sizeof(stats)); - stats.version = XVID_VERSION; - - if (m_create.handle == NULL) - { - if (xvid_decore_func == NULL) - return E_FAIL; - - if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) - { - DPRINTF("*** XVID_DEC_CREATE error"); - return E_FAIL; - } - } - - AM_MEDIA_TYPE * mtOut; - pOut->GetMediaType(&mtOut); - if (mtOut != NULL) - { - int bitdepth; - HRESULT result; - - result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat, &bitdepth, 0); - DeleteMediaType(mtOut); - - if (result != S_OK) - { - DPRINTF("*** ChangeColorspace error"); - return result; - } - } - - m_frame.length = pIn->GetActualDataLength(); - if (pIn->GetPointer((BYTE**)&m_frame.bitstream) != S_OK) - { - return S_FALSE; - } - - if (pOut->GetPointer((BYTE**)&m_frame.output.plane[0]) != S_OK) - { - return S_FALSE; - } - - m_frame.general = XVID_LOWDELAY; - - if (pIn->IsDiscontinuity() == S_OK) - m_frame.general |= XVID_DISCONTINUITY; - - if (g_config.nDeblock_Y) - m_frame.general |= XVID_DEBLOCKY; - - if (g_config.nDeblock_UV) - m_frame.general |= XVID_DEBLOCKUV; - - if (g_config.nDering_Y) - m_frame.general |= XVID_DERINGY; - - if (g_config.nDering_UV) - m_frame.general |= XVID_DERINGUV; - - if (g_config.nFilmEffect) - m_frame.general |= XVID_FILMEFFECT; - - m_frame.brightness = g_config.nBrightness; - - m_frame.output.csp &= ~XVID_CSP_VFLIP; - m_frame.output.csp |= rgb_flip^(g_config.nFlipVideo ? XVID_CSP_VFLIP : 0); - m_frame.output.stride[0] = out_stride; - - // Paranoid check. - if (xvid_decore_func == NULL) - return E_FAIL; - - -repeat : - - if (pIn->IsPreroll() != S_OK) - { - length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); - - if (length == XVID_ERR_MEMORY) - return E_FAIL; - else if (length < 0) - { - DPRINTF("*** XVID_DEC_DECODE"); - return S_FALSE; - } else if ((g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1 && forced_ar == false) || !!(interlaced)){ - - if (stats.type != XVID_TYPE_NOTHING) { /* dont attempt to set vmr aspect ratio if no frame was returned by decoder */ - // inspired by minolta! works for VMR 7 + 9 - IMediaSample2 *pOut2 = NULL; - AM_SAMPLE2_PROPERTIES outProp2; - if (SUCCEEDED(pOut->QueryInterface(IID_IMediaSample2, (void **)&pOut2)) && - SUCCEEDED(pOut2->GetProperties(FIELD_OFFSET(AM_SAMPLE2_PROPERTIES, tStart), (PBYTE)&outProp2))) - { - CMediaType mtOut2 = m_pOutput->CurrentMediaType(); - VIDEOINFOHEADER2* vihOut2 = (VIDEOINFOHEADER2*)mtOut2.Format(); - - if (*mtOut2.FormatType() == FORMAT_VideoInfo2) - { - int need_format_change = 0; - - if (vihOut2->dwPictAspectRatioX != ar_x || vihOut2->dwPictAspectRatioY != ar_y) - { - vihOut2->dwPictAspectRatioX = ar_x; - vihOut2->dwPictAspectRatioY = ar_y; - need_format_change = 1; - } - if ((interlaced) && !(vihOut2->dwInterlaceFlags & AMINTERLACE_IsInterlaced)) - { - vihOut2->dwInterlaceFlags = AMINTERLACE_IsInterlaced; - if (interlaced > 2) { - vihOut2->dwInterlaceFlags |= AMINTERLACE_Field1First; - } - need_format_change = 1; - } - else if (!interlaced && !!(vihOut2->dwInterlaceFlags & AMINTERLACE_IsInterlaced)){ - vihOut2->dwInterlaceFlags = 0; - need_format_change = 1; - } - - if (need_format_change) { - pOut2->SetMediaType(&mtOut2); - m_pOutput->SetMediaType(&mtOut2); - } - } - pOut2->Release(); - } - } - } - } - else - { /* Preroll frame - won't be displayed */ - int tmp = m_frame.output.csp; - int tmp_gen = m_frame.general; - - m_frame.output.csp = XVID_CSP_NULL; - - /* Disable postprocessing to speed-up seeking */ - m_frame.general &= ~XVID_DEBLOCKY; - m_frame.general &= ~XVID_DEBLOCKUV; - /*m_frame.general &= ~XVID_DERING;*/ - m_frame.general &= ~XVID_FILMEFFECT; - - length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); - if (length == XVID_ERR_MEMORY) - return E_FAIL; - else if (length < 0) - { - DPRINTF("*** XVID_DEC_DECODE"); - return S_FALSE; - } - - m_frame.output.csp = tmp; - m_frame.general = tmp_gen; - } - - if (stats.type == XVID_TYPE_NOTHING && length > 0) { - DPRINTF(" B-Frame decoder lag"); - return S_FALSE; - } - - - if (stats.type == XVID_TYPE_VOL) - { - if (stats.data.vol.width != m_create.width || - stats.data.vol.height != m_create.height) - { - DPRINTF("TODO: auto-resize"); - return S_FALSE; - } - - pOut->SetSyncPoint(TRUE); - - if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { /* auto */ - int par_x, par_y; - if (stats.data.vol.par == XVID_PAR_EXT) { - par_x = stats.data.vol.par_width; - par_y = stats.data.vol.par_height; - } else { - par_x = PARS[stats.data.vol.par-1][0]; - par_y = PARS[stats.data.vol.par-1][1]; - } - - ar_x = par_x * stats.data.vol.width; - ar_y = par_y * stats.data.vol.height; - } - - if (!!(stats.data.vol.general & XVID_VOL_INTERLACING)) { - interlaced = (stats.data.vop.general & XVID_VOP_TOPFIELDFIRST) ? 2 : 1; - } - else if (interlaced > 0) { - interlaced = 0; - } - - m_frame.bitstream = (BYTE*)m_frame.bitstream + length; - m_frame.length -= length; - goto repeat; - } - - if (pIn->IsPreroll() == S_OK) { - return S_FALSE; - } - - return S_OK; -} - - -/* get property page list */ - -STDMETHODIMP CXvidDecoder::GetPages(CAUUID * pPages) -{ - DPRINTF("GetPages"); - - pPages->cElems = 1; - pPages->pElems = (GUID *)CoTaskMemAlloc(pPages->cElems * sizeof(GUID)); - if (pPages->pElems == NULL) - { - return E_OUTOFMEMORY; - } - pPages->pElems[0] = CLSID_CABOUT; - - return S_OK; -} - - -/* cleanup pages */ - -STDMETHODIMP CXvidDecoder::FreePages(CAUUID * pPages) -{ - DPRINTF("FreePages"); - CoTaskMemFree(pPages->pElems); - return S_OK; -} - -/*=============================================================================== -// MFT Interface -//=============================================================================*/ -#if defined(XVID_USE_MFT) -#include // _I64_MAX -#define INVALID_TIME _I64_MAX - -HRESULT CXvidDecoder::MFTGetStreamLimits(DWORD *pdwInputMinimum, DWORD *pdwInputMaximum, DWORD *pdwOutputMinimum, DWORD *pdwOutputMaximum) -{ - DPRINTF("(MFT)GetStreamLimits"); - - if ((pdwInputMinimum == NULL) || (pdwInputMaximum == NULL) || (pdwOutputMinimum == NULL) || (pdwOutputMaximum == NULL)) - return E_POINTER; - - /* Just a fixed number of streams allowed */ - *pdwInputMinimum = *pdwInputMaximum = 1; - *pdwOutputMinimum = *pdwOutputMaximum = 1; - - return S_OK; -} - -HRESULT CXvidDecoder::MFTGetStreamCount(DWORD *pcInputStreams, DWORD *pcOutputStreams) -{ - DPRINTF("(MFT)GetStreamCount"); - - if ((pcInputStreams == NULL) || (pcOutputStreams == NULL)) - return E_POINTER; - - /* We have a fixed number of streams */ - *pcInputStreams = 1; - *pcOutputStreams = 1; - - return S_OK; -} - -HRESULT CXvidDecoder::MFTGetStreamIDs(DWORD dwInputIDArraySize, DWORD *pdwInputIDs, DWORD dwOutputIDArraySize, DWORD *pdwOutputIDs) -{ - DPRINTF("(MFT)GetStreamIDs"); - return E_NOTIMPL; /* We have fixed number of streams, so stream ID match stream index */ -} - -HRESULT CXvidDecoder::MFTGetInputStreamInfo(DWORD dwInputStreamID, MFT_INPUT_STREAM_INFO *pStreamInfo) -{ - DPRINTF("(MFT)GetInputStreamInfo"); - - if (pStreamInfo == NULL) - return E_POINTER; - - if (dwInputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - EnterCriticalSection(&m_mft_lock); - - pStreamInfo->dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER; - pStreamInfo->hnsMaxLatency = 0; - - pStreamInfo->cbSize = 1; /* Need atleast 1 byte input */ - pStreamInfo->cbMaxLookahead = 0; - pStreamInfo->cbAlignment = 1; - - LeaveCriticalSection(&m_mft_lock); - return S_OK; -} - -HRESULT CXvidDecoder::MFTGetOutputStreamInfo(DWORD dwOutputStreamID, MFT_OUTPUT_STREAM_INFO *pStreamInfo) -{ - DPRINTF("(MFT)GetOutputStreamInfo"); - - if (pStreamInfo == NULL) - return E_POINTER; - - if (dwOutputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - EnterCriticalSection(&m_mft_lock); - - pStreamInfo->dwFlags = MFT_OUTPUT_STREAM_WHOLE_SAMPLES | MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE | MFT_OUTPUT_STREAM_DISCARDABLE; - - if (m_pOutputType == NULL) { - pStreamInfo->cbSize = 0; - pStreamInfo->cbAlignment = 0; - } - else { - pStreamInfo->cbSize = (m_create.width * abs(m_create.height) * m_pOutputTypeBPP) >> 3; - pStreamInfo->cbAlignment = 1; - } - - LeaveCriticalSection(&m_mft_lock); - return S_OK; -} - -HRESULT CXvidDecoder::GetAttributes(IMFAttributes** pAttributes) -{ - DPRINTF("(MFT)GetAttributes"); - return E_NOTIMPL; /* We don't support any attributes */ -} - -HRESULT CXvidDecoder::GetInputStreamAttributes(DWORD dwInputStreamID, IMFAttributes **ppAttributes) -{ - DPRINTF("(MFT)GetInputStreamAttributes"); - return E_NOTIMPL; /* We don't support any attributes */ -} - -HRESULT CXvidDecoder::GetOutputStreamAttributes(DWORD dwOutputStreamID, IMFAttributes **ppAttributes) -{ - DPRINTF("(MFT)GetOutputStreamAttributes"); - return E_NOTIMPL; /* We don't support any attributes */ -} - -HRESULT CXvidDecoder::MFTDeleteInputStream(DWORD dwStreamID) -{ - DPRINTF("(MFT)DeleteInputStream"); - return E_NOTIMPL; /* We have a fixed number of streams */ -} - -HRESULT CXvidDecoder::MFTAddInputStreams(DWORD cStreams, DWORD *adwStreamIDs) -{ - DPRINTF("(MFT)AddInputStreams"); - return E_NOTIMPL; /* We have a fixed number of streams */ -} - -HRESULT CXvidDecoder::MFTGetInputAvailableType(DWORD dwInputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType) -{ - DPRINTF("(MFT)GetInputAvailableType"); - - if (dwInputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - DWORD i = 0; - GUID *bs_guid_table[32]; - - bs_guid_table[i++] = (GUID *)&CLSID_XVID; - bs_guid_table[i++] = (GUID *)&CLSID_XVID_UC; - - if (g_config.supported_4cc & SUPPORT_3IVX) { - bs_guid_table[i++] = (GUID *)&CLSID_3IVX; - bs_guid_table[i++] = (GUID *)&CLSID_3IVX_UC; - bs_guid_table[i++] = (GUID *)&CLSID_3IV0; - bs_guid_table[i++] = (GUID *)&CLSID_3IV0_UC; - bs_guid_table[i++] = (GUID *)&CLSID_3IV1; - bs_guid_table[i++] = (GUID *)&CLSID_3IV1_UC; - bs_guid_table[i++] = (GUID *)&CLSID_3IV2; - bs_guid_table[i++] = (GUID *)&CLSID_3IV2_UC; - } - if (g_config.supported_4cc & SUPPORT_DIVX) { - bs_guid_table[i++] = (GUID *)&CLSID_DIVX; - bs_guid_table[i++] = (GUID *)&CLSID_DIVX_UC; - bs_guid_table[i++] = (GUID *)&CLSID_DX50; - bs_guid_table[i++] = (GUID *)&CLSID_DX50_UC; - } - if (g_config.supported_4cc & SUPPORT_MP4V) { - bs_guid_table[i++] = (GUID *)&CLSID_MP4V; - bs_guid_table[i++] = (GUID *)&CLSID_MP4V_UC; - bs_guid_table[i++] = (GUID *)&CLSID_LMP4; - bs_guid_table[i++] = (GUID *)&CLSID_LMP4_UC; - bs_guid_table[i++] = (GUID *)&CLSID_RMP4; - bs_guid_table[i++] = (GUID *)&CLSID_RMP4_UC; - bs_guid_table[i++] = (GUID *)&CLSID_SMP4; - bs_guid_table[i++] = (GUID *)&CLSID_SMP4_UC; - bs_guid_table[i++] = (GUID *)&CLSID_HDX4; - bs_guid_table[i++] = (GUID *)&CLSID_HDX4_UC; - } - - const GUID *subtype; - if (dwTypeIndex < i) { - subtype = bs_guid_table[dwTypeIndex]; - } - else { - return MF_E_NO_MORE_TYPES; - } - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - - if (ppType) { - IMFMediaType *pInputType = NULL; - hr = MFCreateMediaType(&pInputType); - - if (SUCCEEDED(hr)) - hr = pInputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video); - - if (SUCCEEDED(hr)) - hr = pInputType->SetGUID(MF_MT_SUBTYPE, *subtype); - - if (SUCCEEDED(hr)) { - *ppType = pInputType; - (*ppType)->AddRef(); - } - if (pInputType) pInputType->Release(); - } - - LeaveCriticalSection(&m_mft_lock); - - return hr; -} - -HRESULT CXvidDecoder::MFTGetOutputAvailableType(DWORD dwOutputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType) -{ - DPRINTF("(MFT)GetOutputAvailableType"); - - if (ppType == NULL) - return E_INVALIDARG; - - if (dwOutputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - if (dwTypeIndex < 0) return E_INVALIDARG; - - GUID csp; - int bitdepth = 8; - switch(dwTypeIndex) - { - case 0: -if ( USE_YUY2 ) -{ - csp = MFVideoFormat_YUY2; - bitdepth = 4; - break; -} - case 1: -if ( USE_YVYU ) -{ - csp = MFVideoFormat_YVYU; - bitdepth = 4; - break; -} - case 2 : -if ( USE_UYVY ) -{ - csp = MFVideoFormat_UYVY; - bitdepth = 4; - break; -} - case 3 : - if ( USE_IYUV ) -{ - csp = MFVideoFormat_IYUV; - bitdepth = 3; - break; -} - case 4 : -if ( USE_YV12 ) -{ - csp = MFVideoFormat_YV12; - bitdepth = 3; - break; -} - case 5 : -if ( USE_RGB32 ) -{ - csp = MFVideoFormat_RGB32; - bitdepth = 8; - break; -} - case 6 : -if ( USE_RGB24 ) -{ - csp = MFVideoFormat_RGB24; - bitdepth = 6; - break; -} - case 7 : -if ( USE_RG555 ) -{ - csp = MFVideoFormat_RGB555; - bitdepth = 4; - break; -} - case 8 : -if ( USE_RG565 ) -{ - csp = MFVideoFormat_RGB565; - bitdepth = 4; - break; -} - default : - return MF_E_NO_MORE_TYPES; - } - - if (m_pInputType == NULL) - return MF_E_TRANSFORM_TYPE_NOT_SET; - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - - IMFMediaType *pOutputType = NULL; - hr = MFCreateMediaType(&pOutputType); - - if (SUCCEEDED(hr)) { - hr = pOutputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video); - } - - if (SUCCEEDED(hr)) { - hr = pOutputType->SetGUID(MF_MT_SUBTYPE, csp); - } - - if (SUCCEEDED(hr)) { - hr = pOutputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE); - } - - if (SUCCEEDED(hr)) { - hr = pOutputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE); - } - - if (SUCCEEDED(hr)) { - hr = pOutputType->SetUINT32(MF_MT_SAMPLE_SIZE, (abs(m_create.height) * m_create.width * bitdepth) >> 1); - } - - if (SUCCEEDED(hr)) { - hr = MFSetAttributeSize(pOutputType, MF_MT_FRAME_SIZE, m_create.width, abs(m_create.height)); - } - - if (SUCCEEDED(hr)) { - hr = MFSetAttributeRatio(pOutputType, MF_MT_FRAME_RATE, m_frameRate.Numerator, m_frameRate.Denominator); - } - - if (SUCCEEDED(hr)) { - if (interlaced > 1) { - hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_FieldInterleavedUpperFirst); - } - else if (interlaced) { - hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_FieldInterleavedLowerFirst); - } - else { - hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive); - } - } - - if (SUCCEEDED(hr)) { - hr = MFSetAttributeRatio(pOutputType, MF_MT_PIXEL_ASPECT_RATIO, ar_x, ar_y); - } - - if (SUCCEEDED(hr)) { - *ppType = pOutputType; - (*ppType)->AddRef(); - } - - if (pOutputType) pOutputType->Release(); - - LeaveCriticalSection(&m_mft_lock); - return hr; -} - -HRESULT CXvidDecoder::MFTSetInputType(DWORD dwInputStreamID, IMFMediaType *pType, DWORD dwFlags) -{ - DPRINTF("(MFT)SetInputType"); - - if (dwInputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - if (dwFlags & ~MFT_SET_TYPE_TEST_ONLY) - return E_INVALIDARG; - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - - /* Actually set the type or just test it? */ - BOOL bReallySet = ((dwFlags & MFT_SET_TYPE_TEST_ONLY) == 0); - - /* If we have samples pending the type can't be changed right now */ - if (HasPendingOutput()) - hr = MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING; - - if (SUCCEEDED(hr)) { - if (pType) { /* Check the type */ - hr = OnCheckInputType(pType); - } - } - - if (SUCCEEDED(hr)) { - if (bReallySet) { /* Set the type if needed */ - hr = OnSetInputType(pType); - } - } - - LeaveCriticalSection(&m_mft_lock); - return hr; -} - -DWORD WINAPI CreateTrayIcon(LPVOID lpParameter) -{ - WNDCLASSEX wc; - - wc.cbSize = sizeof(WNDCLASSEX); - wc.lpfnWndProc = msg_proc; - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.cbWndExtra = 0; - wc.cbClsExtra = 0; - wc.hInstance = (HINSTANCE)g_xvid_hInst; - wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = "XVID_MSG_WINDOW"; - wc.hIcon = NULL; - wc.hIconSm = NULL; - wc.hCursor = NULL; - RegisterClassEx(&wc); - - MSG_hwnd = CreateWindowEx(0, "XVID_MSG_WINDOW", NULL, 0, CW_USEDEFAULT, - CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE)g_xvid_hInst, NULL); - - /* display the tray icon */ - NOTIFYICONDATA nid; - ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); - - nid.cbSize = sizeof(NOTIFYICONDATA); - nid.hWnd = MSG_hwnd; - nid.uID = 1456; - nid.uVersion = NOTIFYICON_VERSION; - nid.uCallbackMessage = WM_ICONMESSAGE; - nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); - strcpy_s(nid.szTip, 19, "Xvid Video Decoder"); - nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP | NIF_SHOWTIP; - - Shell_NotifyIcon(NIM_ADD, &nid); - Shell_NotifyIcon(NIM_SETVERSION, &nid); - - DestroyIcon(nid.hIcon); - - MSG msg; - while (MSG_hwnd && GetMessage(&msg, MSG_hwnd, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - return 0; -} - -HRESULT CXvidDecoder::MFTSetOutputType(DWORD dwOutputStreamID, IMFMediaType *pType, DWORD dwFlags) -{ - DPRINTF("(MFT)SetOutputType"); - - if (dwOutputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - if (dwFlags & ~MFT_SET_TYPE_TEST_ONLY) - return E_INVALIDARG; - - HRESULT hr = S_OK; - - EnterCriticalSection(&m_mft_lock); - - /* Actually set the type or just test it? */ - BOOL bReallySet = ((dwFlags & MFT_SET_TYPE_TEST_ONLY) == 0); - - /* If we have samples pending the type can't be changed right now */ - if (HasPendingOutput()) - hr = MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING; - - int bitdepth; - if (SUCCEEDED(hr)) { - if (pType) { /* Check the type */ - AM_MEDIA_TYPE *am; - hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); - - if (SUCCEEDED(hr)) { - if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat, &bitdepth, 1))) { - DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); - return MF_E_INVALIDTYPE; - } - - CoTaskMemFree(am->pbFormat); - CoTaskMemFree(am); - } - } - } - - if (SUCCEEDED(hr)) { - if (bReallySet) { /* Set the type if needed */ - hr = OnSetOutputType(pType, bitdepth); - } - } - - if (SUCCEEDED(hr) && (MSG_hwnd == 0) && (m_tray_icon == 0) && (g_config.bTrayIcon != 0)) - { - m_thread_handle = CreateThread(NULL, 0, CreateTrayIcon, NULL, 0, NULL); /* Create message passing window */ - - if (m_thread_handle) - m_tray_icon = 1; - } - - LeaveCriticalSection(&m_mft_lock); - - return hr; -} - -HRESULT CXvidDecoder::MFTGetInputCurrentType(DWORD dwInputStreamID, IMFMediaType **ppType) -{ - DPRINTF("(MFT)GetInputCurrentType"); - - if (ppType == NULL) - return E_POINTER; - - if (dwInputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - - if (!m_pInputType) - hr = MF_E_TRANSFORM_TYPE_NOT_SET; - - if (SUCCEEDED(hr)) { - *ppType = m_pInputType; - (*ppType)->AddRef(); - } - - LeaveCriticalSection(&m_mft_lock); - return hr; -} - -HRESULT CXvidDecoder::MFTGetOutputCurrentType(DWORD dwOutputStreamID, IMFMediaType **ppType) -{ - DPRINTF("(MFT)GetOutputCurrentType"); - - if (ppType == NULL) - return E_POINTER; - - if (dwOutputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - - if (!m_pOutputType) - hr = MF_E_TRANSFORM_TYPE_NOT_SET; - - if (SUCCEEDED(hr)) { - *ppType = m_pOutputType; - (*ppType)->AddRef(); - } - - LeaveCriticalSection(&m_mft_lock); - return hr; -} - -HRESULT CXvidDecoder::MFTGetInputStatus(DWORD dwInputStreamID, DWORD *pdwFlags) -{ - DPRINTF("(MFT)GetInputStatus"); - - if (pdwFlags == NULL) - return E_POINTER; - - if (dwInputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - EnterCriticalSection(&m_mft_lock); - - /* If there's pending output samples we don't accept new - input data until ProcessOutput() or Flush() was called */ - if (!HasPendingOutput()) { - *pdwFlags = MFT_INPUT_STATUS_ACCEPT_DATA; - } - else { - *pdwFlags = 0; - } - - LeaveCriticalSection(&m_mft_lock); - - return S_OK; -} - -HRESULT CXvidDecoder::MFTGetOutputStatus(DWORD *pdwFlags) -{ - DPRINTF("(MFT)GetOutputStatus"); - - if (pdwFlags == NULL) - return E_POINTER; - - EnterCriticalSection(&m_mft_lock); - - /* We can render an output sample only after we - have decoded one */ - if (HasPendingOutput()) { - *pdwFlags = MFT_OUTPUT_STATUS_SAMPLE_READY; - } - else { - *pdwFlags = 0; - } - - LeaveCriticalSection(&m_mft_lock); - - return S_OK; -} - -HRESULT CXvidDecoder::MFTSetOutputBounds(LONGLONG hnsLowerBound, LONGLONG hnsUpperBound) -{ - DPRINTF("(MFT)SetOutputBounds"); - return E_NOTIMPL; -} - -HRESULT CXvidDecoder::MFTProcessEvent(DWORD dwInputStreamID, IMFMediaEvent *pEvent) -{ - DPRINTF("(MFT)ProcessEvent"); - return E_NOTIMPL; /* We don't handle any stream events */ -} - -HRESULT CXvidDecoder::MFTProcessMessage(MFT_MESSAGE_TYPE eMessage, ULONG_PTR ulParam) -{ - DPRINTF("(MFT)ProcessMessage"); - HRESULT hr = S_OK; - - EnterCriticalSection(&m_mft_lock); - - switch (eMessage) - { - case MFT_MESSAGE_COMMAND_FLUSH: - if (m_create.handle != NULL) { - DPRINTF("(MFT)CommandFlush"); - - xvid_dec_stats_t stats; - int used_bytes; - - memset(&stats, 0, sizeof(stats)); - stats.version = XVID_VERSION; - - int csp = m_frame.output.csp; - - m_frame.output.csp = XVID_CSP_INTERNAL; - m_frame.bitstream = NULL; - m_frame.length = -1; - m_frame.general = XVID_LOWDELAY; - - do { - used_bytes = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); - } while(used_bytes>=0 && stats.type <= 0); - - m_frame.output.csp = csp; - m_frame.output.plane[1] = NULL; /* Don't display flushed samples */ - - //m_timestamp = INVALID_TIME; - //m_timelength = INVALID_TIME; - //m_rtFrame = 0; - } - break; - - case MFT_MESSAGE_COMMAND_DRAIN: - m_discont = 1; /* Set discontinuity flag */ - m_rtFrame = 0; - break; - - case MFT_MESSAGE_SET_D3D_MANAGER: - hr = E_NOTIMPL; - break; - - case MFT_MESSAGE_NOTIFY_BEGIN_STREAMING: - case MFT_MESSAGE_NOTIFY_END_STREAMING: - break; - - case MFT_MESSAGE_NOTIFY_START_OF_STREAM: - case MFT_MESSAGE_NOTIFY_END_OF_STREAM: - break; - } - - LeaveCriticalSection(&m_mft_lock); - - return hr; -} - -HRESULT CXvidDecoder::MFTProcessInput(DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags) -{ - DPRINTF("(MFT)ProcessInput"); - - if (pSample == NULL) - return E_POINTER; - - if (dwInputStreamID != 0) - return MF_E_INVALIDSTREAMNUMBER; - - if (dwFlags != 0) - return E_INVALIDARG; - - if (!m_pInputType || !m_pOutputType) { - return MF_E_NOTACCEPTING; /* Must have set input and output types */ - } - else if (HasPendingOutput()) { - return MF_E_NOTACCEPTING; /* We still have output samples to render */ - } - - xvid_dec_stats_t stats; - int length; - - memset(&stats, 0, sizeof(stats)); - stats.version = XVID_VERSION; - - if (m_create.handle == NULL) - { - if (xvid_decore_func == NULL) - return E_FAIL; - if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) - { - DPRINTF("*** XVID_DEC_CREATE error"); - return E_FAIL; - } - } - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - IMFMediaBuffer *pBuffer; - - int need_format_change = 0; - - if (SUCCEEDED(hr)) { - hr = pSample->ConvertToContiguousBuffer(&pBuffer); - } - - if (SUCCEEDED(hr)) { - hr = pBuffer->Lock((BYTE**)&m_frame.bitstream, NULL, (DWORD *)&m_frame.length); - } - - m_frame.general = XVID_LOWDELAY; - - if (m_discont == 1) { - m_frame.general |= XVID_DISCONTINUITY; - m_discont = 0; - } - - if (g_config.nDeblock_Y) - m_frame.general |= XVID_DEBLOCKY; - - if (g_config.nDeblock_UV) - m_frame.general |= XVID_DEBLOCKUV; - - if (g_config.nDering_Y) - m_frame.general |= XVID_DERINGY; - - if (g_config.nDering_UV) - m_frame.general |= XVID_DERINGUV; - - if (g_config.nFilmEffect) - m_frame.general |= XVID_FILMEFFECT; - - m_frame.brightness = g_config.nBrightness; - - m_frame.output.csp &= ~XVID_CSP_VFLIP; - m_frame.output.csp |= rgb_flip^(g_config.nFlipVideo ? XVID_CSP_VFLIP : 0); - - int csp = m_frame.output.csp; - m_frame.output.csp = XVID_CSP_INTERNAL; - - // Paranoid check. - if (xvid_decore_func == NULL) { - hr = E_FAIL; - goto END_LOOP; - } - -repeat : - length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); - - if (length == XVID_ERR_MEMORY) { - hr = E_FAIL; - goto END_LOOP; - } - else if (length < 0) - { - DPRINTF("*** XVID_DEC_DECODE"); - goto END_LOOP; - } - - if (stats.type == XVID_TYPE_NOTHING && length > 0) { - DPRINTF(" B-Frame decoder lag"); - m_frame.output.plane[1] = NULL; - goto END_LOOP; - } - - if (stats.type == XVID_TYPE_VOL) - { - if (stats.data.vol.width != m_create.width || - stats.data.vol.height != m_create.height) - { - DPRINTF("TODO: auto-resize"); - m_frame.output.plane[1] = NULL; - hr = E_FAIL; - } - - if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { /* auto */ - int par_x, par_y; - if (stats.data.vol.par == XVID_PAR_EXT) { - par_x = stats.data.vol.par_width; - par_y = stats.data.vol.par_height; - } else { - par_x = PARS[stats.data.vol.par-1][0]; - par_y = PARS[stats.data.vol.par-1][1]; - } - - ar_x = par_x; - ar_y = par_y; - - need_format_change = 1; - } - - if (!!(stats.data.vol.general & XVID_VOL_INTERLACING)) { - interlaced = (stats.data.vop.general & XVID_VOP_TOPFIELDFIRST) ? 2 : 1; - need_format_change = 1; - } - else { - if (interlaced > 0) { - interlaced = 0; - need_format_change = 1; - } - } - - m_frame.bitstream = (BYTE*)m_frame.bitstream + length; - m_frame.length -= length; - goto repeat; - } - -END_LOOP: - m_frame.output.csp = csp; - - if (pBuffer) { - pBuffer->Unlock(); - pBuffer->Release(); - } - - if (SUCCEEDED(hr)) { - /* Try to get a timestamp */ - if (FAILED(pSample->GetSampleTime(&m_timestamp))) - m_timestamp = INVALID_TIME; - - if (FAILED(pSample->GetSampleDuration(&m_timelength))) { - m_timelength = INVALID_TIME; - } - if (m_timestamp != INVALID_TIME && stats.type == XVID_TYPE_IVOP) { - m_rtFrame = m_timestamp; - } - } - - if (need_format_change) { - IMFMediaType *pOutputType = NULL; - hr = MFTGetOutputCurrentType(0, &pOutputType); - - if (SUCCEEDED(hr)) { - if (interlaced > 1) { - hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_FieldInterleavedUpperFirst); - } - else if (interlaced) { - hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_FieldInterleavedLowerFirst); - } - else { - hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive); - } - } - - if (SUCCEEDED(hr)) { - hr = MFSetAttributeRatio(pOutputType, MF_MT_PIXEL_ASPECT_RATIO, ar_x, ar_y); - } - - if (SUCCEEDED(hr)) { - MFTSetOutputType(0, pOutputType, 0); - } - - if (pOutputType) pOutputType->Release(); - } - - LeaveCriticalSection(&m_mft_lock); - - return hr; -} - -HRESULT CXvidDecoder::MFTProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount, MFT_OUTPUT_DATA_BUFFER *pOutputSamples, DWORD *pdwStatus) -{ - DPRINTF("(MFT)ProcessOutput"); - - /* Preroll in MFT ?? - Flags ?? -> TODO... */ - if (dwFlags != 0) - return E_INVALIDARG; - - if (pOutputSamples == NULL || pdwStatus == NULL) - return E_POINTER; - - if (cOutputBufferCount != 1) /* Must be exactly one output buffer */ - return E_INVALIDARG; - - if (pOutputSamples[0].pSample == NULL) /* Must have a sample */ - return E_INVALIDARG; - - if (!HasPendingOutput()) { /* If there's no sample we need to decode one first */ - return MF_E_TRANSFORM_NEED_MORE_INPUT; - } - - EnterCriticalSection(&m_mft_lock); - - HRESULT hr = S_OK; - - BYTE *Dst = NULL; - DWORD buffer_size; - LONG stride = (m_pOutputTypeBPP < 15) ? CALC_BI_STRIDE(m_create.width, 8) : CALC_BI_STRIDE(m_create.width, m_pOutputTypeBPP); - IMFMediaBuffer *pOutput = NULL; - IMF2DBuffer *pOutput2D = NULL; - - if (SUCCEEDED(hr)) { - hr = pOutputSamples[0].pSample->GetBufferByIndex(0, &pOutput); /* Get output buffer */ - } - - if (SUCCEEDED(hr)) { - hr = pOutput->GetMaxLength(&buffer_size); - } - - if (SUCCEEDED(hr)) { - hr = pOutput->QueryInterface(IID_IMF2DBuffer, (void **)&pOutput2D); - } - - if (SUCCEEDED(hr)) { - hr = pOutput2D->Lock2D(&Dst, &stride); - } - else { - hr = pOutput->Lock(&Dst, NULL, NULL); - } - - if (SUCCEEDED(hr)) { - xvid_gbl_convert_t convert; - - memset(&convert, 0, sizeof(convert)); - convert.version = XVID_VERSION; - - convert.input.csp = XVID_CSP_INTERNAL; - convert.input.plane[0] = m_frame.output.plane[0]; - convert.input.plane[1] = m_frame.output.plane[1]; - convert.input.plane[2] = m_frame.output.plane[2]; - convert.input.stride[0] = m_frame.output.stride[0]; - convert.input.stride[1] = m_frame.output.stride[1]; - convert.input.stride[2] = m_frame.output.stride[2]; - - convert.output.csp = m_frame.output.csp; - convert.output.plane[0] = Dst; - convert.output.stride[0] = stride; - - convert.width = m_create.width; - convert.height = m_create.height; - convert.interlacing = (interlaced > 0) ? 1 : 0; - - if (m_frame.output.plane[1] != NULL && Dst != NULL && xvid_global_func != NULL) - if (xvid_global_func(0, XVID_GBL_CONVERT, &convert, NULL) < 0) /* CSP convert into output buffer */ - hr = E_FAIL; - m_frame.output.plane[1] = NULL; - } - - *pdwStatus = 0; - - if (SUCCEEDED(hr)) { - if (SUCCEEDED(hr)) - hr = pOutputSamples[0].pSample->SetUINT32(MFSampleExtension_CleanPoint, TRUE); // key frame - - if (SUCCEEDED(hr)) { /* Set timestamp of output sample */ - if (m_timestamp != INVALID_TIME) - hr = pOutputSamples[0].pSample->SetSampleTime(m_timestamp); - else - hr = pOutputSamples[0].pSample->SetSampleTime(m_rtFrame); - - if (m_timelength != INVALID_TIME) - hr = pOutputSamples[0].pSample->SetSampleDuration(m_timelength); - else - hr = pOutputSamples[0].pSample->SetSampleDuration(m_duration); - - m_rtFrame += m_duration; - } - - if (SUCCEEDED(hr)) - hr = pOutput->SetCurrentLength((m_create.width * abs(m_create.height) * m_pOutputTypeBPP) >> 3); - } - - if (pOutput2D) { - pOutput2D->Unlock2D(); - pOutput2D->Release(); - if (pOutput) - pOutput->Release(); - } - else if (pOutput) { - pOutput->Unlock(); - pOutput->Release(); - } - - LeaveCriticalSection(&m_mft_lock); - - return hr; -} - -HRESULT CXvidDecoder::OnCheckInputType(IMFMediaType *pmt) -{ - DPRINTF("(MFT)CheckInputType"); - - HRESULT hr = S_OK; - - /* Check if input type is already set. Reject any type that is not identical */ - if (m_pInputType) { - DWORD dwFlags = 0; - if (S_OK == m_pInputType->IsEqual(pmt, &dwFlags)) { - return S_OK; - } - else { - return MF_E_INVALIDTYPE; - } - } - - GUID majortype = {0}, subtype = {0}; - UINT32 width = 0, height = 0; - - hr = pmt->GetMajorType(&majortype); - - if (SUCCEEDED(hr)) { - if (majortype != MFMediaType_Video) { /* Must be Video */ - hr = MF_E_INVALIDTYPE; - } - } - - if (m_hdll == NULL) { - HRESULT hr = OpenLib(); - - if (FAILED(hr) || (m_hdll == NULL)) // Paranoid checks. - hr = MF_E_INVALIDTYPE; - } - - if (SUCCEEDED(hr)) { - hr = MFGetAttributeSize(pmt, MF_MT_FRAME_SIZE, &width, &height); - } - - /* Check the frame size */ - if (SUCCEEDED(hr)) { - if (width > 4096 || height > 4096) { - hr = MF_E_INVALIDTYPE; - } - } - m_create.width = width; - m_create.height = height; - - if (SUCCEEDED(hr)) { - if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { - hr = MFGetAttributeRatio(pmt, MF_MT_PIXEL_ASPECT_RATIO, (UINT32*)&ar_x, (UINT32*)&ar_y); - } - } - - /* TODO1: Make sure there really is a frame rate after all! - TODO2: Use the framerate for something! */ - MFRatio fps = {0}; - if (SUCCEEDED(hr)) { - hr = MFGetAttributeRatio(pmt, MF_MT_FRAME_RATE, (UINT32*)&fps.Numerator, (UINT32*)&fps.Denominator); - } - - if (SUCCEEDED(hr)) { - hr = pmt->GetGUID(MF_MT_SUBTYPE, &subtype); - } - - if (subtype == CLSID_MP4V || subtype == CLSID_MP4V_UC || - subtype == CLSID_LMP4 || subtype == CLSID_LMP4_UC || - subtype == CLSID_RMP4 || subtype == CLSID_RMP4_UC || - subtype == CLSID_SMP4 || subtype == CLSID_SMP4_UC || - subtype == CLSID_HDX4 || subtype == CLSID_HDX4_UC) { - if (!(g_config.supported_4cc & SUPPORT_MP4V)) { - CloseLib(); - hr = MF_E_INVALIDTYPE; - } - else m_create.fourcc = FOURCC_MP4V; - } - else if (subtype == CLSID_DIVX || subtype == CLSID_DIVX_UC) { - if (!(g_config.supported_4cc & SUPPORT_DIVX)) { - CloseLib(); - hr = MF_E_INVALIDTYPE; - } - else m_create.fourcc = FOURCC_DIVX; - } - else if (subtype == CLSID_DX50 || subtype == CLSID_DX50_UC) { - if (!(g_config.supported_4cc & SUPPORT_DIVX)) { - CloseLib(); - hr = MF_E_INVALIDTYPE; - } - else m_create.fourcc = FOURCC_DX50; - } - else if (subtype == CLSID_3IVX || subtype == CLSID_3IVX_UC || - subtype == CLSID_3IV0 || subtype == CLSID_3IV0_UC || - subtype == CLSID_3IV1 || subtype == CLSID_3IV1_UC || - subtype == CLSID_3IV2 || subtype == CLSID_3IV2_UC) { - if (!(g_config.supported_4cc & SUPPORT_3IVX)) { - CloseLib(); - hr = MF_E_INVALIDTYPE; - } - else m_create.fourcc = FOURCC_3IVX; - } - else if (subtype == CLSID_XVID || subtype == CLSID_XVID_UC) { - m_create.fourcc = FOURCC_XVID; - } - else { - DPRINTF("Unknown subtype!"); - CloseLib(); - hr = MF_E_INVALIDTYPE; - } - - /* haali media splitter reports VOL information in the format header */ - if (SUCCEEDED(hr)) - { - UINT32 cbSeqHeader = 0; - - (void)pmt->GetBlobSize(MF_MT_MPEG_SEQUENCE_HEADER, &cbSeqHeader); - - if (cbSeqHeader>0) { - xvid_dec_stats_t stats; - memset(&stats, 0, sizeof(stats)); - stats.version = XVID_VERSION; - - if (m_create.handle == NULL) { - if (xvid_decore_func == NULL) - hr = E_FAIL; - if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) { - DPRINTF("*** XVID_DEC_CREATE error"); - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) { - (void)pmt->GetAllocatedBlob(MF_MT_MPEG_SEQUENCE_HEADER, (UINT8 **)&m_frame.bitstream, (UINT32 *)&m_frame.length); - m_frame.general = 0; - m_frame.output.csp = XVID_CSP_NULL; - - int ret = 0; - if ((ret=xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats)) >= 0) { - /* honour video dimensions reported in VOL header */ - if (stats.type == XVID_TYPE_VOL) { - m_create.width = stats.data.vol.width; - m_create.height = stats.data.vol.height; - } - } - - if (ret == XVID_ERR_MEMORY) hr = E_FAIL; - CoTaskMemFree(m_frame.bitstream); - } - } - } - - return hr; -} - -HRESULT CXvidDecoder::OnSetInputType(IMFMediaType *pmt) -{ - HRESULT hr = S_OK; - UINT32 w, h; - - if (m_pInputType) m_pInputType->Release(); - - hr = MFGetAttributeSize(pmt, MF_MT_FRAME_SIZE, &w, &h); - m_create.width = w; m_create.height = h; - - if (SUCCEEDED(hr)) - hr = MFGetAttributeRatio(pmt, MF_MT_FRAME_RATE, (UINT32*)&m_frameRate.Numerator, (UINT32*)&m_frameRate.Denominator); - - if (SUCCEEDED(hr)) { /* Store frame duration, derived from the frame rate */ - hr = MFFrameRateToAverageTimePerFrame(m_frameRate.Numerator, m_frameRate.Denominator, &m_duration); - } - - if (SUCCEEDED(hr)) { - m_pInputType = pmt; - m_pInputType->AddRef(); - } - - return hr; -} - -HRESULT CXvidDecoder::OnSetOutputType(IMFMediaType *pmt, int bitdepth) -{ - if (m_pOutputType) m_pOutputType->Release(); - - m_pOutputType = pmt; - m_pOutputType->AddRef(); - m_pOutputTypeBPP = bitdepth; - - return S_OK; -} - -#endif /* XVID_USE_MFT */ +/***************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * - Xvid Decoder part of the DShow Filter - + * + * Copyright(C) 2002-2011 Peter Ross + * 2003-2011 Michael Militzer + * + * This program is free software ; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation ; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program ; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: CXvidDecoder.cpp 2006 2011-05-19 12:48:59Z Isibaar $ + * + ****************************************************************************/ + + /* + this requires the directx sdk + place these paths at the top of the Tools|Options|Directories list + + headers: + C:\DX90SDK\Include + C:\DX90SDK\Samples\C++\DirectShow\BaseClasses + + C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Release + C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug +*/ + +#ifdef ENABLE_MFT +#define XVID_USE_MFT +#endif + +#define XVID_USE_TRAYICON + +#include + +#include +#include +#include +#if (1100 > _MSC_VER) +#include +#endif +#include // VIDEOINFOHEADER2 + +#if defined(XVID_USE_MFT) +#define MFT_UNIQUE_METHOD_NAMES +#include +#include +#include +#include +#endif + +#include + +#include // Xvid API + +#include "resource.h" + +#include "IXvidDecoder.h" +#include "CXvidDecoder.h" +#include "CAbout.h" +#include "config.h" +#include "debug.h" + +static bool USE_IYUV; +static bool USE_YV12; +static bool USE_YUY2; +static bool USE_YVYU; +static bool USE_UYVY; +static bool USE_RGB32; +static bool USE_RGB24; +static bool USE_RG555; +static bool USE_RG565; + +const AMOVIESETUP_MEDIATYPE sudInputPinTypes[] = +{ + { &MEDIATYPE_Video, &CLSID_XVID }, + { &MEDIATYPE_Video, &CLSID_XVID_UC }, + { &MEDIATYPE_Video, &CLSID_DIVX }, + { &MEDIATYPE_Video, &CLSID_DIVX_UC }, + { &MEDIATYPE_Video, &CLSID_DX50 }, + { &MEDIATYPE_Video, &CLSID_DX50_UC }, + { &MEDIATYPE_Video, &CLSID_3IVX }, + { &MEDIATYPE_Video, &CLSID_3IVX_UC }, + { &MEDIATYPE_Video, &CLSID_3IV0 }, + { &MEDIATYPE_Video, &CLSID_3IV0_UC }, + { &MEDIATYPE_Video, &CLSID_3IV1 }, + { &MEDIATYPE_Video, &CLSID_3IV1_UC }, + { &MEDIATYPE_Video, &CLSID_3IV2 }, + { &MEDIATYPE_Video, &CLSID_3IV2_UC }, + { &MEDIATYPE_Video, &CLSID_LMP4 }, + { &MEDIATYPE_Video, &CLSID_LMP4_UC }, + { &MEDIATYPE_Video, &CLSID_RMP4 }, + { &MEDIATYPE_Video, &CLSID_RMP4_UC }, + { &MEDIATYPE_Video, &CLSID_SMP4 }, + { &MEDIATYPE_Video, &CLSID_SMP4_UC }, + { &MEDIATYPE_Video, &CLSID_HDX4 }, + { &MEDIATYPE_Video, &CLSID_HDX4_UC }, + { &MEDIATYPE_Video, &CLSID_MP4V }, + { &MEDIATYPE_Video, &CLSID_MP4V_UC }, +}; + +const AMOVIESETUP_MEDIATYPE sudOutputPinTypes[] = +{ + { &MEDIATYPE_Video, &MEDIASUBTYPE_NULL } +}; + + +const AMOVIESETUP_PIN psudPins[] = +{ + { + L"Input", // String pin name + FALSE, // Is it rendered + FALSE, // Is it an output + FALSE, // Allowed none + FALSE, // Allowed many + &CLSID_NULL, // Connects to filter + L"Output", // Connects to pin + sizeof(sudInputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE), // Number of types + &sudInputPinTypes[0] // The pin details + }, + { + L"Output", // String pin name + FALSE, // Is it rendered + TRUE, // Is it an output + FALSE, // Allowed none + FALSE, // Allowed many + &CLSID_NULL, // Connects to filter + L"Input", // Connects to pin + sizeof(sudOutputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE), // Number of types + sudOutputPinTypes // The pin details + } +}; + + +const AMOVIESETUP_FILTER sudXvidDecoder = +{ + &CLSID_XVID, // Filter CLSID + XVID_NAME_L, // Filter name + MERIT_PREFERRED+2, // Its merit + sizeof(psudPins) / sizeof(AMOVIESETUP_PIN), // Number of pins + psudPins // Pin details +}; + + +// List of class IDs and creator functions for the class factory. This +// provides the link between the OLE entry point in the DLL and an object +// being created. The class factory will call the static CreateInstance + +CFactoryTemplate g_Templates[] = +{ + { + XVID_NAME_L, + &CLSID_XVID, + CXvidDecoder::CreateInstance, + NULL, + &sudXvidDecoder + }, + { + XVID_NAME_L L"About", + &CLSID_CABOUT, + CAbout::CreateInstance + } + +}; + +/* note: g_cTemplates must be global; used by strmbase.lib(dllentry.cpp,dllsetup.cpp) */ +int g_cTemplates = sizeof(g_Templates) / sizeof(CFactoryTemplate); + +#ifdef XVID_USE_TRAYICON +extern HINSTANCE g_xvid_hInst; + +static int GUI_Page = 0; +static int Tray_Icon = 0; +extern "C" void CALLBACK Configure(HWND hWndParent, HINSTANCE hInstParent, LPSTR lpCmdLine, int nCmdShow ); + +LRESULT CALLBACK msg_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch ( uMsg ) + { + case WM_ICONMESSAGE: + switch(lParam) + { + case WM_LBUTTONDBLCLK: + if (!GUI_Page) { + GUI_Page = 1; + Configure(hwnd, g_xvid_hInst, "", 1); + GUI_Page = 0; + } + break; + default: + return DefWindowProc(hwnd, uMsg, wParam, lParam); + }; + break; + + case WM_DESTROY: + NOTIFYICONDATA nid; + ZeroMemory(&nid,sizeof(NOTIFYICONDATA)); + + nid.cbSize = NOTIFYICONDATA_V1_SIZE; + nid.hWnd = hwnd; + nid.uID = 1456; + + Shell_NotifyIcon(NIM_DELETE, &nid); + Tray_Icon = 0; + default: + return DefWindowProc(hwnd, uMsg, wParam, lParam); + } + + return TRUE; /* ok */ +} +#endif + +STDAPI DllRegisterServer() +{ +#if defined(XVID_USE_MFT) + int inputs_num = sizeof(sudInputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE); + int outputs_num = sizeof(sudOutputPinTypes) / sizeof(AMOVIESETUP_MEDIATYPE); + MFT_REGISTER_TYPE_INFO * mft_bs = new MFT_REGISTER_TYPE_INFO[inputs_num]; + MFT_REGISTER_TYPE_INFO * mft_csp = new MFT_REGISTER_TYPE_INFO[outputs_num]; + + { + int i; + for(i=0;i(XVID_NAME_L), // Friendly name + 0, // Flags + inputs_num, // Number of input types + mft_bs, // Input types + outputs_num, // Number of output types + mft_csp, // Output types + NULL // Attributes (optional) + ); + + delete[] mft_bs; + delete[] mft_csp; +#endif /* XVID_USE_MFT */ + + return AMovieDllRegisterServer2( TRUE ); +} + + +STDAPI DllUnregisterServer() +{ +#if defined(XVID_USE_MFT) + MFTUnregister(CLSID_XVID); +#endif + return AMovieDllRegisterServer2( FALSE ); +} + + +/* create instance */ + +CUnknown * WINAPI CXvidDecoder::CreateInstance(LPUNKNOWN punk, HRESULT *phr) +{ + CXvidDecoder * pNewObject = new CXvidDecoder(punk, phr); + if (pNewObject == NULL) + { + *phr = E_OUTOFMEMORY; + } + return pNewObject; +} + + +/* query interfaces */ + +STDMETHODIMP CXvidDecoder::NonDelegatingQueryInterface(REFIID riid, void **ppv) +{ + CheckPointer(ppv, E_POINTER); + + if (riid == IID_IXvidDecoder) + { + return GetInterface((IXvidDecoder *) this, ppv); + } + + if (riid == IID_ISpecifyPropertyPages) + { + return GetInterface((ISpecifyPropertyPages *) this, ppv); + } + +#if defined(XVID_USE_MFT) + if (riid == IID_IMFTransform) + { + return GetInterface((IMFTransform *) this, ppv); + } +#endif + + return CVideoTransformFilter::NonDelegatingQueryInterface(riid, ppv); +} + + + +/* constructor */ + +CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : + CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) +{ + DPRINTF("Constructor"); + + xvid_decore_func = NULL; // Hmm, some strange errors appearing if I try to initialize... + xvid_global_func = NULL; // ...this in constructor's init-list. So, they assigned here. + +#if defined(XVID_USE_MFT) + InitializeCriticalSection(&m_mft_lock); + m_pInputType = NULL; + m_pOutputType = NULL; + m_rtFrame = 0; + m_duration = 0; + m_discont = 0; + m_frameRate.Denominator = 1; + m_frameRate.Numerator = 1; +#endif + + LoadRegistryInfo(); + + *phr = OpenLib(); +} + +HRESULT CXvidDecoder::OpenLib() +{ + DPRINTF("OpenLib"); + + if (m_hdll != NULL) + return E_UNEXPECTED; // Seems, that library already opened. + + xvid_gbl_init_t init; + memset(&init, 0, sizeof(init)); + init.version = XVID_VERSION; + init.cpu_flags = g_config.cpu; + + xvid_gbl_info_t info; + memset(&info, 0, sizeof(info)); + info.version = XVID_VERSION; + + m_hdll = LoadLibrary(XVID_DLL_NAME); + if (m_hdll == NULL) { + DPRINTF("dll load failed"); + MessageBox(0, XVID_DLL_NAME " not found","Error", MB_TOPMOST); + return E_FAIL; + } + + xvid_global_func = (int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global"); + if (xvid_global_func == NULL) { + FreeLibrary(m_hdll); + m_hdll = NULL; + MessageBox(0, "xvid_global() not found", "Error", MB_TOPMOST); + return E_FAIL; + } + + xvid_decore_func = (int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_decore"); + if (xvid_decore_func == NULL) { + xvid_global_func = NULL; + FreeLibrary(m_hdll); + m_hdll = NULL; + MessageBox(0, "xvid_decore() not found", "Error", MB_TOPMOST); + return E_FAIL; + } + + if (xvid_global_func(0, XVID_GBL_INIT, &init, NULL) < 0) + { + xvid_global_func = NULL; + xvid_decore_func = NULL; + FreeLibrary(m_hdll); + m_hdll = NULL; + MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); + return E_FAIL; + } + + if (xvid_global_func(0, XVID_GBL_INFO, &info, NULL) < 0) + { + xvid_global_func = NULL; + xvid_decore_func = NULL; + FreeLibrary(m_hdll); + m_hdll = NULL; + MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); + return E_FAIL; + } + + memset(&m_create, 0, sizeof(m_create)); + m_create.version = XVID_VERSION; + m_create.handle = NULL; + /* Decoder threads */ + if (g_config.cpu & XVID_CPU_FORCE) { + m_create.num_threads = g_config.num_threads; + } + else { + m_create.num_threads = info.num_threads; /* Autodetect */ + g_config.num_threads = info.num_threads; + } + + memset(&m_frame, 0, sizeof(m_frame)); + m_frame.version = XVID_VERSION; + + USE_IYUV = false; + USE_YV12 = false; + USE_YUY2 = false; + USE_YVYU = false; + USE_UYVY = false; + USE_RGB32 = false; + USE_RGB24 = false; + USE_RG555 = false; + USE_RG565 = false; + + switch ( g_config.nForceColorspace ) + { + case FORCE_NONE: + USE_IYUV = true; + USE_YV12 = true; + USE_YUY2 = true; + USE_YVYU = true; + USE_UYVY = true; + USE_RGB32 = true; + USE_RGB24 = true; + USE_RG555 = true; + USE_RG565 = true; + break; + case FORCE_YV12: + USE_IYUV = true; + USE_YV12 = true; + break; + case FORCE_YUY2: + USE_YUY2 = true; + break; + case FORCE_RGB24: + USE_RGB24 = true; + break; + case FORCE_RGB32: + USE_RGB32 = true; + break; + } + + switch (g_config.aspect_ratio) + { + case 0: + case 1: + break; + case 2: + ar_x = 4; + ar_y = 3; + break; + case 3: + ar_x = 16; + ar_y = 9; + break; + case 4: + ar_x = 47; + ar_y = 20; + break; + } + + return S_OK; +} + +void CXvidDecoder::CloseLib() +{ + DPRINTF("CloseLib"); + + if ((m_create.handle != NULL) && (xvid_decore_func != NULL)) + { + xvid_decore_func(m_create.handle, XVID_DEC_DESTROY, 0, 0); + m_create.handle = NULL; + } + + if (m_hdll != NULL) { + FreeLibrary(m_hdll); + m_hdll = NULL; + } + xvid_decore_func = NULL; + xvid_global_func = NULL; +} + +/* destructor */ + +CXvidDecoder::~CXvidDecoder() +{ + DPRINTF("Destructor"); + +#ifdef XVID_USE_TRAYICON + if (Tray_Icon) { /* Destroy tray icon */ + NOTIFYICONDATA nid; + ZeroMemory(&nid,sizeof(NOTIFYICONDATA)); + + nid.cbSize = NOTIFYICONDATA_V1_SIZE; + nid.hWnd = MSG_hwnd; + nid.uID = 1456; + + Shell_NotifyIcon(NIM_DELETE, &nid); + Tray_Icon = 0; + } +#endif + + /* Close xvidcore library */ + CloseLib(); + +#if defined(XVID_USE_MFT) + DeleteCriticalSection(&m_mft_lock); +#endif +} + + + +/* check input type */ + +HRESULT CXvidDecoder::CheckInputType(const CMediaType * mtIn) +{ + DPRINTF("CheckInputType"); + BITMAPINFOHEADER * hdr; + + ar_x = ar_y = 0; + + if (*mtIn->Type() != MEDIATYPE_Video) + { + DPRINTF("Error: Unknown Type"); + CloseLib(); + return VFW_E_TYPE_NOT_ACCEPTED; + } + + if (m_hdll == NULL) + { + HRESULT hr = OpenLib(); + + if (FAILED(hr) || (m_hdll == NULL)) // Paranoid checks. + return VFW_E_TYPE_NOT_ACCEPTED; + } + + if (*mtIn->FormatType() == FORMAT_VideoInfo) + { + VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtIn->Format(); + hdr = &vih->bmiHeader; + } + else if (*mtIn->FormatType() == FORMAT_VideoInfo2) + { + VIDEOINFOHEADER2 * vih2 = (VIDEOINFOHEADER2 *) mtIn->Format(); + hdr = &vih2->bmiHeader; + if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { + ar_x = vih2->dwPictAspectRatioX; + ar_y = vih2->dwPictAspectRatioY; + } + DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); + } + else if (*mtIn->FormatType() == FORMAT_MPEG2Video) { + MPEG2VIDEOINFO * mpgvi = (MPEG2VIDEOINFO*)mtIn->Format(); + VIDEOINFOHEADER2 * vih2 = &mpgvi->hdr; + hdr = &vih2->bmiHeader; + if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { + ar_x = vih2->dwPictAspectRatioX; + ar_y = vih2->dwPictAspectRatioY; + } + DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); + + /* haali media splitter reports VOL information in the format header */ + + if (mpgvi->cbSequenceHeader>0) { + + xvid_dec_stats_t stats; + memset(&stats, 0, sizeof(stats)); + stats.version = XVID_VERSION; + + if (m_create.handle == NULL) { + if (xvid_decore_func == NULL) + return E_FAIL; + if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) { + DPRINTF("*** XVID_DEC_CREATE error"); + return E_FAIL; + } + } + + m_frame.general = 0; + m_frame.bitstream = (void*)mpgvi->dwSequenceHeader; + m_frame.length = mpgvi->cbSequenceHeader; + m_frame.output.csp = XVID_CSP_NULL; + + int ret = 0; + if ((ret=xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats)) >= 0) { + /* honour video dimensions reported in VOL header */ + if (stats.type == XVID_TYPE_VOL) { + hdr->biWidth = stats.data.vol.width; + hdr->biHeight = stats.data.vol.height; + } + } + if (ret == XVID_ERR_MEMORY) return E_FAIL; + } + } + else + { + DPRINTF("Error: Unknown FormatType"); + CloseLib(); + return VFW_E_TYPE_NOT_ACCEPTED; + } + if (hdr->biHeight < 0) + { + DPRINTF("colorspace: inverted input format not supported"); + } + + m_create.width = hdr->biWidth; + m_create.height = hdr->biHeight; + + switch(hdr->biCompression) + { + case FOURCC_mp4v : + case FOURCC_MP4V : + case FOURCC_lmp4 : + case FOURCC_LMP4 : + case FOURCC_rmp4 : + case FOURCC_RMP4 : + case FOURCC_smp4 : + case FOURCC_SMP4 : + case FOURCC_hdx4 : + case FOURCC_HDX4 : + if (!(g_config.supported_4cc & SUPPORT_MP4V)) { + CloseLib(); + return VFW_E_TYPE_NOT_ACCEPTED; + } + break; + case FOURCC_divx : + case FOURCC_DIVX : + case FOURCC_dx50 : + case FOURCC_DX50 : + if (!(g_config.supported_4cc & SUPPORT_DIVX)) { + CloseLib(); + return VFW_E_TYPE_NOT_ACCEPTED; + } + break; + case FOURCC_3ivx : + case FOURCC_3IVX : + case FOURCC_3iv0 : + case FOURCC_3IV0 : + case FOURCC_3iv1 : + case FOURCC_3IV1 : + case FOURCC_3iv2 : + case FOURCC_3IV2 : + if (!(g_config.supported_4cc & SUPPORT_3IVX)) { + CloseLib(); + return VFW_E_TYPE_NOT_ACCEPTED; + } + case FOURCC_xvid : + case FOURCC_XVID : + break; + + + default : + DPRINTF("Unknown fourcc: 0x%08x (%c%c%c%c)", + hdr->biCompression, + (hdr->biCompression)&0xff, + (hdr->biCompression>>8)&0xff, + (hdr->biCompression>>16)&0xff, + (hdr->biCompression>>24)&0xff); + CloseLib(); + return VFW_E_TYPE_NOT_ACCEPTED; + } + + m_create.fourcc = hdr->biCompression; + + return S_OK; +} + + +/* get list of supported output colorspaces */ + + +HRESULT CXvidDecoder::GetMediaType(int iPosition, CMediaType *mtOut) +{ + BITMAPINFOHEADER * bmih; + DPRINTF("GetMediaType"); + + if (m_pInput->IsConnected() == FALSE) + { + return E_UNEXPECTED; + } + + if (!g_config.videoinfo_compat) { + VIDEOINFOHEADER2 * vih = (VIDEOINFOHEADER2 *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER2)); + if (vih == NULL) return E_OUTOFMEMORY; + + ZeroMemory(vih, sizeof (VIDEOINFOHEADER2)); + bmih = &(vih->bmiHeader); + mtOut->SetFormatType(&FORMAT_VideoInfo2); + + if (ar_x != 0 && ar_y != 0) { + vih->dwPictAspectRatioX = ar_x; + vih->dwPictAspectRatioY = ar_y; + forced_ar = true; + } else { // just to be safe + vih->dwPictAspectRatioX = m_create.width; + vih->dwPictAspectRatioY = abs(m_create.height); + forced_ar = false; + } + } else { + + VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER)); + if (vih == NULL) return E_OUTOFMEMORY; + + ZeroMemory(vih, sizeof (VIDEOINFOHEADER)); + bmih = &(vih->bmiHeader); + mtOut->SetFormatType(&FORMAT_VideoInfo); + } + + bmih->biSize = sizeof(BITMAPINFOHEADER); + bmih->biWidth = m_create.width; + bmih->biHeight = m_create.height; + bmih->biPlanes = 1; + + if (iPosition < 0) return E_INVALIDARG; + + switch(iPosition) + { + + case 0: +if ( USE_YUY2 ) +{ + bmih->biCompression = MEDIASUBTYPE_YUY2.Data1; + bmih->biBitCount = 16; + mtOut->SetSubtype(&MEDIASUBTYPE_YUY2); + break; +} + case 1 : +if ( USE_YVYU ) +{ + bmih->biCompression = MEDIASUBTYPE_YVYU.Data1; + bmih->biBitCount = 16; + mtOut->SetSubtype(&MEDIASUBTYPE_YVYU); + break; +} + case 2 : +if ( USE_UYVY ) +{ + bmih->biCompression = MEDIASUBTYPE_UYVY.Data1; + bmih->biBitCount = 16; + mtOut->SetSubtype(&MEDIASUBTYPE_UYVY); + break; +} + case 3 : + if ( USE_IYUV ) +{ + bmih->biCompression = CLSID_MEDIASUBTYPE_IYUV.Data1; + bmih->biBitCount = 12; + mtOut->SetSubtype(&CLSID_MEDIASUBTYPE_IYUV); + break; +} + case 4 : +if ( USE_YV12 ) +{ + bmih->biCompression = MEDIASUBTYPE_YV12.Data1; + bmih->biBitCount = 12; + mtOut->SetSubtype(&MEDIASUBTYPE_YV12); + break; +} + case 5 : +if ( USE_RGB32 ) +{ + bmih->biCompression = BI_RGB; + bmih->biBitCount = 32; + mtOut->SetSubtype(&MEDIASUBTYPE_RGB32); + break; +} + case 6 : +if ( USE_RGB24 ) +{ + bmih->biCompression = BI_RGB; + bmih->biBitCount = 24; + mtOut->SetSubtype(&MEDIASUBTYPE_RGB24); + break; +} + case 7 : +if ( USE_RG555 ) +{ + bmih->biCompression = BI_RGB; + bmih->biBitCount = 16; + mtOut->SetSubtype(&MEDIASUBTYPE_RGB555); + break; +} + case 8 : +if ( USE_RG565 ) +{ + bmih->biCompression = BI_RGB; + bmih->biBitCount = 16; + mtOut->SetSubtype(&MEDIASUBTYPE_RGB565); + break; +} + default : + return VFW_S_NO_MORE_ITEMS; + } + + bmih->biSizeImage = GetBitmapSize(bmih); + + mtOut->SetType(&MEDIATYPE_Video); + mtOut->SetTemporalCompression(FALSE); + mtOut->SetSampleSize(bmih->biSizeImage); + + return S_OK; +} + + +/* (internal function) change colorspace */ +#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) + +HRESULT CXvidDecoder::ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip) +{ + DWORD biWidth; + + if (formattype == FORMAT_VideoInfo) + { + VIDEOINFOHEADER * vih = (VIDEOINFOHEADER * )format; + biWidth = vih->bmiHeader.biWidth; + out_stride = CALC_BI_STRIDE(vih->bmiHeader.biWidth, vih->bmiHeader.biBitCount); + rgb_flip = (vih->bmiHeader.biHeight < 0 ? 0 : XVID_CSP_VFLIP); + } + else if (formattype == FORMAT_VideoInfo2) + { + VIDEOINFOHEADER2 * vih2 = (VIDEOINFOHEADER2 * )format; + biWidth = vih2->bmiHeader.biWidth; + out_stride = CALC_BI_STRIDE(vih2->bmiHeader.biWidth, vih2->bmiHeader.biBitCount); + rgb_flip = (vih2->bmiHeader.biHeight < 0 ? 0 : XVID_CSP_VFLIP); + } + else + { + return S_FALSE; + } + + if (noflip) rgb_flip = 0; + + if (subtype == CLSID_MEDIASUBTYPE_IYUV) + { + DPRINTF("IYUV"); + rgb_flip = 0; + m_frame.output.csp = XVID_CSP_I420; + out_stride = CALC_BI_STRIDE(biWidth, 8); /* planar format fix */ + } + else if (subtype == MEDIASUBTYPE_YV12) + { + DPRINTF("YV12"); + rgb_flip = 0; + m_frame.output.csp = XVID_CSP_YV12; + out_stride = CALC_BI_STRIDE(biWidth, 8); /* planar format fix */ + } + else if (subtype == MEDIASUBTYPE_YUY2) + { + DPRINTF("YUY2"); + rgb_flip = 0; + m_frame.output.csp = XVID_CSP_YUY2; + } + else if (subtype == MEDIASUBTYPE_YVYU) + { + DPRINTF("YVYU"); + rgb_flip = 0; + m_frame.output.csp = XVID_CSP_YVYU; + } + else if (subtype == MEDIASUBTYPE_UYVY) + { + DPRINTF("UYVY"); + rgb_flip = 0; + m_frame.output.csp = XVID_CSP_UYVY; + } + else if (subtype == MEDIASUBTYPE_RGB32) + { + DPRINTF("RGB32"); + m_frame.output.csp = rgb_flip | XVID_CSP_BGRA; + } + else if (subtype == MEDIASUBTYPE_RGB24) + { + DPRINTF("RGB24"); + m_frame.output.csp = rgb_flip | XVID_CSP_BGR; + } + else if (subtype == MEDIASUBTYPE_RGB555) + { + DPRINTF("RGB555"); + m_frame.output.csp = rgb_flip | XVID_CSP_RGB555; + } + else if (subtype == MEDIASUBTYPE_RGB565) + { + DPRINTF("RGB565"); + m_frame.output.csp = rgb_flip | XVID_CSP_RGB565; + } + else if (subtype == GUID_NULL) + { + m_frame.output.csp = XVID_CSP_NULL; + } + else + { + return S_FALSE; + } + + return S_OK; +} + + +/* set output colorspace */ + +HRESULT CXvidDecoder::SetMediaType(PIN_DIRECTION direction, const CMediaType *pmt) +{ + DPRINTF("SetMediaType"); + + if (direction == PINDIR_OUTPUT) + { + return ChangeColorspace(*pmt->Subtype(), *pmt->FormatType(), pmt->Format(), 0); + } + + return S_OK; +} + + +/* check input<->output compatiblity */ + +HRESULT CXvidDecoder::CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut) +{ + DPRINTF("CheckTransform"); + + return S_OK; +} + +/* input/output pin connection complete */ + +HRESULT CXvidDecoder::CompleteConnect(PIN_DIRECTION direction, IPin *pReceivePin) +{ + DPRINTF("CompleteConnect"); + +#ifdef XVID_USE_TRAYICON + if ((direction == PINDIR_OUTPUT) && (Tray_Icon == 0)) + { + WNDCLASSEX wc; + + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpfnWndProc = msg_proc; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.cbWndExtra = 0; + wc.cbClsExtra = 0; + wc.hInstance = (HINSTANCE) g_xvid_hInst; + wc.hbrBackground = (HBRUSH) GetStockObject(NULL_BRUSH); + wc.lpszMenuName = NULL; + wc.lpszClassName = "XVID_MSG_WINDOW"; + wc.hIcon = NULL; + wc.hIconSm = NULL; + wc.hCursor = NULL; + RegisterClassEx(&wc); + + MSG_hwnd = CreateWindowEx(0, "XVID_MSG_WINDOW", NULL, 0, CW_USEDEFAULT, + CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE) g_xvid_hInst, NULL); + + /* display the tray icon */ + NOTIFYICONDATA nid; + ZeroMemory(&nid,sizeof(NOTIFYICONDATA)); + + nid.cbSize = NOTIFYICONDATA_V1_SIZE; + nid.hWnd = MSG_hwnd; + nid.uID = 1456; + nid.uCallbackMessage = WM_ICONMESSAGE; + nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); + strcpy_s(nid.szTip, 19, "Xvid Video Decoder"); + nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; + + Shell_NotifyIcon(NIM_ADD, &nid); + + DestroyIcon(nid.hIcon); + Tray_Icon = 1; + } +#endif + + return S_OK; +} + +/* input/output pin disconnected */ +HRESULT CXvidDecoder::BreakConnect(PIN_DIRECTION direction) +{ + DPRINTF("BreakConnect"); + + return S_OK; +} + +/* alloc output buffer */ + +HRESULT CXvidDecoder::DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) +{ + DPRINTF("DecideBufferSize"); + HRESULT result; + ALLOCATOR_PROPERTIES ppropActual; + + if (m_pInput->IsConnected() == FALSE) + { + return E_UNEXPECTED; + } + + ppropInputRequest->cBuffers = 1; + ppropInputRequest->cbBuffer = m_create.width * m_create.height * 4; + // cbAlign causes problems with the resize filter */ + // ppropInputRequest->cbAlign = 16; + ppropInputRequest->cbPrefix = 0; + + result = pAlloc->SetProperties(ppropInputRequest, &ppropActual); + if (result != S_OK) + { + return result; + } + + if (ppropActual.cbBuffer < ppropInputRequest->cbBuffer) + { + return E_FAIL; + } + + return S_OK; +} + + +/* decode frame */ + +HRESULT CXvidDecoder::Transform(IMediaSample *pIn, IMediaSample *pOut) +{ + DPRINTF("Transform"); + xvid_dec_stats_t stats; + int length; + + memset(&stats, 0, sizeof(stats)); + stats.version = XVID_VERSION; + + if (m_create.handle == NULL) + { + if (xvid_decore_func == NULL) + return E_FAIL; + + if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) + { + DPRINTF("*** XVID_DEC_CREATE error"); + return E_FAIL; + } + } + + AM_MEDIA_TYPE * mtOut; + pOut->GetMediaType(&mtOut); + if (mtOut != NULL) + { + HRESULT result; + + result = ChangeColorspace(mtOut->subtype, mtOut->formattype, mtOut->pbFormat, 0); + DeleteMediaType(mtOut); + + if (result != S_OK) + { + DPRINTF("*** ChangeColorspace error"); + return result; + } + } + + m_frame.length = pIn->GetActualDataLength(); + if (pIn->GetPointer((BYTE**)&m_frame.bitstream) != S_OK) + { + return S_FALSE; + } + + if (pOut->GetPointer((BYTE**)&m_frame.output.plane[0]) != S_OK) + { + return S_FALSE; + } + + m_frame.general = XVID_LOWDELAY; + + if (pIn->IsDiscontinuity() == S_OK) + m_frame.general |= XVID_DISCONTINUITY; + + if (g_config.nDeblock_Y) + m_frame.general |= XVID_DEBLOCKY; + + if (g_config.nDeblock_UV) + m_frame.general |= XVID_DEBLOCKUV; + + if (g_config.nDering_Y) + m_frame.general |= XVID_DERINGY; + + if (g_config.nDering_UV) + m_frame.general |= XVID_DERINGUV; + + if (g_config.nFilmEffect) + m_frame.general |= XVID_FILMEFFECT; + + m_frame.brightness = g_config.nBrightness; + + m_frame.output.csp &= ~XVID_CSP_VFLIP; + m_frame.output.csp |= rgb_flip^(g_config.nFlipVideo ? XVID_CSP_VFLIP : 0); + m_frame.output.stride[0] = out_stride; + + // Paranoid check. + if (xvid_decore_func == NULL) + return E_FAIL; + + +repeat : + + if (pIn->IsPreroll() != S_OK) + { + length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); + + if (length == XVID_ERR_MEMORY) + return E_FAIL; + else if (length < 0) + { + DPRINTF("*** XVID_DEC_DECODE"); + return S_FALSE; + } else + if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1 && forced_ar == false) { + + if (stats.type != XVID_TYPE_NOTHING) { /* dont attempt to set vmr aspect ratio if no frame was returned by decoder */ + // inspired by minolta! works for VMR 7 + 9 + IMediaSample2 *pOut2 = NULL; + AM_SAMPLE2_PROPERTIES outProp2; + if (SUCCEEDED(pOut->QueryInterface(IID_IMediaSample2, (void **)&pOut2)) && + SUCCEEDED(pOut2->GetProperties(FIELD_OFFSET(AM_SAMPLE2_PROPERTIES, tStart), (PBYTE)&outProp2))) + { + CMediaType mtOut2 = m_pOutput->CurrentMediaType(); + VIDEOINFOHEADER2* vihOut2 = (VIDEOINFOHEADER2*)mtOut2.Format(); + + if (*mtOut2.FormatType() == FORMAT_VideoInfo2 && + vihOut2->dwPictAspectRatioX != ar_x && vihOut2->dwPictAspectRatioY != ar_y) + { + vihOut2->dwPictAspectRatioX = ar_x; + vihOut2->dwPictAspectRatioY = ar_y; + pOut2->SetMediaType(&mtOut2); + m_pOutput->SetMediaType(&mtOut2); + } + pOut2->Release(); + } + } + } + } + else + { /* Preroll frame - won't be displayed */ + int tmp = m_frame.output.csp; + int tmp_gen = m_frame.general; + + m_frame.output.csp = XVID_CSP_NULL; + + /* Disable postprocessing to speed-up seeking */ + m_frame.general &= ~XVID_DEBLOCKY; + m_frame.general &= ~XVID_DEBLOCKUV; + /*m_frame.general &= ~XVID_DERING;*/ + m_frame.general &= ~XVID_FILMEFFECT; + + length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); + if (length == XVID_ERR_MEMORY) + return E_FAIL; + else if (length < 0) + { + DPRINTF("*** XVID_DEC_DECODE"); + return S_FALSE; + } + + m_frame.output.csp = tmp; + m_frame.general = tmp_gen; + } + + if (stats.type == XVID_TYPE_NOTHING && length > 0) { + DPRINTF(" B-Frame decoder lag"); + return S_FALSE; + } + + + if (stats.type == XVID_TYPE_VOL) + { + if (stats.data.vol.width != m_create.width || + stats.data.vol.height != m_create.height) + { + DPRINTF("TODO: auto-resize"); + return S_FALSE; + } + + pOut->SetSyncPoint(TRUE); + + if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { /* auto */ + int par_x, par_y; + if (stats.data.vol.par == XVID_PAR_EXT) { + par_x = stats.data.vol.par_width; + par_y = stats.data.vol.par_height; + } else { + par_x = PARS[stats.data.vol.par-1][0]; + par_y = PARS[stats.data.vol.par-1][1]; + } + + ar_x = par_x * stats.data.vol.width; + ar_y = par_y * stats.data.vol.height; + } + + m_frame.bitstream = (BYTE*)m_frame.bitstream + length; + m_frame.length -= length; + goto repeat; + } + + if (pIn->IsPreroll() == S_OK) { + return S_FALSE; + } + + return S_OK; +} + + +/* get property page list */ + +STDMETHODIMP CXvidDecoder::GetPages(CAUUID * pPages) +{ + DPRINTF("GetPages"); + + pPages->cElems = 1; + pPages->pElems = (GUID *)CoTaskMemAlloc(pPages->cElems * sizeof(GUID)); + if (pPages->pElems == NULL) + { + return E_OUTOFMEMORY; + } + pPages->pElems[0] = CLSID_CABOUT; + + return S_OK; +} + + +/* cleanup pages */ + +STDMETHODIMP CXvidDecoder::FreePages(CAUUID * pPages) +{ + DPRINTF("FreePages"); + CoTaskMemFree(pPages->pElems); + return S_OK; +} + +/*=============================================================================== +// MFT Interface +//=============================================================================*/ +#if defined(XVID_USE_MFT) +#include // _I64_MAX +#define INVALID_TIME _I64_MAX + +HRESULT CXvidDecoder::MFTGetStreamLimits(DWORD *pdwInputMinimum, DWORD *pdwInputMaximum, DWORD *pdwOutputMinimum, DWORD *pdwOutputMaximum) +{ + DPRINTF("(MFT)GetStreamLimits"); + + if ((pdwInputMinimum == NULL) || (pdwInputMaximum == NULL) || (pdwOutputMinimum == NULL) || (pdwOutputMaximum == NULL)) + return E_POINTER; + + /* Just a fixed number of streams allowed */ + *pdwInputMinimum = *pdwInputMaximum = 1; + *pdwOutputMinimum = *pdwOutputMaximum = 1; + + return S_OK; +} + +HRESULT CXvidDecoder::MFTGetStreamCount(DWORD *pcInputStreams, DWORD *pcOutputStreams) +{ + DPRINTF("(MFT)GetStreamCount"); + + if ((pcInputStreams == NULL) || (pcOutputStreams == NULL)) + return E_POINTER; + + /* We have a fixed number of streams */ + *pcInputStreams = 1; + *pcOutputStreams = 1; + + return S_OK; +} + +HRESULT CXvidDecoder::MFTGetStreamIDs(DWORD dwInputIDArraySize, DWORD *pdwInputIDs, DWORD dwOutputIDArraySize, DWORD *pdwOutputIDs) +{ + DPRINTF("(MFT)GetStreamIDs"); + return E_NOTIMPL; /* We have fixed number of streams, so stream ID match stream index */ +} + +HRESULT CXvidDecoder::MFTGetInputStreamInfo(DWORD dwInputStreamID, MFT_INPUT_STREAM_INFO *pStreamInfo) +{ + DPRINTF("(MFT)GetInputStreamInfo"); + + if (pStreamInfo == NULL) + return E_POINTER; + + if (dwInputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + EnterCriticalSection(&m_mft_lock); + + pStreamInfo->dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER; + pStreamInfo->hnsMaxLatency = 0; + + pStreamInfo->cbSize = 1; /* Need atleast 1 byte input */ + pStreamInfo->cbMaxLookahead = 0; + pStreamInfo->cbAlignment = 1; + + LeaveCriticalSection(&m_mft_lock); + return S_OK; +} + +HRESULT CXvidDecoder::MFTGetOutputStreamInfo(DWORD dwOutputStreamID, MFT_OUTPUT_STREAM_INFO *pStreamInfo) +{ + DPRINTF("(MFT)GetOutputStreamInfo"); + + if (pStreamInfo == NULL) + return E_POINTER; + + if (dwOutputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + EnterCriticalSection(&m_mft_lock); + + pStreamInfo->dwFlags = MFT_OUTPUT_STREAM_WHOLE_SAMPLES | MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE | MFT_OUTPUT_STREAM_DISCARDABLE; + + if (m_pOutputType == NULL) { + pStreamInfo->cbSize = 0; + pStreamInfo->cbAlignment = 0; + } + else { + pStreamInfo->cbSize = m_create.width * abs(m_create.height) * 4; // XXX + pStreamInfo->cbAlignment = 1; + } + + LeaveCriticalSection(&m_mft_lock); + return S_OK; +} + +HRESULT CXvidDecoder::GetAttributes(IMFAttributes** pAttributes) +{ + DPRINTF("(MFT)GetAttributes"); + return E_NOTIMPL; /* We don't support any attributes */ +} + +HRESULT CXvidDecoder::GetInputStreamAttributes(DWORD dwInputStreamID, IMFAttributes **ppAttributes) +{ + DPRINTF("(MFT)GetInputStreamAttributes"); + return E_NOTIMPL; /* We don't support any attributes */ +} + +HRESULT CXvidDecoder::GetOutputStreamAttributes(DWORD dwOutputStreamID, IMFAttributes **ppAttributes) +{ + DPRINTF("(MFT)GetOutputStreamAttributes"); + return E_NOTIMPL; /* We don't support any attributes */ +} + +HRESULT CXvidDecoder::MFTDeleteInputStream(DWORD dwStreamID) +{ + DPRINTF("(MFT)DeleteInputStream"); + return E_NOTIMPL; /* We have a fixed number of streams */ +} + +HRESULT CXvidDecoder::MFTAddInputStreams(DWORD cStreams, DWORD *adwStreamIDs) +{ + DPRINTF("(MFT)AddInputStreams"); + return E_NOTIMPL; /* We have a fixed number of streams */ +} + +HRESULT CXvidDecoder::MFTGetInputAvailableType(DWORD dwInputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType) +{ + DPRINTF("(MFT)GetInputAvailableType"); + + if (dwInputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + DWORD i = 0; + GUID *bs_guid_table[8]; + + bs_guid_table[i++] = (GUID *)&CLSID_XVID; + bs_guid_table[i++] = (GUID *)&CLSID_XVID_UC; + + if (g_config.supported_4cc & SUPPORT_3IVX) { + bs_guid_table[i++] = (GUID *)&CLSID_3IVX; + bs_guid_table[i++] = (GUID *)&CLSID_3IVX_UC; + bs_guid_table[i++] = (GUID *)&CLSID_3IV0; + bs_guid_table[i++] = (GUID *)&CLSID_3IV0_UC; + bs_guid_table[i++] = (GUID *)&CLSID_3IV1; + bs_guid_table[i++] = (GUID *)&CLSID_3IV1_UC; + bs_guid_table[i++] = (GUID *)&CLSID_3IV2; + bs_guid_table[i++] = (GUID *)&CLSID_3IV2_UC; + } + if (g_config.supported_4cc & SUPPORT_DIVX) { + bs_guid_table[i++] = (GUID *)&CLSID_DIVX; + bs_guid_table[i++] = (GUID *)&CLSID_DIVX_UC; + bs_guid_table[i++] = (GUID *)&CLSID_DX50; + bs_guid_table[i++] = (GUID *)&CLSID_DX50_UC; + } + if (g_config.supported_4cc & SUPPORT_MP4V) { + bs_guid_table[i++] = (GUID *)&CLSID_MP4V; + bs_guid_table[i++] = (GUID *)&CLSID_MP4V_UC; + bs_guid_table[i++] = (GUID *)&CLSID_LMP4; + bs_guid_table[i++] = (GUID *)&CLSID_LMP4_UC; + bs_guid_table[i++] = (GUID *)&CLSID_RMP4; + bs_guid_table[i++] = (GUID *)&CLSID_RMP4_UC; + bs_guid_table[i++] = (GUID *)&CLSID_SMP4; + bs_guid_table[i++] = (GUID *)&CLSID_SMP4_UC; + bs_guid_table[i++] = (GUID *)&CLSID_HDX4; + bs_guid_table[i++] = (GUID *)&CLSID_HDX4_UC; + } + + const GUID *subtype; + if (dwTypeIndex < i) { + subtype = bs_guid_table[dwTypeIndex]; + } + else { + return MF_E_NO_MORE_TYPES; + } + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + + if (ppType) { + IMFMediaType *pInputType = NULL; + hr = MFCreateMediaType(&pInputType); + + if (SUCCEEDED(hr)) + hr = pInputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video); + + if (SUCCEEDED(hr)) + hr = pInputType->SetGUID(MF_MT_SUBTYPE, *subtype); + + if (SUCCEEDED(hr)) { + *ppType = pInputType; + (*ppType)->AddRef(); + } + if (pInputType) pInputType->Release(); + } + + LeaveCriticalSection(&m_mft_lock); + + return hr; +} + +HRESULT CXvidDecoder::MFTGetOutputAvailableType(DWORD dwOutputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType) +{ + DPRINTF("(MFT)GetOutputAvailableType"); + + if (ppType == NULL) + return E_INVALIDARG; + + if (dwOutputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (dwTypeIndex < 0) return E_INVALIDARG; + + GUID csp; + int bitdepth = 8; + switch(dwTypeIndex) + { + case 0: +if ( USE_YUY2 ) +{ + csp = MFVideoFormat_YUY2; + bitdepth = 4; + break; +} + case 1 : +if ( USE_UYVY ) +{ + csp = MFVideoFormat_UYVY; + bitdepth = 4; + break; +} + case 2 : + if ( USE_IYUV ) +{ + csp = MFVideoFormat_IYUV; + bitdepth = 3; + break; +} + case 3 : +if ( USE_YV12 ) +{ + csp = MFVideoFormat_YV12; + bitdepth = 3; + break; +} + case 4 : +if ( USE_RGB32 ) +{ + csp = MFVideoFormat_RGB32; + bitdepth = 8; + break; +} + case 5 : +if ( USE_RGB24 ) +{ + csp = MFVideoFormat_RGB24; + bitdepth = 6; + break; +} + case 6 : +if ( USE_RG555 ) +{ + csp = MFVideoFormat_RGB555; + bitdepth = 4; + break; +} + case 7 : +if ( USE_RG565 ) +{ + csp = MFVideoFormat_RGB565; + bitdepth = 4; + break; +} + default : + return MF_E_NO_MORE_TYPES; + } + + if (m_pInputType == NULL) + return MF_E_TRANSFORM_TYPE_NOT_SET; + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + + IMFMediaType *pOutputType = NULL; + hr = MFCreateMediaType(&pOutputType); + + if (SUCCEEDED(hr)) { + hr = pOutputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video); + } + + if (SUCCEEDED(hr)) { + hr = pOutputType->SetGUID(MF_MT_SUBTYPE, csp); + } + + if (SUCCEEDED(hr)) { + hr = pOutputType->SetUINT32(MF_MT_FIXED_SIZE_SAMPLES, TRUE); + } + + if (SUCCEEDED(hr)) { + hr = pOutputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE); + } + + if (SUCCEEDED(hr)) { + hr = pOutputType->SetUINT32(MF_MT_SAMPLE_SIZE, (m_create.height * m_create.width * bitdepth)>>1); + } + + if (SUCCEEDED(hr)) { + hr = MFSetAttributeSize(pOutputType, MF_MT_FRAME_SIZE, m_create.width, m_create.height); + } + + if (SUCCEEDED(hr)) { + hr = MFSetAttributeRatio(pOutputType, MF_MT_FRAME_RATE, m_frameRate.Numerator, m_frameRate.Denominator); + } + + if (SUCCEEDED(hr)) { + hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive); + } + + if (SUCCEEDED(hr)) { + hr = MFSetAttributeRatio(pOutputType, MF_MT_PIXEL_ASPECT_RATIO, ar_x, ar_y); + } + + if (SUCCEEDED(hr)) { + *ppType = pOutputType; + (*ppType)->AddRef(); + } + + if (pOutputType) pOutputType->Release(); + + LeaveCriticalSection(&m_mft_lock); + return hr; +} + +HRESULT CXvidDecoder::MFTSetInputType(DWORD dwInputStreamID, IMFMediaType *pType, DWORD dwFlags) +{ + DPRINTF("(MFT)SetInputType"); + + if (dwInputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (dwFlags & ~MFT_SET_TYPE_TEST_ONLY) + return E_INVALIDARG; + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + + /* Actually set the type or just test it? */ + BOOL bReallySet = ((dwFlags & MFT_SET_TYPE_TEST_ONLY) == 0); + + /* If we have samples pending the type can't be changed right now */ + if (HasPendingOutput()) + hr = MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING; + + if (SUCCEEDED(hr)) { + if (pType) { // /* Check the type */ + hr = OnCheckInputType(pType); + } + } + + if (SUCCEEDED(hr)) { + if (bReallySet) { /* Set the type if needed */ + hr = OnSetInputType(pType); + } + } + + LeaveCriticalSection(&m_mft_lock); + return hr; +} + +HRESULT CXvidDecoder::MFTSetOutputType(DWORD dwOutputStreamID, IMFMediaType *pType, DWORD dwFlags) +{ + DPRINTF("(MFT)SetOutputType"); + + if (dwOutputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (dwFlags & ~MFT_SET_TYPE_TEST_ONLY) + return E_INVALIDARG; + + HRESULT hr = S_OK; + + EnterCriticalSection(&m_mft_lock); + + /* Actually set the type or just test it? */ + BOOL bReallySet = ((dwFlags & MFT_SET_TYPE_TEST_ONLY) == 0); + + /* If we have samples pending the type can't be changed right now */ + if (HasPendingOutput()) + hr = MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING; + + if (SUCCEEDED(hr)) { + if (pType) { /* Check the type */ + AM_MEDIA_TYPE *am; + hr = MFCreateAMMediaTypeFromMFMediaType(pType, GUID_NULL, &am); + + if (SUCCEEDED(hr)) { + if (FAILED(ChangeColorspace(am->subtype, am->formattype, am->pbFormat, 1))) { + DPRINTF("(MFT)InternalCheckOutputType (MF_E_INVALIDTYPE)"); + return MF_E_INVALIDTYPE; + } + + CoTaskMemFree(am->pbFormat); + CoTaskMemFree(am); + } + } + } + + if (SUCCEEDED(hr)) { + if (bReallySet) { /* Set the type if needed */ + hr = OnSetOutputType(pType); + } + } +#ifdef XVID_USE_TRAYICON + if (SUCCEEDED(hr) && Tray_Icon == 0) /* Create message passing window */ + { + WNDCLASSEX wc; + + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpfnWndProc = msg_proc; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.cbWndExtra = 0; + wc.cbClsExtra = 0; + wc.hInstance = (HINSTANCE) g_xvid_hInst; + wc.hbrBackground = (HBRUSH) GetStockObject(NULL_BRUSH); + wc.lpszMenuName = NULL; + wc.lpszClassName = "XVID_MSG_WINDOW"; + wc.hIcon = NULL; + wc.hIconSm = NULL; + wc.hCursor = NULL; + RegisterClassEx(&wc); + + MSG_hwnd = CreateWindowEx(0, "XVID_MSG_WINDOW", NULL, 0, CW_USEDEFAULT, + CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE) g_xvid_hInst, NULL); + + /* display the tray icon */ + NOTIFYICONDATA nid; + ZeroMemory(&nid,sizeof(NOTIFYICONDATA)); + + nid.cbSize = NOTIFYICONDATA_V1_SIZE; + nid.hWnd = MSG_hwnd; + nid.uID = 1456; + nid.uCallbackMessage = WM_ICONMESSAGE; + nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); + strcpy_s(nid.szTip, 19, "Xvid Video Decoder"); + nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; + + Shell_NotifyIcon(NIM_ADD, &nid); + + DestroyIcon(nid.hIcon); + Tray_Icon = 1; + } +#endif + + LeaveCriticalSection(&m_mft_lock); + return hr; +} + +HRESULT CXvidDecoder::MFTGetInputCurrentType(DWORD dwInputStreamID, IMFMediaType **ppType) +{ + DPRINTF("(MFT)GetInputCurrentType"); + + if (ppType == NULL) + return E_POINTER; + + if (dwInputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + + if (!m_pInputType) + hr = MF_E_TRANSFORM_TYPE_NOT_SET; + + if (SUCCEEDED(hr)) { + *ppType = m_pInputType; + (*ppType)->AddRef(); + } + + LeaveCriticalSection(&m_mft_lock); + return hr; +} + +HRESULT CXvidDecoder::MFTGetOutputCurrentType(DWORD dwOutputStreamID, IMFMediaType **ppType) +{ + DPRINTF("(MFT)GetOutputCurrentType"); + + if (ppType == NULL) + return E_POINTER; + + if (dwOutputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + + if (!m_pOutputType) + hr = MF_E_TRANSFORM_TYPE_NOT_SET; + + if (SUCCEEDED(hr)) { + *ppType = m_pOutputType; + (*ppType)->AddRef(); + } + + LeaveCriticalSection(&m_mft_lock); + return hr; +} + +HRESULT CXvidDecoder::MFTGetInputStatus(DWORD dwInputStreamID, DWORD *pdwFlags) +{ + DPRINTF("(MFT)GetInputStatus"); + + if (pdwFlags == NULL) + return E_POINTER; + + if (dwInputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + EnterCriticalSection(&m_mft_lock); + + /* If there's pending output sampels we don't accept new + input data until ProcessOutput() or Flush() was called */ + if (!HasPendingOutput()) { + *pdwFlags = MFT_INPUT_STATUS_ACCEPT_DATA; + } + else { + *pdwFlags = 0; + } + + LeaveCriticalSection(&m_mft_lock); + + return S_OK; +} + +HRESULT CXvidDecoder::MFTGetOutputStatus(DWORD *pdwFlags) +{ + DPRINTF("(MFT)GetOutputStatus"); + + if (pdwFlags == NULL) + return E_POINTER; + + EnterCriticalSection(&m_mft_lock); + + /* We can render an output sample only after we + have decoded one */ + if (HasPendingOutput()) { + *pdwFlags = MFT_OUTPUT_STATUS_SAMPLE_READY; + } + else { + *pdwFlags = 0; + } + + LeaveCriticalSection(&m_mft_lock); + + return S_OK; +} + +HRESULT CXvidDecoder::MFTSetOutputBounds(LONGLONG hnsLowerBound, LONGLONG hnsUpperBound) +{ + DPRINTF("(MFT)SetOutputBounds"); + return E_NOTIMPL; +} + +HRESULT CXvidDecoder::MFTProcessEvent(DWORD dwInputStreamID, IMFMediaEvent *pEvent) +{ + DPRINTF("(MFT)ProcessEvent"); + return E_NOTIMPL; /* We don't handle any stream events */ +} + +HRESULT CXvidDecoder::MFTProcessMessage(MFT_MESSAGE_TYPE eMessage, ULONG_PTR ulParam) +{ + DPRINTF("(MFT)ProcessMessage"); + HRESULT hr = S_OK; + + EnterCriticalSection(&m_mft_lock); + + switch (eMessage) + { + case MFT_MESSAGE_COMMAND_FLUSH: + if (m_create.handle != NULL) { + DPRINTF("(MFT)CommandFlush"); + + xvid_dec_stats_t stats; + int used_bytes; + + memset(&stats, 0, sizeof(stats)); + stats.version = XVID_VERSION; + + int csp = m_frame.output.csp; + + m_frame.output.csp = XVID_CSP_INTERNAL; + m_frame.bitstream = NULL; + m_frame.length = -1; + m_frame.general = XVID_LOWDELAY; + + do { + used_bytes = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); + } while(used_bytes>=0 && stats.type <= 0); + + m_frame.output.csp = csp; + m_frame.output.plane[1] = NULL; /* Don't display flushed samples */ + + //m_timestamp = INVALID_TIME; + //m_timelength = INVALID_TIME; + //m_rtFrame = 0; + } + break; + + case MFT_MESSAGE_COMMAND_DRAIN: + m_discont = 1; /* Set discontinuity flag */ + m_rtFrame = 0; + break; + + case MFT_MESSAGE_SET_D3D_MANAGER: + hr = E_NOTIMPL; + break; + + case MFT_MESSAGE_NOTIFY_BEGIN_STREAMING: + case MFT_MESSAGE_NOTIFY_END_STREAMING: + break; + + case MFT_MESSAGE_NOTIFY_START_OF_STREAM: + case MFT_MESSAGE_NOTIFY_END_OF_STREAM: + break; + } + + LeaveCriticalSection(&m_mft_lock); + + return hr; +} + +HRESULT CXvidDecoder::MFTProcessInput(DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags) +{ + DPRINTF("(MFT)ProcessInput"); + + if (pSample == NULL) + return E_POINTER; + + if (dwInputStreamID != 0) + return MF_E_INVALIDSTREAMNUMBER; + + if (dwFlags != 0) + return E_INVALIDARG; + + if (!m_pInputType || !m_pOutputType) { + return MF_E_NOTACCEPTING; /* Must have set input and output types */ + } + else if (HasPendingOutput()) { + return MF_E_NOTACCEPTING; /* We still have output samples to render */ + } + + xvid_dec_stats_t stats; + int length; + + memset(&stats, 0, sizeof(stats)); + stats.version = XVID_VERSION; + + if (m_create.handle == NULL) + { + if (xvid_decore_func == NULL) + return E_FAIL; + if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) + { + DPRINTF("*** XVID_DEC_CREATE error"); + return E_FAIL; + } + } + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + IMFMediaBuffer *pBuffer; + + if (SUCCEEDED(hr)) { + hr = pSample->ConvertToContiguousBuffer(&pBuffer); + } + + if (SUCCEEDED(hr)) { + hr = pBuffer->Lock((BYTE**)&m_frame.bitstream, NULL, (DWORD *)&m_frame.length); + } + + m_frame.general = XVID_LOWDELAY; + + if (m_discont == 1) { + m_frame.general |= XVID_DISCONTINUITY; + m_discont = 0; + } + + if (g_config.nDeblock_Y) + m_frame.general |= XVID_DEBLOCKY; + + if (g_config.nDeblock_UV) + m_frame.general |= XVID_DEBLOCKUV; + + if (g_config.nDering_Y) + m_frame.general |= XVID_DERINGY; + + if (g_config.nDering_UV) + m_frame.general |= XVID_DERINGUV; + + if (g_config.nFilmEffect) + m_frame.general |= XVID_FILMEFFECT; + + m_frame.brightness = g_config.nBrightness; + + m_frame.output.csp &= ~XVID_CSP_VFLIP; + m_frame.output.csp |= rgb_flip^(g_config.nFlipVideo ? XVID_CSP_VFLIP : 0); + + int csp = m_frame.output.csp; + m_frame.output.csp = XVID_CSP_INTERNAL; + + // Paranoid check. + if (xvid_decore_func == NULL) { + hr = E_FAIL; + goto END_LOOP; + } + +repeat : + length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats); + + if (length == XVID_ERR_MEMORY) { + hr = E_FAIL; + goto END_LOOP; + } + else if (length < 0) + { + DPRINTF("*** XVID_DEC_DECODE"); + goto END_LOOP; + } + + if (stats.type == XVID_TYPE_NOTHING && length > 0) { + DPRINTF(" B-Frame decoder lag"); + m_frame.output.plane[1] = NULL; + goto END_LOOP; + } + + if (stats.type == XVID_TYPE_VOL) + { + if (stats.data.vol.width != m_create.width || + stats.data.vol.height != m_create.height) + { + DPRINTF("TODO: auto-resize"); + m_frame.output.plane[1] = NULL; + hr = E_FAIL; + } + + if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { /* auto */ + int par_x, par_y; + if (stats.data.vol.par == XVID_PAR_EXT) { + par_x = stats.data.vol.par_width; + par_y = stats.data.vol.par_height; + } else { + par_x = PARS[stats.data.vol.par-1][0]; + par_y = PARS[stats.data.vol.par-1][1]; + } + + ar_x = par_x * stats.data.vol.width; + ar_y = par_y * stats.data.vol.height; + } + + m_frame.bitstream = (BYTE*)m_frame.bitstream + length; + m_frame.length -= length; + goto repeat; + } + +END_LOOP: + m_frame.output.csp = csp; + + if (pBuffer) { + pBuffer->Unlock(); + pBuffer->Release(); + } + + if (SUCCEEDED(hr)) { + /* Try to get a timestamp */ + if (FAILED(pSample->GetSampleTime(&m_timestamp))) + m_timestamp = INVALID_TIME; + + if (FAILED(pSample->GetSampleDuration(&m_timelength))) { + m_timelength = INVALID_TIME; + } + if (m_timestamp != INVALID_TIME && stats.type == XVID_TYPE_IVOP) { + m_rtFrame = m_timestamp; + } + } + + LeaveCriticalSection(&m_mft_lock); + + return hr; +} + +HRESULT CXvidDecoder::MFTProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount, MFT_OUTPUT_DATA_BUFFER *pOutputSamples, DWORD *pdwStatus) +{ + DPRINTF("(MFT)ProcessOutput"); + + /* Preroll in MFT ?? + Flags ?? -> TODO... */ + if (dwFlags != 0) + return E_INVALIDARG; + + if (pOutputSamples == NULL || pdwStatus == NULL) + return E_POINTER; + + if (cOutputBufferCount != 1) /* Must be exactly one output buffer */ + return E_INVALIDARG; + + if (pOutputSamples[0].pSample == NULL) /* Must have a sample */ + return E_INVALIDARG; + + if (!HasPendingOutput()) { /* If there's no sample we need to decode one first */ + return MF_E_TRANSFORM_NEED_MORE_INPUT; + } + + EnterCriticalSection(&m_mft_lock); + + HRESULT hr = S_OK; + + BYTE *Dst = NULL; + DWORD buffer_size; + + IMFMediaBuffer *pOutput = NULL; + + if (SUCCEEDED(hr)) { + hr = pOutputSamples[0].pSample->GetBufferByIndex(0, &pOutput); /* Get output buffer */ + } + + if (SUCCEEDED(hr)) { + hr = pOutput->GetMaxLength(&buffer_size); + } + + if (SUCCEEDED(hr)) + hr = pOutput->Lock(&Dst, NULL, NULL); + + if (SUCCEEDED(hr)) { + xvid_gbl_convert_t convert; + + memset(&convert, 0, sizeof(convert)); + convert.version = XVID_VERSION; + + convert.input.csp = XVID_CSP_INTERNAL; + convert.input.plane[0] = m_frame.output.plane[0]; + convert.input.plane[1] = m_frame.output.plane[1]; + convert.input.plane[2] = m_frame.output.plane[2]; + convert.input.stride[0] = m_frame.output.stride[0]; + convert.input.stride[1] = m_frame.output.stride[1]; + convert.input.stride[2] = m_frame.output.stride[2]; + + convert.output.csp = m_frame.output.csp; + convert.output.plane[0] = Dst; + convert.output.stride[0] = out_stride; + + convert.width = m_create.width; + convert.height = m_create.height; + convert.interlacing = 0; + + if (m_frame.output.plane[1] != NULL && Dst != NULL && xvid_global_func != NULL) + if (xvid_global_func(0, XVID_GBL_CONVERT, &convert, NULL) < 0) /* CSP convert into output buffer */ + hr = E_FAIL; + + m_frame.output.plane[1] = NULL; + } + + *pdwStatus = 0; + + if (SUCCEEDED(hr)) { + if (SUCCEEDED(hr)) + hr = pOutputSamples[0].pSample->SetUINT32(MFSampleExtension_CleanPoint, TRUE); // key frame + + if (SUCCEEDED(hr)) { /* Set timestamp of output sample */ + if (m_timestamp != INVALID_TIME) + hr = pOutputSamples[0].pSample->SetSampleTime(m_timestamp); + else + hr = pOutputSamples[0].pSample->SetSampleTime(m_rtFrame); + + if (m_timelength != INVALID_TIME) + hr = pOutputSamples[0].pSample->SetSampleDuration(m_timelength); + else + hr = pOutputSamples[0].pSample->SetSampleDuration(m_duration); + + m_rtFrame += m_duration; + } + + if (SUCCEEDED(hr)) + hr = pOutput->SetCurrentLength(m_create.width * abs(m_create.height) * 4); // XXX + } + + if (pOutput) { + pOutput->Unlock(); + pOutput->Release(); + } + + LeaveCriticalSection(&m_mft_lock); + + return hr; +} + +HRESULT CXvidDecoder::OnCheckInputType(IMFMediaType *pmt) +{ + DPRINTF("(MFT)CheckInputType"); + + HRESULT hr = S_OK; + + /* Check if input type is already set. Reject any type that is not identical */ + if (m_pInputType) { + DWORD dwFlags = 0; + if (S_OK == m_pInputType->IsEqual(pmt, &dwFlags)) { + return S_OK; + } + else { + return MF_E_INVALIDTYPE; + } + } + + GUID majortype = {0}, subtype = {0}; + UINT32 width = 0, height = 0; + + hr = pmt->GetMajorType(&majortype); + + if (SUCCEEDED(hr)) { + if (majortype != MFMediaType_Video) { /* Must be Video */ + hr = MF_E_INVALIDTYPE; + } + } + + if (m_hdll == NULL) { + HRESULT hr = OpenLib(); + + if (FAILED(hr) || (m_hdll == NULL)) // Paranoid checks. + hr = MF_E_INVALIDTYPE; + } + + if (SUCCEEDED(hr)) { + hr = MFGetAttributeSize(pmt, MF_MT_FRAME_SIZE, &width, &height); + } + + /* Check the frame size */ + if (SUCCEEDED(hr)) { + if (width > 4096 || height > 4096) { + hr = MF_E_INVALIDTYPE; + } + } + m_create.width = width; + m_create.height = height; + + if (SUCCEEDED(hr)) { + if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { + hr = MFGetAttributeRatio(pmt, MF_MT_PIXEL_ASPECT_RATIO, (UINT32*)&ar_x, (UINT32*)&ar_y); + } + } + + /* TODO1: Make sure there really is a frame rate after all! + TODO2: Use the framerate for something! */ + MFRatio fps = {0}; + if (SUCCEEDED(hr)) { + hr = MFGetAttributeRatio(pmt, MF_MT_FRAME_RATE, (UINT32*)&fps.Numerator, (UINT32*)&fps.Denominator); + } + + if (SUCCEEDED(hr)) { + hr = pmt->GetGUID(MF_MT_SUBTYPE, &subtype); + } + + if (subtype == CLSID_MP4V || subtype == CLSID_MP4V_UC || + subtype == CLSID_LMP4 || subtype == CLSID_LMP4_UC || + subtype == CLSID_RMP4 || subtype == CLSID_RMP4_UC || + subtype == CLSID_SMP4 || subtype == CLSID_SMP4_UC || + subtype == CLSID_HDX4 || subtype == CLSID_HDX4_UC) { + if (!(g_config.supported_4cc & SUPPORT_MP4V)) { + CloseLib(); + hr = MF_E_INVALIDTYPE; + } + else m_create.fourcc = FOURCC_MP4V; + } + else if (subtype == CLSID_DIVX || subtype == CLSID_DIVX_UC) { + if (!(g_config.supported_4cc & SUPPORT_DIVX)) { + CloseLib(); + hr = MF_E_INVALIDTYPE; + } + else m_create.fourcc = FOURCC_DIVX; + } + else if (subtype == CLSID_DX50 || subtype == CLSID_DX50_UC) { + if (!(g_config.supported_4cc & SUPPORT_DIVX)) { + CloseLib(); + hr = MF_E_INVALIDTYPE; + } + else m_create.fourcc = FOURCC_DX50; + } + else if (subtype == CLSID_3IVX || subtype == CLSID_3IVX_UC || + subtype == CLSID_3IV0 || subtype == CLSID_3IV0_UC || + subtype == CLSID_3IV1 || subtype == CLSID_3IV1_UC || + subtype == CLSID_3IV2 || subtype == CLSID_3IV2_UC) { + if (!(g_config.supported_4cc & SUPPORT_3IVX)) { + CloseLib(); + hr = MF_E_INVALIDTYPE; + } + else m_create.fourcc = FOURCC_3IVX; + } + else if (subtype == CLSID_XVID || subtype == CLSID_XVID_UC) { + m_create.fourcc = FOURCC_XVID; + } + else { + DPRINTF("Unknown subtype!"); + CloseLib(); + hr = MF_E_INVALIDTYPE; + } + + /* haali media splitter reports VOL information in the format header */ + if (SUCCEEDED(hr)) + { + UINT32 cbSeqHeader = 0; + + (void)pmt->GetBlobSize(MF_MT_MPEG_SEQUENCE_HEADER, &cbSeqHeader); + + if (cbSeqHeader>0) { + xvid_dec_stats_t stats; + memset(&stats, 0, sizeof(stats)); + stats.version = XVID_VERSION; + + if (m_create.handle == NULL) { + if (xvid_decore_func == NULL) + hr = E_FAIL; + if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) { + DPRINTF("*** XVID_DEC_CREATE error"); + hr = E_FAIL; + } + } + + if (SUCCEEDED(hr)) { + (void)pmt->GetAllocatedBlob(MF_MT_MPEG_SEQUENCE_HEADER, (UINT8 **)&m_frame.bitstream, (UINT32 *)&m_frame.length); + m_frame.general = 0; + m_frame.output.csp = XVID_CSP_NULL; + + int ret = 0; + if ((ret=xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats)) >= 0) { + /* honour video dimensions reported in VOL header */ + if (stats.type == XVID_TYPE_VOL) { + m_create.width = stats.data.vol.width; + m_create.height = stats.data.vol.height; + } + } + + if (ret == XVID_ERR_MEMORY) hr = E_FAIL; + CoTaskMemFree(m_frame.bitstream); + } + } + } + + return hr; +} + +HRESULT CXvidDecoder::OnSetInputType(IMFMediaType *pmt) +{ + HRESULT hr = S_OK; + UINT32 w, h; + + if (m_pInputType) m_pInputType->Release(); + + hr = MFGetAttributeSize(pmt, MF_MT_FRAME_SIZE, &w, &h); + m_create.width = w; m_create.height = h; + + if (SUCCEEDED(hr)) + hr = MFGetAttributeRatio(pmt, MF_MT_FRAME_RATE, (UINT32*)&m_frameRate.Numerator, (UINT32*)&m_frameRate.Denominator); + + if (SUCCEEDED(hr)) { /* Store frame duration, derived from the frame rate */ + hr = MFFrameRateToAverageTimePerFrame(m_frameRate.Numerator, m_frameRate.Denominator, &m_duration); + } + + if (SUCCEEDED(hr)) { + m_pInputType = pmt; + m_pInputType->AddRef(); + } + + return hr; +} + +HRESULT CXvidDecoder::OnSetOutputType(IMFMediaType *pmt) +{ + if (m_pOutputType) m_pOutputType->Release(); + + m_pOutputType = pmt; + m_pOutputType->AddRef(); + + return S_OK; +} + +#endif /* XVID_USE_MFT */ diff -Nru xvidcore-1.3.5/dshow/src/CXvidDecoder.h xvidcore-1.3.2/dshow/src/CXvidDecoder.h --- xvidcore-1.3.5/dshow/src/CXvidDecoder.h 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/dshow/src/CXvidDecoder.h 2011-05-18 09:02:35.000000000 +0000 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - XviD Decoder part of the DShow Filter - * - * Copyright(C) 2002-2012 Peter Ross + * Copyright(C) 2002-2010 Peter Ross * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,19 +19,17 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: CXvidDecoder.h 2131 2016-01-08 17:44:53Z Isibaar $ + * $Id: CXvidDecoder.h 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ #ifndef _FILTER_H_ #define _FILTER_H_ -#include #include #include "IXvidDecoder.h" #define XVID_NAME_L L"Xvid MPEG-4 Video Decoder" -#define XVID_NAME_MFT_L L"Xvid MPEG-4 Video Decoder MFT" /* --- fourcc --- */ @@ -155,7 +153,7 @@ private : - HRESULT ChangeColorspace(GUID subtype, GUID formattype, void * format, int *bitdepth, int noflip); + HRESULT ChangeColorspace(GUID subtype, GUID formattype, void * format, int noflip); HRESULT OpenLib(); void CloseLib(); @@ -166,15 +164,11 @@ int (*xvid_global_func)(void *handle, int opt, void *param1, void *param2); int (*xvid_decore_func)(void *handle, int opt, void *param1, void *param2); int ar_x, ar_y; - int interlaced; bool forced_ar; int rgb_flip; int out_stride; - clock_t m_startClock; - int m_tray_icon; - /* mft stuff */ #if defined(XVID_USE_MFT) BOOL HasPendingOutput() const { return m_frame.output.plane[1] != NULL; } @@ -182,11 +176,10 @@ HRESULT OnSetInputType(IMFMediaType *pmt); HRESULT OnCheckInputType(IMFMediaType *pmt); - HRESULT OnSetOutputType(IMFMediaType *pmt, int bitdepth); + HRESULT OnSetOutputType(IMFMediaType *pmt); IMFMediaType *m_pInputType; IMFMediaType *m_pOutputType; - int m_pOutputTypeBPP; CRITICAL_SECTION m_mft_lock; REFERENCE_TIME m_timestamp; @@ -198,11 +191,15 @@ REFERENCE_TIME m_rtFrame; MFRatio m_frameRate; UINT64 m_duration; - - HANDLE m_thread_handle; #endif + +#ifdef XVID_USE_TRAYICON + HWND MSG_hwnd; /* message handler window */ }; #define WM_ICONMESSAGE (WM_USER + 1) +#else +}; +#endif static const int PARS[][2] = { {1, 1}, diff -Nru xvidcore-1.3.5/dshow/src/config.c xvidcore-1.3.2/dshow/src/config.c --- xvidcore-1.3.5/dshow/src/config.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/dshow/src/config.c 2011-05-18 16:13:23.000000000 +0000 @@ -1,310 +1,283 @@ -/***************************************************************************** - * - * XVID MPEG-4 VIDEO CODEC - * - Configuration processing - - * - * Copyright(C) 2002-2012 Peter Ross - * - * This program is free software ; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation ; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY ; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program ; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: config.c 2114 2015-06-14 19:18:14Z Isibaar $ - * - ****************************************************************************/ - -#include -#include -#include -#include "config.h" -#include "debug.h" -#include "resource.h" - - -// ----------------------------------------- -// global config structure -CONFIG g_config; - - - -void LoadRegistryInfo() -{ - HKEY hKey; - DWORD size; - RegOpenKeyEx(XVID_REG_KEY, XVID_REG_SUBKEY, 0, KEY_READ, &hKey); - - // Set the default post-processing settings - REG_GET_N("Brightness", g_config.nBrightness, 0) - REG_GET_N("Deblock_Y", g_config.nDeblock_Y, 0) - REG_GET_N("Deblock_UV", g_config.nDeblock_UV, 0) - REG_GET_N("Dering_Y", g_config.nDering_Y, 0) - REG_GET_N("Dering_UV", g_config.nDering_UV, 0) - REG_GET_N("FilmEffect", g_config.nFilmEffect, 0) - REG_GET_N("ForceColorspace", g_config.nForceColorspace, 0) - REG_GET_N("FlipVideo", g_config.nFlipVideo, 0) - REG_GET_N("Supported_4CC", g_config.supported_4cc, 0) - REG_GET_N("Videoinfo_Compat", g_config.videoinfo_compat, 0) - REG_GET_N("Decoder_Aspect_Ratio", g_config.aspect_ratio, 0) - REG_GET_N("num_threads", g_config.num_threads, 0) - REG_GET_N("cpu_flags", g_config.cpu, 0) - REG_GET_N("Tray_Icon", g_config.bTrayIcon, 1); - - RegCloseKey(hKey); -} - -void SaveRegistryInfo(int perfCount) -{ - HKEY hKey; - DWORD dispo; - - if (RegCreateKeyEx( - XVID_REG_KEY, - XVID_REG_SUBKEY, - 0, - XVID_REG_CLASS, - REG_OPTION_NON_VOLATILE, - KEY_WRITE, - 0, - &hKey, - &dispo) != ERROR_SUCCESS) - { - OutputDebugString("Couldn't create XVID_REG_SUBKEY"); - return; - } - - if (perfCount > 0) { - unsigned int updateCount = 0; - HKEY hKey2 = hKey; - DWORD size; - - RegOpenKeyEx(XVID_REG_KEY, XVID_REG_SUBKEY, 0, KEY_READ, &hKey); - REG_GET_N("PerfCount", updateCount, 0); - RegCloseKey(hKey); - hKey = hKey2; - updateCount += perfCount; - REG_SET_N("PerfCount", updateCount); - } - else { - REG_SET_N("Brightness", g_config.nBrightness); - REG_SET_N("Deblock_Y", g_config.nDeblock_Y); - REG_SET_N("Deblock_UV", g_config.nDeblock_UV); - REG_SET_N("Dering_Y", g_config.nDering_Y); - REG_SET_N("Dering_UV", g_config.nDering_UV); - REG_SET_N("FilmEffect", g_config.nFilmEffect); - REG_SET_N("ForceColorspace", g_config.nForceColorspace); - REG_SET_N("FlipVideo", g_config.nFlipVideo); - REG_SET_N("Supported_4CC", g_config.supported_4cc); - REG_SET_N("Videoinfo_Compat", g_config.videoinfo_compat); - REG_SET_N("Decoder_Aspect_Ratio", g_config.aspect_ratio); - REG_SET_N("num_threads", g_config.num_threads); - REG_SET_N("Tray_Icon", g_config.bTrayIcon); - } - - RegCloseKey(hKey); -} - - - -INT_PTR CALLBACK adv_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - HWND hBrightness; - - switch ( uMsg ) - { - case WM_DESTROY: - { - LPARAM nForceColorspace; - LPARAM aspect_ratio; - - nForceColorspace = SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_GETCURSEL, 0, 0); - if ( g_config.nForceColorspace != nForceColorspace ) - { - MessageBox(0, "You have changed the output colorspace.\r\nClose the movie and open it for the new colorspace to take effect.", "Xvid DShow", MB_TOPMOST); - } - g_config.nForceColorspace = (int) nForceColorspace; - - aspect_ratio = SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_GETCURSEL, 0, 0); - if ( g_config.aspect_ratio != aspect_ratio ) - { - MessageBox(0, "You have changed the default aspect ratio.\r\nClose the movie and open it for the new aspect ratio to take effect.", "Xvid DShow", MB_TOPMOST); - } - g_config.aspect_ratio = (int) aspect_ratio; - SaveRegistryInfo(0); - } - break; - - case WM_INITDIALOG: - { - xvid_gbl_info_t info; - char core[100]; - HINSTANCE m_hdll; - - memset(&info, 0, sizeof(info)); - info.version = XVID_VERSION; - - m_hdll = LoadLibrary(XVID_DLL_NAME); - if (m_hdll != NULL) { - - ((int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global")) - (0, XVID_GBL_INFO, &info, NULL); - - wsprintf(core, "Xvid MPEG-4 Video Codec v%d.%d.%d", - XVID_VERSION_MAJOR(info.actual_version), - XVID_VERSION_MINOR(info.actual_version), - XVID_VERSION_PATCH(info.actual_version)); - - FreeLibrary(m_hdll); - } else { - wsprintf(core, "xvidcore.dll not found!"); - } - - SetDlgItemText(hwnd, IDC_CORE, core); - } - - // Load Force Colorspace Box - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"No Force"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YV12"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YUY2"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB24"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB32"); - - // Select Colorspace - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, g_config.nForceColorspace, 0); - - hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); - SendMessage(hBrightness, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(-96, 96)); - SendMessage(hBrightness, TBM_SETTICFREQ, (WPARAM)16, (LPARAM)0); - SendMessage(hBrightness, TBM_SETPOS, (WPARAM)TRUE, (LPARAM) g_config.nBrightness); - - // Load Aspect Ratio Box - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"Auto (MPEG-4 first)"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"Auto (external first)"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"4:3"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"16:9"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"2.35:1"); - - // Select Aspect Ratio - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_SETCURSEL, g_config.aspect_ratio, 0); - - - // Load Buttons - SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, g_config.nDeblock_Y, 0); - SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, g_config.nDeblock_UV, 0); - SendMessage(GetDlgItem(hwnd, IDC_DERINGY), BM_SETCHECK, g_config.nDering_Y, 0); - SendMessage(GetDlgItem(hwnd, IDC_DERINGUV), BM_SETCHECK, g_config.nDering_UV, 0); - SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, g_config.nFilmEffect, 0); - SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, g_config.nFlipVideo, 0); - - // 4CC checkbuttons - SendMessage(GetDlgItem(hwnd, IDC_DIVX), BM_SETCHECK, g_config.supported_4cc & SUPPORT_DIVX, 0); - SendMessage(GetDlgItem(hwnd, IDC_3IVX), BM_SETCHECK, g_config.supported_4cc & SUPPORT_3IVX, 0); - SendMessage(GetDlgItem(hwnd, IDC_MP4V), BM_SETCHECK, g_config.supported_4cc & SUPPORT_MP4V, 0); - SendMessage(GetDlgItem(hwnd, IDC_COMPAT), BM_SETCHECK, g_config.videoinfo_compat, 0); - - - // TrayIcon - SendMessage(GetDlgItem(hwnd, IDC_TRAYICON), BM_SETCHECK, g_config.bTrayIcon, 0); - - EnableWindow(GetDlgItem(hwnd,IDC_DERINGY),g_config.nDeblock_Y); - EnableWindow(GetDlgItem(hwnd,IDC_DERINGUV),g_config.nDeblock_UV); - - EnableWindow(GetDlgItem(hwnd, IDC_USE_AR), !g_config.videoinfo_compat); - - // Set Date & Time of Compilation - DPRINTF("(%s %s)", __DATE__, __TIME__); - break; - - case WM_COMMAND: - switch ( wParam ) - { - case IDC_RESET: - ZeroMemory(&g_config, sizeof(CONFIG)); - g_config.bTrayIcon = 1; - - hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); - SendMessage(hBrightness, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) g_config.nBrightness); - - // Load Buttons - SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, g_config.nDeblock_Y, 0); - SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, g_config.nDeblock_UV, 0); - SendMessage(GetDlgItem(hwnd, IDC_DERINGY), BM_SETCHECK, g_config.nDering_Y, 0); - SendMessage(GetDlgItem(hwnd, IDC_DERINGUV), BM_SETCHECK, g_config.nDering_UV, 0); - SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, g_config.nFilmEffect, 0); - SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, g_config.nFlipVideo, 0); - g_config.nForceColorspace = 0; - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, g_config.nForceColorspace, 0); - g_config.aspect_ratio = 0; - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_SETCURSEL, g_config.aspect_ratio, 0); - SendMessage(GetDlgItem(hwnd, IDC_TRAYICON), CB_SETCURSEL, g_config.bTrayIcon, 0); - break; - case IDC_DEBLOCK_Y: - g_config.nDeblock_Y = !g_config.nDeblock_Y; - break; - case IDC_DEBLOCK_UV: - g_config.nDeblock_UV = !g_config.nDeblock_UV; - break; - case IDC_DERINGY: - g_config.nDering_Y = !g_config.nDering_Y; - break; - case IDC_DERINGUV: - g_config.nDering_UV = !g_config.nDering_UV; - break; - case IDC_FILMEFFECT: - g_config.nFilmEffect = !g_config.nFilmEffect; - break; - case IDC_FLIPVIDEO: - g_config.nFlipVideo = !g_config.nFlipVideo; - break; - case IDC_DIVX: - g_config.supported_4cc ^= SUPPORT_DIVX; - break; - case IDC_3IVX: - g_config.supported_4cc ^= SUPPORT_3IVX; - break; - case IDC_MP4V: - g_config.supported_4cc ^= SUPPORT_MP4V; - break; - case IDC_COMPAT: - g_config.videoinfo_compat = !g_config.videoinfo_compat; - break; - case IDC_TRAYICON: - g_config.bTrayIcon = !g_config.bTrayIcon; - break; - default : - return FALSE; - } - EnableWindow(GetDlgItem(hwnd,IDC_DERINGY),g_config.nDeblock_Y); - EnableWindow(GetDlgItem(hwnd,IDC_DERINGUV),g_config.nDeblock_UV); - - EnableWindow(GetDlgItem(hwnd, IDC_USE_AR), !g_config.videoinfo_compat); - - SaveRegistryInfo(0); - - - break; - case WM_NOTIFY: - hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); - g_config.nBrightness = (int) SendMessage(hBrightness, TBM_GETPOS, (WPARAM)NULL, (LPARAM)NULL); - SaveRegistryInfo(0); - break; - default : - return FALSE; - } - - return TRUE; /* ok */ -} - - - - - +/***************************************************************************** + * + * XVID MPEG-4 VIDEO CODEC + * - Configuration processing - + * + * Copyright(C) 2002-2011 Peter Ross + * + * This program is free software ; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation ; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program ; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: config.c 1995 2011-05-18 16:13:23Z Isibaar $ + * + ****************************************************************************/ + +#include +#include +#include +#include "config.h" +#include "debug.h" +#include "resource.h" + + +// ----------------------------------------- +// global config structure +CONFIG g_config; + + + +void LoadRegistryInfo() +{ + HKEY hKey; + DWORD size; + RegOpenKeyEx(XVID_REG_KEY, XVID_REG_SUBKEY, 0, KEY_READ, &hKey); + + // Set the default post-processing settings + REG_GET_N("Brightness", g_config.nBrightness, 0) + REG_GET_N("Deblock_Y", g_config.nDeblock_Y, 0) + REG_GET_N("Deblock_UV", g_config.nDeblock_UV, 0) + REG_GET_N("Dering_Y", g_config.nDering_Y, 0) + REG_GET_N("Dering_UV", g_config.nDering_UV, 0) + REG_GET_N("FilmEffect", g_config.nFilmEffect, 0) + REG_GET_N("ForceColorspace", g_config.nForceColorspace, 0) + REG_GET_N("FlipVideo", g_config.nFlipVideo, 0) + REG_GET_N("Supported_4CC", g_config.supported_4cc, 0) + REG_GET_N("Videoinfo_Compat", g_config.videoinfo_compat, 0) + REG_GET_N("Decoder_Aspect_Ratio", g_config.aspect_ratio, 0) + REG_GET_N("num_threads", g_config.num_threads, 0) + REG_GET_N("cpu_flags", g_config.cpu, 0) + + RegCloseKey(hKey); +} + +void SaveRegistryInfo() +{ + HKEY hKey; + DWORD dispo; + + if (RegCreateKeyEx( + XVID_REG_KEY, + XVID_REG_SUBKEY, + 0, + XVID_REG_CLASS, + REG_OPTION_NON_VOLATILE, + KEY_WRITE, + 0, + &hKey, + &dispo) != ERROR_SUCCESS) + { + OutputDebugString("Couldn't create XVID_REG_SUBKEY"); + return; + } + + REG_SET_N("Brightness", g_config.nBrightness); + REG_SET_N("Deblock_Y", g_config.nDeblock_Y); + REG_SET_N("Deblock_UV", g_config.nDeblock_UV); + REG_SET_N("Dering_Y", g_config.nDering_Y); + REG_SET_N("Dering_UV", g_config.nDering_UV); + REG_SET_N("FilmEffect", g_config.nFilmEffect); + REG_SET_N("ForceColorspace", g_config.nForceColorspace); + REG_SET_N("FlipVideo", g_config.nFlipVideo); + REG_SET_N("Supported_4CC", g_config.supported_4cc); + REG_SET_N("Videoinfo_Compat", g_config.videoinfo_compat); + REG_SET_N("Decoder_Aspect_Ratio", g_config.aspect_ratio); + REG_SET_N("num_threads", g_config.num_threads); + + RegCloseKey(hKey); +} + + + +INT_PTR CALLBACK adv_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + HWND hBrightness; + + switch ( uMsg ) + { + case WM_DESTROY: + { + LPARAM nForceColorspace; + LPARAM aspect_ratio; + + nForceColorspace = SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_GETCURSEL, 0, 0); + if ( g_config.nForceColorspace != nForceColorspace ) + { + MessageBox(0, "You have changed the output colorspace.\r\nClose the movie and open it for the new colorspace to take effect.", "Xvid DShow", MB_TOPMOST); + } + g_config.nForceColorspace = (int) nForceColorspace; + + aspect_ratio = SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_GETCURSEL, 0, 0); + if ( g_config.aspect_ratio != aspect_ratio ) + { + MessageBox(0, "You have changed the default aspect ratio.\r\nClose the movie and open it for the new aspect ratio to take effect.", "Xvid DShow", MB_TOPMOST); + } + g_config.aspect_ratio = (int) aspect_ratio; + SaveRegistryInfo(); + } + break; + + case WM_INITDIALOG: + { + xvid_gbl_info_t info; + char core[100]; + HINSTANCE m_hdll; + + memset(&info, 0, sizeof(info)); + info.version = XVID_VERSION; + + m_hdll = LoadLibrary(XVID_DLL_NAME); + if (m_hdll != NULL) { + + ((int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global")) + (0, XVID_GBL_INFO, &info, NULL); + + wsprintf(core, "Xvid MPEG-4 Video Codec v%d.%d.%d", + XVID_VERSION_MAJOR(info.actual_version), + XVID_VERSION_MINOR(info.actual_version), + XVID_VERSION_PATCH(info.actual_version)); + + FreeLibrary(m_hdll); + } else { + wsprintf(core, "xvidcore.dll not found!"); + } + + SetDlgItemText(hwnd, IDC_CORE, core); + } + + // Load Force Colorspace Box + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"No Force"); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YV12"); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YUY2"); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB24"); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB32"); + + // Select Colorspace + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, g_config.nForceColorspace, 0); + + hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); + SendMessage(hBrightness, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(-96, 96)); + SendMessage(hBrightness, TBM_SETTICFREQ, (WPARAM)16, (LPARAM)0); + SendMessage(hBrightness, TBM_SETPOS, (WPARAM)TRUE, (LPARAM) g_config.nBrightness); + + // Load Aspect Ratio Box + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"Auto (MPEG-4 first)"); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"Auto (external first)"); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"4:3"); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"16:9"); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"2.35:1"); + + // Select Aspect Ratio + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_SETCURSEL, g_config.aspect_ratio, 0); + + + // Load Buttons + SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, g_config.nDeblock_Y, 0); + SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, g_config.nDeblock_UV, 0); + SendMessage(GetDlgItem(hwnd, IDC_DERINGY), BM_SETCHECK, g_config.nDering_Y, 0); + SendMessage(GetDlgItem(hwnd, IDC_DERINGUV), BM_SETCHECK, g_config.nDering_UV, 0); + SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, g_config.nFilmEffect, 0); + SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, g_config.nFlipVideo, 0); + + // 4CC checkbuttons + SendMessage(GetDlgItem(hwnd, IDC_DIVX), BM_SETCHECK, g_config.supported_4cc & SUPPORT_DIVX, 0); + SendMessage(GetDlgItem(hwnd, IDC_3IVX), BM_SETCHECK, g_config.supported_4cc & SUPPORT_3IVX, 0); + SendMessage(GetDlgItem(hwnd, IDC_MP4V), BM_SETCHECK, g_config.supported_4cc & SUPPORT_MP4V, 0); + SendMessage(GetDlgItem(hwnd, IDC_COMPAT), BM_SETCHECK, g_config.videoinfo_compat, 0); + + EnableWindow(GetDlgItem(hwnd,IDC_DERINGY),g_config.nDeblock_Y); + EnableWindow(GetDlgItem(hwnd,IDC_DERINGUV),g_config.nDeblock_UV); + + EnableWindow(GetDlgItem(hwnd, IDC_USE_AR), !g_config.videoinfo_compat); + + // Set Date & Time of Compilation + DPRINTF("(%s %s)", __DATE__, __TIME__); + break; + + case WM_COMMAND: + switch ( wParam ) + { + case IDC_RESET: + ZeroMemory(&g_config, sizeof(CONFIG)); + hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); + SendMessage(hBrightness, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) g_config.nBrightness); + // Load Buttons + SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_Y), BM_SETCHECK, g_config.nDeblock_Y, 0); + SendMessage(GetDlgItem(hwnd, IDC_DEBLOCK_UV), BM_SETCHECK, g_config.nDeblock_UV, 0); + SendMessage(GetDlgItem(hwnd, IDC_DERINGY), BM_SETCHECK, g_config.nDering_Y, 0); + SendMessage(GetDlgItem(hwnd, IDC_DERINGUV), BM_SETCHECK, g_config.nDering_UV, 0); + SendMessage(GetDlgItem(hwnd, IDC_FILMEFFECT), BM_SETCHECK, g_config.nFilmEffect, 0); + SendMessage(GetDlgItem(hwnd, IDC_FLIPVIDEO), BM_SETCHECK, g_config.nFlipVideo, 0); + g_config.nForceColorspace = 0; + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, g_config.nForceColorspace, 0); + g_config.aspect_ratio = 0; + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_SETCURSEL, g_config.aspect_ratio, 0); + break; + case IDC_DEBLOCK_Y: + g_config.nDeblock_Y = !g_config.nDeblock_Y; + break; + case IDC_DEBLOCK_UV: + g_config.nDeblock_UV = !g_config.nDeblock_UV; + break; + case IDC_DERINGY: + g_config.nDering_Y = !g_config.nDering_Y; + break; + case IDC_DERINGUV: + g_config.nDering_UV = !g_config.nDering_UV; + break; + case IDC_FILMEFFECT: + g_config.nFilmEffect = !g_config.nFilmEffect; + break; + case IDC_FLIPVIDEO: + g_config.nFlipVideo = !g_config.nFlipVideo; + break; + case IDC_DIVX: + g_config.supported_4cc ^= SUPPORT_DIVX; + break; + case IDC_3IVX: + g_config.supported_4cc ^= SUPPORT_3IVX; + break; + case IDC_MP4V: + g_config.supported_4cc ^= SUPPORT_MP4V; + break; + case IDC_COMPAT: + g_config.videoinfo_compat = !g_config.videoinfo_compat; + break; + default : + return FALSE; + } + EnableWindow(GetDlgItem(hwnd,IDC_DERINGY),g_config.nDeblock_Y); + EnableWindow(GetDlgItem(hwnd,IDC_DERINGUV),g_config.nDeblock_UV); + + EnableWindow(GetDlgItem(hwnd, IDC_USE_AR), !g_config.videoinfo_compat); + + SaveRegistryInfo(); + + + break; + case WM_NOTIFY: + hBrightness = GetDlgItem(hwnd, IDC_BRIGHTNESS); + g_config.nBrightness = (int) SendMessage(hBrightness, TBM_GETPOS, (WPARAM)NULL, (LPARAM)NULL); + SaveRegistryInfo(); + break; + default : + return FALSE; + } + + return TRUE; /* ok */ +} + + + + + diff -Nru xvidcore-1.3.5/dshow/src/config.h xvidcore-1.3.2/dshow/src/config.h --- xvidcore-1.3.5/dshow/src/config.h 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/dshow/src/config.h 2011-05-18 16:13:23.000000000 +0000 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - Configuration processing header file - * - * Copyright(C) 2002-2012 Peter Ross + * Copyright(C) 2002-2011 Peter Ross * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: config.h 2114 2015-06-14 19:18:14Z Isibaar $ + * $Id: config.h 1995 2011-05-18 16:13:23Z Isibaar $ * ****************************************************************************/ @@ -67,7 +67,6 @@ int aspect_ratio; int num_threads; DWORD cpu; - int bTrayIcon; } CONFIG; @@ -77,7 +76,7 @@ /* functions */ void LoadRegistryInfo(); -void SaveRegistryInfo(int perfCount); +void SaveRegistryInfo(); INT_PTR CALLBACK adv_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); #define XVID_DLL_NAME "xvidcore.dll" diff -Nru xvidcore-1.3.5/dshow/src/resource.h xvidcore-1.3.2/dshow/src/resource.h --- xvidcore-1.3.5/dshow/src/resource.h 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/dshow/src/resource.h 2011-05-18 16:13:23.000000000 +0000 @@ -1,43 +1,42 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by xvid.ax.rc -// -#define VERSION_RES_MINOR_VER 0 -#define VERSION_RES_BUILD 0 -#define VER_DEBUG 0 -#define IDS_ABOUT 1 -#define VERSION_RES_MAJOR_VER 8 -#define IDD_ABOUT 102 -#define IDB_LOGO 103 -#define IDI_ICON 104 -#define IDC_BRIGHTNESS 1002 -#define IDC_DEBLOCK_UV 1003 -#define IDC_DEBLOCK_Y 1004 -#define IDC_FLIPVIDEO 1005 -#define IDC_COLORSPACE 1006 -#define IDC_RESET 1007 -#define IDC_FILMEFFECT 1008 -#define IDC_DERING 1009 -#define IDC_DERINGY 1009 -#define IDC_DIVX 1010 -#define IDC_COMPAT 1011 -#define IDC_MP4V 1012 -#define IDC_3IVX 1013 -#define IDC_DERINGUV 1014 -#define IDC_USE_AR 1015 -#define IDC_CORE 1016 -#define IDC_TRAYICON 1017 -#define VERSION_RES_LANGUAGE 0x409 -#define VERSION_RES_CHARSET 1252 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 106 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1018 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by xvid.ax.rc +// +#define VERSION_RES_MINOR_VER 0 +#define VERSION_RES_BUILD 0 +#define VER_DEBUG 0 +#define IDS_ABOUT 1 +#define VERSION_RES_MAJOR_VER 8 +#define IDD_ABOUT 102 +#define IDB_LOGO 103 +#define IDI_ICON 104 +#define IDC_BRIGHTNESS 1002 +#define IDC_DEBLOCK_UV 1003 +#define IDC_DEBLOCK_Y 1004 +#define IDC_FLIPVIDEO 1005 +#define IDC_COLORSPACE 1006 +#define IDC_RESET 1007 +#define IDC_FILMEFFECT 1008 +#define IDC_DERING 1009 +#define IDC_DERINGY 1009 +#define IDC_DIVX 1010 +#define IDC_COMPAT 1011 +#define IDC_MP4V 1012 +#define IDC_3IVX 1013 +#define IDC_DERINGUV 1014 +#define IDC_USE_AR 1015 +#define IDC_CORE 1016 +#define VERSION_RES_LANGUAGE 0x409 +#define VERSION_RES_CHARSET 1252 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 106 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1017 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff -Nru xvidcore-1.3.5/dshow/src/xvid.ax.rc xvidcore-1.3.2/dshow/src/xvid.ax.rc --- xvidcore-1.3.5/dshow/src/xvid.ax.rc 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/dshow/src/xvid.ax.rc 2011-05-18 16:13:23.000000000 +0000 @@ -29,7 +29,7 @@ // Dialog // -IDD_ABOUT DIALOG DISCARDABLE 0, 0, 216, 296 +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 216, 267 STYLE WS_CHILD FONT 8, "MS Shell Dlg" BEGIN @@ -62,7 +62,7 @@ GROUPBOX "Other MPEG-4 video support",IDC_STATIC,7,187,202,29 CONTROL "Other",IDC_MP4V,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, 160,198,38,13 - PUSHBUTTON "Reset",IDC_RESET,79,282,50,12 + PUSHBUTTON "Reset",IDC_RESET,79,252,50,12 LTEXT "Output Colourspace",IDC_STATIC,136,151,67,9 CONTROL "Dering (UV)",IDC_DERINGUV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,123,53,10 @@ -71,9 +71,6 @@ 233,109,8 COMBOBOX IDC_USE_AR,135,230,68,95,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Display Tray-Icon when playing back Xvid video",IDC_TRAYICON, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,260,182,13 - GROUPBOX "GUI Options",IDC_STATIC,7,250,202,29 END Binary files /tmp/derivs-cmp-srcpkg-Canaima-a9l7o9f_/9pmwE0Gkww/xvidcore-1.3.5/dshow/src/xvid.ico and /tmp/derivs-cmp-srcpkg-Canaima-a9l7o9f_/4sEoz_chmN/xvidcore-1.3.2/dshow/src/xvid.ico differ diff -Nru xvidcore-1.3.5/examples/Makefile xvidcore-1.3.2/examples/Makefile --- xvidcore-1.3.5/examples/Makefile 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/examples/Makefile 2006-10-11 13:52:06.000000000 +0000 @@ -8,16 +8,9 @@ include ../build/generic/platform.inc -# is make running into windows? -ifdef SYSTEMROOT - EXTRALIBS = -lole32 -lavifil32 -lpthread -lm -else - EXTRALIBS = -lpthread -lc -lm -endif - HDIR = -I../src CFLAGS = -g $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) -LDFLAGS = ../build/generic/=build/$(STATIC_LIB) $(EXTRALIBS) +LDFLAGS = -lc -lm ../build/generic/=build/$(STATIC_LIB) -lpthread SOURCES= xvid_encraw.c xvid_decraw.c xvid_bench.c OBJECTS=$(SOURCES:.c=.o) diff -Nru xvidcore-1.3.5/examples/xvid_encraw.c xvidcore-1.3.2/examples/xvid_encraw.c --- xvidcore-1.3.5/examples/xvid_encraw.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/examples/xvid_encraw.c 2011-05-18 09:02:35.000000000 +0000 @@ -6,7 +6,7 @@ * Copyright(C) 2002-2003 Christoph Lampert * 2002-2003 Edouard Gomez * 2003 Peter Ross - * 2003-2014 Michael Militzer + * 2003-2010 Michael Militzer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid_encraw.c 2129 2015-07-08 17:32:58Z Isibaar $ + * $Id: xvid_encraw.c 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -40,10 +40,10 @@ ************************************************************************/ #include +//#include #include #include #include -#include #ifndef WIN32 #include #else @@ -126,13 +126,7 @@ #define MAX_ZONES 64 #define MAX_ENC_INSTANCES 4 -#define MAX_XDIM 4096 -#define MAX_YDIM 4096 #define DEFAULT_QUANT 400 -#define DEFAULT_BITRATE 700000 /* bitrate expressed in bps, not kbps */ -#define DEFAULT_INTERLACING 1 /* 1:BFF, 2:TFF */ -#define DEFAULT_SSIM 2 -#define DEFAULT_PROGRESS 10 /* show progress every 10 frames by default */ typedef struct { @@ -163,8 +157,6 @@ int stop_num; char *outfilename; /* output filename */ - char *outavifilename; /* output avi filename */ - char *outmkvfilename; /* output mkv filename */ char *statsfilename1; /* pass1 statsfile */ int input_num; @@ -195,7 +187,9 @@ static int ARG_NUM_APP_THREADS = 1; static int ARG_CPU_FLAGS = 0; +static int ARG_STATS = 0; static int ARG_SSIM = -1; +static int ARG_PSNRHVSM = 0; static char* ARG_SSIM_PATH = NULL; static int ARG_DUMP = 0; static int ARG_LUMIMASKING = 0; @@ -225,12 +219,21 @@ static int ARG_BQRATIO = 150; static int ARG_BQOFFSET = 100; static int ARG_MAXBFRAMES = 2; +static int ARG_PACKED = 1; static int ARG_DEBUG = 0; +static int ARG_VOPDEBUG = 0; +static int ARG_TRELLIS = 1; static int ARG_QTYPE = 0; static int ARG_QMATRIX = 0; +static int ARG_GMC = 0; static int ARG_INTERLACING = 0; +static int ARG_QPEL = 0; +static int ARG_TURBO = 0; static int ARG_VHQMODE = 1; +static int ARG_BVHQ = 0; static int ARG_QMETRIC = 0; +static int ARG_CLOSED_GOP = 1; +static int ARG_CHROMAME = 1; static int ARG_PAR = 1; static int ARG_PARHEIGHT; static int ARG_PARWIDTH; @@ -255,25 +258,12 @@ static int ARG_VBVPEAKRATE = 0; static int ARG_THREADS = 0; static int ARG_SLICES = 1; +static int ARG_VFR = 0; static int ARG_PROGRESS = 0; static int ARG_COLORSPACE = XVID_CSP_YV12; /* the path where to save output */ static char filepath[256] = "./"; -/* on/off options */ -static int ARG_USE_ASSEMBLER = 1; -static int ARG_TURBO = 0; -static int ARG_BVHQ = 0; -static int ARG_QPEL = 0; -static int ARG_GMC = 0; -static int ARG_PACKED = 1; -static int ARG_CLOSED_GOP = 1; -static int ARG_STATS = 0; -static int ARG_PSNRHVSM = 0; -static int ARG_VOPDEBUG = 0; -static int ARG_CHROMAME = 1; -static int ARG_TRELLIS = 1; - static unsigned char qmatrix_intra[64]; static unsigned char qmatrix_inter[64]; @@ -355,7 +345,7 @@ int input_num = 0; int totalsize = 0; - int use_assembler = ARG_USE_ASSEMBLER; + int use_assembler = 1; int i; printf("xvid_encraw - raw mpeg4 bitstream encoder "); @@ -406,7 +396,7 @@ ARG_BITRATE *= 1000; } else - ARG_BITRATE = DEFAULT_BITRATE; + ARG_BITRATE = 700000; } else if (strcmp("-size", argv[i]) == 0 && i < argc - 1) { i++; ARG_TARGETSIZE = atoi(argv[i]); @@ -455,8 +445,6 @@ ARG_PACKED = 2; } else if (strcmp("-nochromame", argv[i]) == 0) { ARG_CHROMAME = 0; - } else if (strcmp("-chromame", argv[i]) == 0) { - ARG_CHROMAME = 1; } else if (strcmp("-threads", argv[i]) == 0 && i < argc -1) { i++; ARG_THREADS = atoi(argv[i]); @@ -593,18 +581,14 @@ ARG_INPUTFILE = argv[i]; } else if (strcmp("-stats", argv[i]) == 0) { ARG_STATS = 1; - } else if (strcmp("-nostats", argv[i]) == 0) { - ARG_STATS = 0; } else if (strcmp("-ssim", argv[i]) == 0) { - ARG_SSIM = DEFAULT_SSIM; + ARG_SSIM = 2; if ((i < argc - 1) && (*argv[i+1] != '-')) { i++; ARG_SSIM = atoi(argv[i]); } } else if (strcmp("-psnrhvsm", argv[i]) == 0) { ARG_PSNRHVSM = 1; - } else if (strcmp("-nopsnrhvsm", argv[i]) == 0) { - ARG_PSNRHVSM = 0; } else if (strcmp("-ssim_file", argv[i]) == 0 && i < argc -1) { i++; ARG_SSIM_PATH = argv[i]; @@ -695,34 +679,22 @@ #endif } else if (strcmp("-vop_debug", argv[i]) == 0) { ARG_VOPDEBUG = 1; - } else if (strcmp("-novop_debug", argv[i]) == 0) { - ARG_VOPDEBUG = 0; - } else if (strcmp("-trellis", argv[i]) == 0) { - ARG_TRELLIS = 1; } else if (strcmp("-notrellis", argv[i]) == 0) { ARG_TRELLIS = 0; } else if (strcmp("-bvhq", argv[i]) == 0) { ARG_BVHQ = 1; - } else if (strcmp("-nobvhq", argv[i]) == 0) { - ARG_BVHQ = 0; } else if (strcmp("-qpel", argv[i]) == 0) { ARG_QPEL = 1; - } else if (strcmp("-noqpel", argv[i]) == 0) { - ARG_QPEL = 0; } else if (strcmp("-turbo", argv[i]) == 0) { ARG_TURBO = 1; - } else if (strcmp("-noturbo", argv[i]) == 0) { - ARG_TURBO = 0; } else if (strcmp("-gmc", argv[i]) == 0) { ARG_GMC = 1; - } else if (strcmp("-nogmc", argv[i]) == 0) { - ARG_GMC = 0; } else if (strcmp("-interlaced", argv[i]) == 0) { if ((i < argc - 1) && (*argv[i+1] != '-')) { i++; ARG_INTERLACING = atoi(argv[i]); } else { - ARG_INTERLACING = DEFAULT_INTERLACING; + ARG_INTERLACING = 1; } } else if (strcmp("-noclosed_gop", argv[i]) == 0) { ARG_CLOSED_GOP = 0; @@ -780,40 +752,9 @@ if (ARG_PROGRESS > 0) i++; else - ARG_PROGRESS = DEFAULT_PROGRESS; + ARG_PROGRESS = 10; } else if (strcmp("-help", argv[i]) == 0) { - if (i < argc - 1 && strcmp("zones", argv[i+1]) == 0) { - fprintf(stderr, "Zones options\n\ -NB: You can define up to %d zones using the -zones option as described below.\n\ -\n\ - -zones start,mode,value[,options][/start,mode,value[,options]]...\n\ -\n\ - Parameters of a zone use the comma (,) as a delimiter. Multiple zones are\n\ - separated by a slash (/). The end of each zone is defined by either the start\n\ - of the following zone or the last frame of the input file.\n\ -\n\ - start : start frame of the zone\n\ - mode : weight zone = w, quantizer zone = q\n\ - value : depending on mode either the zone's weight or quantizer\n\ - options : enable certain encoder features for the zone. Each feature is\n\ - represented by a single letter. An integer number stands for\n\ - b-frame sensitivity. To enable multiple features at the same time\n\ - combine the appropriate symbols without any delimiting characters.\n\ - K = begin with keyframe\n\ - O = enable chroma optimizer\n\ - G = greyscale encoding\n\ - C = cartoon mode\n\ - integer = b-frame sensitivity\n\ -\n\ - Example:\n\ - to create a first zone starting at frame 0 with weight 1.0, all options\n\ - enabled and b-frame sensitivity -5, and a second zone starting at frame 1000\n\ - with constant quant 4 and no options enabled you would use the -zones option\n\ - like this:\n\ -\n\ - -zones 0,w,1.0,-5KOGC/1000,q,4\n\n", MAX_ZONES); - } else - usage(); + usage(); return (0); } else { usage(); @@ -826,7 +767,7 @@ * Arguments checking ****************************************************************************/ - if (XDIM <= 0 || XDIM >= MAX_XDIM || YDIM <= 0 || YDIM >= MAX_YDIM) { + if (XDIM <= 0 || XDIM >= 4096 || YDIM <= 0 || YDIM >= 4096) { fprintf(stderr, "Trying to retrieve width and height from input header\n"); if (!ARG_INPUTTYPE) @@ -835,7 +776,7 @@ if (ARG_QUALITY < 0 ) { ARG_QUALITY = 0; - } else if (ARG_QUALITY >= (int) ME_ELEMENTS) { + } else if (ARG_QUALITY >= ME_ELEMENTS) { ARG_QUALITY = ME_ELEMENTS - 1; } @@ -928,20 +869,20 @@ if (avi_info.fccHandler != MAKEFOURCC('Y', 'V', '1', '2')) { LONG size; fprintf(stderr, "Non YV12 input colorspace %c%c%c%c! Attempting conversion...\n", - (char)avi_info.fccHandler%256, (char)(avi_info.fccHandler>>8)%256, (char)(avi_info.fccHandler>>16)%256, - (char)(avi_info.fccHandler>>24)%256); + avi_info.fccHandler%256, (avi_info.fccHandler>>8)%256, (avi_info.fccHandler>>16)%256, + (avi_info.fccHandler>>24)%256); size = sizeof(myBitmapInfoHeader); AVIStreamReadFormat(avi_in_stream, 0, &myBitmapInfoHeader, &size); if (size==0) fprintf(stderr, "AVIStreamReadFormat read 0 bytes.\n"); else { - fprintf(stderr, "AVIStreamReadFormat read %d bytes.\n", (int)size); - fprintf(stderr, "width = %d, height = %d, planes = %d\n", (int)myBitmapInfoHeader.biWidth, - (int)myBitmapInfoHeader.biHeight, myBitmapInfoHeader.biPlanes); + fprintf(stderr, "AVIStreamReadFormat read %d bytes.\n", size); + fprintf(stderr, "width = %d, height = %d, planes = %d\n", myBitmapInfoHeader.biWidth, + myBitmapInfoHeader.biHeight, myBitmapInfoHeader.biPlanes); fprintf(stderr, "Compression = %c%c%c%c, %d\n", - (char)myBitmapInfoHeader.biCompression%256, (char)(myBitmapInfoHeader.biCompression>>8)%256, - (char)(myBitmapInfoHeader.biCompression>>16)%256, (char)(myBitmapInfoHeader.biCompression>>24)%256, - (int)myBitmapInfoHeader.biCompression); + myBitmapInfoHeader.biCompression%256, (myBitmapInfoHeader.biCompression>>8)%256, + (myBitmapInfoHeader.biCompression>>16)%256, (myBitmapInfoHeader.biCompression>>24)%256, + myBitmapInfoHeader.biCompression); fprintf(stderr, "Bits Per Pixel = %d\n", myBitmapInfoHeader.biBitCount); myBitmapInfoHeader.biCompression = MAKEFOURCC('Y', 'V', '1', '2'); myBitmapInfoHeader.biBitCount = 12; @@ -995,17 +936,15 @@ #endif { FILE *in_file = fopen(ARG_INPUTFILE, "rb"); + int pos = 0; if (in_file == NULL) { fprintf(stderr, "Error opening input file %s\n", ARG_INPUTFILE); return (-1); } #ifdef USE_APP_LEVEL_THREADING - { - int pos; - fseek(in_file, 0, SEEK_END); /* Determine input size */ - pos = ftell(in_file); - ARG_MAXFRAMENR = pos / IMAGE_SIZE(XDIM, YDIM); /* PGM, header size ?? */ - } + fseek(in_file, 0, SEEK_END); /* Determine input size */ + pos = ftell(in_file); + ARG_MAXFRAMENR = pos / IMAGE_SIZE(XDIM, YDIM); /* PGM, header size ?? */ #endif fclose(in_file); } @@ -1036,7 +975,8 @@ #ifdef USE_APP_LEVEL_THREADING if (ARG_INPUTFILE == NULL || strcmp(ARG_INPUTFILE, "stdin") == 0 || ARG_NUM_APP_THREADS <= 1 || ARG_THREADS != 0 || - ARG_TIMECODEFILE != NULL || ARG_INPUTTYPE == 1) /* TODO: PGM input */ + ARG_TIMECODEFILE != NULL || ARG_AVIOUTPUTFILE != NULL || + ARG_INPUTTYPE == 1 || ARG_MKVOUTPUTFILE != NULL) /* TODO: PGM input */ #endif /* Spawn just one encoder instance */ { enc_sequence_data_t enc_data; @@ -1046,8 +986,6 @@ ARG_NUM_APP_THREADS = 1; enc_data.outfilename = ARG_OUTPUTFILE; - enc_data.outavifilename = ARG_AVIOUTPUTFILE; - enc_data.outmkvfilename = ARG_MKVOUTPUTFILE; enc_data.statsfilename1 = ARG_PASS1; enc_data.start_num = ARG_STARTFRAMENR; enc_data.stop_num = ARG_MAXFRAMENR; @@ -1070,8 +1008,6 @@ enc_sequence_data_t enc_data[MAX_ENC_INSTANCES]; char outfile[MAX_ENC_INSTANCES][256]; - char outavifile[MAX_ENC_INSTANCES][256]; - char outmkvfile[MAX_ENC_INSTANCES][256]; char statsfilename[MAX_ENC_INSTANCES][256]; for (k = 0; k < MAX_ENC_INSTANCES; k++) @@ -1086,34 +1022,13 @@ ARG_THREADS = -1; enc_data[0].outfilename = ARG_OUTPUTFILE; - enc_data[0].outavifilename = ARG_AVIOUTPUTFILE; - enc_data[0].outmkvfilename = ARG_MKVOUTPUTFILE; enc_data[0].statsfilename1 = ARG_PASS1; enc_data[0].start_num = ARG_STARTFRAMENR; enc_data[0].stop_num = (ARG_MAXFRAMENR-ARG_STARTFRAMENR)/ARG_NUM_APP_THREADS; for (k = 1; k < ARG_NUM_APP_THREADS; k++) { - if (ARG_OUTPUTFILE) { - sprintf(outfile[k], "%s.%03d", ARG_OUTPUTFILE, k); - enc_data[k].outfilename = outfile[k]; - } - else - enc_data[k].outfilename = NULL; - - if (ARG_AVIOUTPUTFILE) { - sprintf(outavifile[k], "%.*s_%03d.avi", strlen(ARG_AVIOUTPUTFILE) - 4, ARG_AVIOUTPUTFILE, k); - enc_data[k].outavifilename = outavifile[k]; - } - else - enc_data[k].outavifilename = NULL; - - if (ARG_MKVOUTPUTFILE) { - sprintf(outmkvfile[k], "%.*s_%03d.mkv", strlen(ARG_MKVOUTPUTFILE) - 4, ARG_MKVOUTPUTFILE, k); - enc_data[k].outmkvfilename = outmkvfile[k]; - } - else - enc_data[k].outmkvfilename = NULL; - + sprintf(outfile[k], "%s.%03d", ARG_OUTPUTFILE, k); + enc_data[k].outfilename = outfile[k]; if (ARG_PASS1) { sprintf(statsfilename[k], "%s.%03d", ARG_PASS1, k); enc_data[k].statsfilename1 = statsfilename[k]; @@ -1148,7 +1063,7 @@ totalenctime = MAX(totalenctime, enc_data[k].totalenctime); for (i=0; i < 3; i++) totalPSNR[i] += enc_data[k].totalPSNR[i]; - for (i=0; i < 7; i++) { + for (i=0; i < 8; i++) { int l; framestats[i].count += enc_data[k].framestats[i].count; framestats[i].size += enc_data[k].framestats[i].size; @@ -1258,8 +1173,6 @@ int start_num = h->start_num; int stop_num = h->stop_num; char *outfilename = h->outfilename; - char *outavifilename = h->outavifilename; - char *outmkvfilename = h->outmkvfilename; float *totalPSNR = h->totalPSNR; int input_num; @@ -1274,6 +1187,7 @@ int result; int output_num; + int nvop_counter; int m4v_size; int key; int stats_type; @@ -1296,6 +1210,7 @@ PAVIFILE avi_in = NULL; PAVISTREAM avi_in_stream = NULL; PGETFRAME get_frame = NULL; + BITMAPINFOHEADER myBitmapInfoHeader; #else #define get_frame NULL #endif @@ -1306,7 +1221,6 @@ AVISTREAMINFO myAVIStreamInfo; #endif #if defined(XVID_AVI_INPUT) || defined(XVID_AVI_OUTPUT) - BITMAPINFOHEADER myBitmapInfoHeader; if (ARG_NUM_APP_THREADS > 1) CoInitializeEx(0, COINIT_MULTITHREADED); AVIFileInit(); @@ -1354,20 +1268,20 @@ if (avi_info.fccHandler != MAKEFOURCC('Y', 'V', '1', '2')) { LONG size; fprintf(stderr, "Non YV12 input colorspace %c%c%c%c! Attempting conversion...\n", - (char)avi_info.fccHandler%256, (char)(avi_info.fccHandler>>8)%256, (char)(avi_info.fccHandler>>16)%256, - (char)(avi_info.fccHandler>>24)%256); + avi_info.fccHandler%256, (avi_info.fccHandler>>8)%256, (avi_info.fccHandler>>16)%256, + (avi_info.fccHandler>>24)%256); size = sizeof(myBitmapInfoHeader); AVIStreamReadFormat(avi_in_stream, 0, &myBitmapInfoHeader, &size); if (size==0) fprintf(stderr, "AVIStreamReadFormat read 0 bytes.\n"); else { - fprintf(stderr, "AVIStreamReadFormat read %d bytes.\n", (int)size); - fprintf(stderr, "width = %d, height = %d, planes = %d\n", (int)myBitmapInfoHeader.biWidth, - (int)myBitmapInfoHeader.biHeight, myBitmapInfoHeader.biPlanes); + fprintf(stderr, "AVIStreamReadFormat read %d bytes.\n", size); + fprintf(stderr, "width = %d, height = %d, planes = %d\n", myBitmapInfoHeader.biWidth, + myBitmapInfoHeader.biHeight, myBitmapInfoHeader.biPlanes); fprintf(stderr, "Compression = %c%c%c%c, %d\n", - (char)myBitmapInfoHeader.biCompression%256, (char)(myBitmapInfoHeader.biCompression>>8)%256, - (char)(myBitmapInfoHeader.biCompression>>16)%256, (char)(myBitmapInfoHeader.biCompression>>24)%256, - (int)myBitmapInfoHeader.biCompression); + myBitmapInfoHeader.biCompression%256, (myBitmapInfoHeader.biCompression>>8)%256, + (myBitmapInfoHeader.biCompression>>16)%256, (myBitmapInfoHeader.biCompression>>24)%256, + myBitmapInfoHeader.biCompression); fprintf(stderr, "Bits Per Pixel = %d\n", myBitmapInfoHeader.biBitCount); myBitmapInfoHeader.biCompression = MAKEFOURCC('Y', 'V', '1', '2'); myBitmapInfoHeader.biBitCount = 12; @@ -1476,13 +1390,13 @@ } #ifdef XVID_AVI_OUTPUT - if (outavifilename != NULL ) { + if (ARG_AVIOUTPUTFILE != NULL ) { { /* Open the .avi output then close it */ /* Resets the file size to 0, which AVIFile doesn't seem to do */ FILE *scrub; - if ((scrub = fopen(outavifilename, "w+b")) == NULL) { - fprintf(stderr, "Error opening output file %s\n", outavifilename); + if ((scrub = fopen(ARG_AVIOUTPUTFILE, "w+b")) == NULL) { + fprintf(stderr, "Error opening output file %s\n", ARG_AVIOUTPUTFILE); goto release_all; } else @@ -1493,16 +1407,16 @@ myAVIStreamInfo.fccHandler = MAKEFOURCC('x', 'v', 'i', 'd'); myAVIStreamInfo.dwScale = ARG_DWSCALE; myAVIStreamInfo.dwRate = ARG_DWRATE; - myAVIStreamInfo.dwLength = (h->stop_num - h->start_num); + myAVIStreamInfo.dwLength = ARG_MAXFRAMENR; myAVIStreamInfo.dwQuality = 10000; SetRect(&myAVIStreamInfo.rcFrame, 0, 0, XDIM, YDIM); - if ((avierr=AVIFileOpen(&myAVIFile, outavifilename, OF_CREATE|OF_WRITE, NULL))) { - fprintf(stderr, "AVIFileOpen failed opening output file %s, error code %d\n", outavifilename, avierr); + if (avierr=AVIFileOpen(&myAVIFile, ARG_AVIOUTPUTFILE, OF_CREATE|OF_WRITE, NULL)) { + fprintf(stderr, "AVIFileOpen failed opening output file %s, error code %d\n", ARG_AVIOUTPUTFILE, avierr); goto release_all; } - if ((avierr=AVIFileCreateStream(myAVIFile, &myAVIStream, &myAVIStreamInfo))) { + if (avierr=AVIFileCreateStream(myAVIFile, &myAVIStream, &myAVIStreamInfo)) { fprintf(stderr, "AVIFileCreateStream failed, error code %d\n", avierr); goto release_all; } @@ -1515,27 +1429,27 @@ myBitmapInfoHeader.biCompression = MAKEFOURCC('X', 'V', 'I', 'D'); myBitmapInfoHeader.biBitCount = 12; myBitmapInfoHeader.biSizeImage = 6*XDIM*YDIM; - if ((avierr=AVIStreamSetFormat(myAVIStream, 0, &myBitmapInfoHeader, sizeof(BITMAPINFOHEADER)))) { + if (avierr=AVIStreamSetFormat(myAVIStream, 0, &myBitmapInfoHeader, sizeof(BITMAPINFOHEADER))) { fprintf(stderr, "AVIStreamSetFormat failed, error code %d\n", avierr); goto release_all; } } #endif #ifdef XVID_MKV_OUTPUT - if (outmkvfilename != NULL) { + if (ARG_MKVOUTPUTFILE != NULL) { { /* Open the .mkv output then close it */ /* Just to make sure we can write to it */ FILE *scrub; - if ((scrub = fopen(outmkvfilename, "w+b")) == NULL) { - fprintf(stderr, "Error opening output file %s\n", outmkvfilename); + if ((scrub = fopen(ARG_MKVOUTPUTFILE, "w+b")) == NULL) { + fprintf(stderr, "Error opening output file %s\n", ARG_MKVOUTPUTFILE); goto release_all; } else fclose(scrub); } - MKVFileOpen(&myMKVFile, outmkvfilename, OF_CREATE|OF_WRITE, NULL); + MKVFileOpen(&myMKVFile, ARG_MKVOUTPUTFILE, OF_CREATE|OF_WRITE, NULL); if (ARG_PAR) { myMKVStreamInfo.display_height = YDIM*height_ratios[ARG_PAR]; myMKVStreamInfo.display_width = XDIM*width_ratios[ARG_PAR]; @@ -1548,7 +1462,7 @@ myMKVStreamInfo.width = XDIM; myMKVStreamInfo.framerate = ARG_DWRATE; myMKVStreamInfo.framescale = ARG_DWSCALE; - myMKVStreamInfo.length = (h->stop_num - h->start_num); + myMKVStreamInfo.length = ARG_MAXFRAMENR; MKVFileCreateStream(myMKVFile, &myMKVStream, &myMKVStreamInfo); } #endif @@ -1568,6 +1482,8 @@ input_num = 0; /* input frame counter */ output_num = start_num; /* output frame counter */ + nvop_counter = 0; + do { char *type; @@ -1588,7 +1504,7 @@ else in_buffer += ((DWORD*)in_buffer)[0]; } else { - if (AVIStreamRead(avi_in_stream, input_num + start_num, 1, in_buffer, 4 * XDIM*YDIM, NULL, NULL) != AVIERR_OK) + if(AVIStreamRead(avi_in_stream, input_num+start_num, 1, in_buffer, 4*XDIM*YDIM, NULL, NULL ) != AVIERR_OK) result = 1; } } else @@ -1714,7 +1630,7 @@ } } else - sprintf(timecode, "%f", ((double)ARG_DWSCALE/ARG_DWRATE)*1000*(output_num-start_num)); + sprintf(timecode, "%f", ((double)ARG_DWSCALE/ARG_DWRATE)*1000*output_num); /* Save single files */ if (ARG_SAVEINDIVIDUAL) { @@ -1725,11 +1641,11 @@ fclose(out); } #ifdef XVID_AVI_OUTPUT - if (outavifilename && myAVIStream) { + if (ARG_AVIOUTPUTFILE && myAVIStream) { int output_frame; if (time_file == NULL) - output_frame = (output_num-start_num); + output_frame = output_num; else { output_frame = (int)(atof(timecode)/1000/((double)ARG_DWSCALE/ARG_DWRATE)+.5); } @@ -1748,7 +1664,7 @@ fwrite(mp4_buffer, 1, m4v_size, out_file); } #ifdef XVID_MKV_OUTPUT - if (outmkvfilename && myMKVStream) { + if (ARG_MKVOUTPUTFILE && myMKVStream) { MKVStreamWrite(myMKVStream, atof(timecode), 1, (ARG_PACKED && fakenvop && (m4v_size <= 8)) ? NULL : mp4_buffer, m4v_size, key ? AVIIF_KEYFRAME : 0, NULL, NULL); } #endif @@ -1809,12 +1725,9 @@ #endif free_all_memory: - if (out_buffer) - free(out_buffer); - if (mp4_buffer) - free(mp4_buffer); - if ((in_buffer) && (get_frame == NULL)) - free(in_buffer); + free(out_buffer); + free(mp4_buffer); + free(in_buffer); } /***************************************************************************** @@ -1899,151 +1812,107 @@ fprintf(stderr, "xvid_encraw built at %s on %s\n", __TIME__, __DATE__); fprintf(stderr, "Usage : xvid_encraw [OPTIONS]\n\n"); fprintf(stderr, "Input options:\n"); - fprintf(stderr, " -i string : input filename (stdin)\n"); + fprintf(stderr, " -i string : input filename (stdin)\n"); #ifdef XVID_AVI_INPUT - fprintf(stderr, " -type integer : input data type (yuv=0, pgm=1, avi/avs=2) ("); + fprintf(stderr, " -type integer: input data type (yuv=0, pgm=1, avi/avs=2)\n"); #else - fprintf(stderr, " -type integer : input data type (yuv=0, pgm=1) ("); + fprintf(stderr, " -type integer: input data type (yuv=0, pgm=1)\n"); #endif - fprintf(stderr, "%d)\n", ARG_INPUTTYPE); - fprintf(stderr, " -w integer : frame width ([1.%d])\n", MAX_XDIM); - fprintf(stderr, " -h integer : frame height ([1.%d])\n", MAX_YDIM); - fprintf(stderr, " -csp string : colorspace of raw input file i420%s, yv12%s\n", (ARG_COLORSPACE == XVID_CSP_I420)?" (default)":"", (ARG_COLORSPACE == XVID_CSP_YV12)?" (default)":""); - fprintf(stderr, " -frames integer : number of frames to encode ("); - if (ARG_MAXFRAMENR==-1) - fprintf(stderr, "all)"); - else - fprintf(stderr, "%d)", ARG_MAXFRAMENR); - fprintf(stderr, "\n\n"); + fprintf(stderr, " -w integer: frame width ([1.2048])\n"); + fprintf(stderr, " -h integer: frame height ([1.2048])\n"); + fprintf(stderr, " -csp string : colorspace of raw input file i420, yv12 (default)\n"); + fprintf(stderr, " -frames integer: number of frames to encode\n"); + fprintf(stderr, "\n"); fprintf(stderr, "Output options:\n"); - fprintf(stderr, " -dump : save decoder output\n"); - fprintf(stderr, " -save : save an Elementary Stream file per frame\n"); - fprintf(stderr, " -o string : save an Elementary Stream for the complete sequence\n"); + fprintf(stderr, " -dump : save decoder output\n"); + fprintf(stderr, " -save : save an Elementary Stream file per frame\n"); + fprintf(stderr, " -o string : save an Elementary Stream for the complete sequence\n"); #ifdef XVID_AVI_OUTPUT - fprintf(stderr, " -avi string : save an AVI file for the complete sequence\n"); -#endif -#ifdef XVID_MKV_OUTPUT - fprintf(stderr, " -mkv string : save a MKV file for the complete sequence\n"); + fprintf(stderr, " -avi string: save an AVI file for the complete sequence\n"); #endif + fprintf(stderr, " -mkv string: save a MKV file for the complete sequence\n"); fprintf(stderr, "\n"); - fprintf(stderr, "Rate control options:\n"); - fprintf(stderr, " -framerate float : target framerate (auto)\n"); - fprintf(stderr, " -bitrate [integer] : target bitrate in kbps (%d)\n", DEFAULT_BITRATE/1000); - fprintf(stderr, " -size integer : target size in kilobytes\n"); - fprintf(stderr, " -single : single pass mode%s\n", (ARG_SINGLE)?" (default)":""); - fprintf(stderr, " -cq float : single pass constant quantizer\n"); - fprintf(stderr, " -pass1 [filename] : twopass mode (first pass)\n"); - fprintf(stderr, " -full1pass : perform full quality first pass (disabled)\n"); - fprintf(stderr, " -pass2 [filename] : twopass mode (2nd pass)\n"); - fprintf(stderr, " -max_key_interval integer : maximum keyframe interval (%d)\n", ARG_MAXKEYINTERVAL); - fprintf(stderr, " -zones [zones] : use `-help zones' for usage guidelines\n"); - fprintf(stderr, " -zq starting_frame float : bitrate zone; quant\n"); - fprintf(stderr, " -zw starting_frame float : bitrate zone; weight\n"); + fprintf(stderr, "BFrames options:\n"); + fprintf(stderr, " -max_bframes integer: max bframes (2)\n"); + fprintf(stderr, " -bquant_ratio integer: bframe quantizer ratio (150)\n"); + fprintf(stderr, " -bquant_offset integer: bframe quantizer offset (100)\n"); fprintf(stderr, "\n"); + fprintf(stderr, "Rate control options:\n"); + fprintf(stderr, " -framerate float : target framerate (auto)\n"); + fprintf(stderr, " -bitrate [integer] : target bitrate in kbps (700)\n"); + fprintf(stderr, " -size integer : target size in kilobytes\n"); + fprintf(stderr, " -single : single pass mode (default)\n"); + fprintf(stderr, " -cq float : single pass constant quantizer\n"); + fprintf(stderr, " -pass1 [filename] : twopass mode (first pass)\n"); + fprintf(stderr, " -full1pass : perform full first pass\n"); + fprintf(stderr, " -pass2 [filename] : twopass mode (2nd pass)\n"); + fprintf(stderr, " -zq starting_frame float : bitrate zone; quant\n"); + fprintf(stderr, " -zw starting_frame float : bitrate zone; weight\n"); + fprintf(stderr, " -max_key_interval integer : maximum keyframe interval (300)\n"); + fprintf(stderr, "\n"); fprintf(stderr, "Single Pass options:\n"); - fprintf(stderr, " -reaction integer : reaction delay factor (%d)\n", ARG_REACTION); - fprintf(stderr, " -averaging integer : averaging period (%d)\n", ARG_AVERAGING); - fprintf(stderr, " -smoother integer : smoothing buffer (%d)\n", ARG_SMOOTHER); + fprintf(stderr, "-reaction integer : reaction delay factor (16)\n"); + fprintf(stderr, "-averaging integer : averaging period (100)\n"); + fprintf(stderr, "-smoother integer : smoothing buffer (100)\n"); fprintf(stderr, "\n"); fprintf(stderr, "Second Pass options:\n"); - fprintf(stderr, " -kboost integer : I frame boost (%d)\n", ARG_KBOOST); - fprintf(stderr, " -kthresh integer : I frame reduction threshold (%d)\n", ARG_KTHRESH); - fprintf(stderr, " -kreduction integer : I frame reduction amount (%d)\n", ARG_KREDUCTION); - fprintf(stderr, " -ostrength integer : overflow control strength (%d)\n", ARG_OVERSTRENGTH); - fprintf(stderr, " -oimprove integer : max overflow improvement (%d)\n", ARG_OVERIMPROVE); - fprintf(stderr, " -odegrade integer : max overflow degradation (%d)\n", ARG_OVERDEGRADE); - fprintf(stderr, " -chigh integer : high bitrate scenes degradation (%d)\n", ARG_CHIGH); - fprintf(stderr, " -clow integer : low bitrate scenes improvement (%d)\n", ARG_CLOW); - fprintf(stderr, " -overhead integer : container frame overhead (%d)\n", ARG_OVERHEAD); - fprintf(stderr, " -vbvsize integer : use vbv buffer size\n"); - fprintf(stderr, " -vbvmax integer : vbv max bitrate\n"); - fprintf(stderr, " -vbvpeak integer : vbv peak bitrate over 1 second\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "BFrames options:\n"); - fprintf(stderr, " -max_bframes integer : max bframes (%d)\n", ARG_MAXBFRAMES); - fprintf(stderr, " -bquant_ratio integer : bframe quantizer ratio (%d)\n", ARG_BQRATIO); - fprintf(stderr, " -bquant_offset integer : bframe quantizer offset (%d)\n", ARG_BQOFFSET); + fprintf(stderr, "-kboost integer : I frame boost (10)\n"); + fprintf(stderr, "-kthresh integer : I frame reduction threshold (1)\n"); + fprintf(stderr, "-kreduction integer : I frame reduction amount (20)\n"); + fprintf(stderr, "-ostrength integer : overflow control strength (5)\n"); + fprintf(stderr, "-oimprove integer : max overflow improvement (5)\n"); + fprintf(stderr, "-odegrade integer : max overflow degradation (5)\n"); + fprintf(stderr, "-chigh integer : high bitrate scenes degradation (0)\n"); + fprintf(stderr, "-clow integer : low bitrate scenes improvement (0)\n"); + fprintf(stderr, "-overhead integer : container frame overhead (0)\n"); + fprintf(stderr, "-vbvsize integer : use vbv buffer size\n"); + fprintf(stderr, "-vbvmax integer : vbv max bitrate\n"); + fprintf(stderr, "-vbvpeak integer : vbv peak bitrate over 1 second\n"); fprintf(stderr, "\n"); fprintf(stderr, "Other options\n"); - if (ARG_USE_ASSEMBLER) - fprintf(stderr, " -noasm : do not use assembly optimized code (use)\n"); - else - fprintf(stderr, " -asm : use assembly optimized code (don't use)\n"); - if (ARG_TURBO) - fprintf(stderr, " -noturbo : do not use turbo presets for higher encoding speed (use)\n"); - else - fprintf(stderr, " -turbo : use turbo presets for higher encoding speed (don't use)\n"); - fprintf(stderr, " -quality integer : quality ([0..%d]) (%d)\n", ME_ELEMENTS - 1, ARG_QUALITY); - fprintf(stderr, " -vhqmode integer : level of R-D optimizations ([0..4]) (%d)\n", ARG_VHQMODE); - if (ARG_BVHQ) - fprintf(stderr, " -nobvhq : do not use R-D optimizations for B-frames (use)\n"); - else - fprintf(stderr, " -bvhq : use R-D optimizations for B-frames (don't use)\n"); - fprintf(stderr, " -metric integer : distortion metric for R-D opt (PSNR:0, PSNRHVSM:1) (%d)\n", ARG_QMETRIC); - if (ARG_QPEL) - fprintf(stderr, " -noqpel : do not use quarter pixel ME (use)\n"); - else - fprintf(stderr, " -qpel : use quarter pixel ME (don't use)\n"); - if (ARG_GMC) - fprintf(stderr, " -nogmc : do not use global motion compensation (use)\n"); - else - fprintf(stderr, " -gmc : use global motion compensation (don't use)\n"); - fprintf(stderr, " -qtype integer : quantization type (H263:0, MPEG4:1) (%d)\n", ARG_QTYPE); - fprintf(stderr, " -qmatrix filename : use custom MPEG4 quantization matrix\n"); - fprintf(stderr, " -interlaced [integer] : interlaced encoding (BFF:1, TFF:2) (%d)\n", DEFAULT_INTERLACING); - if (ARG_PACKED) - fprintf(stderr, " -nopacked : disable packed B-frames mode (enabled)\n"); - else - fprintf(stderr, " -packed : enable packed B-frames mode (disabled)\n"); - if (ARG_CLOSED_GOP) - fprintf(stderr, " -noclosed_gop : disable closed GOP mode (enabled)\n"); - else - fprintf(stderr, " -closed_gop : enable closed GOP mode (disabled)\n"); - fprintf(stderr, " -masking [integer] : HVS masking mode (None:0, Lumi:1, Variance:2) (%d)\n", ARG_LUMIMASKING); - if (ARG_STATS) - fprintf(stderr, " -nostats : do not print stats about encoded frames (print)\n"); - else - fprintf(stderr, " -stats : print stats about encoded frames (don't print)\n"); - fprintf(stderr, " -ssim [integer] : print ssim for every frame (accurate: 0 fast: 4) (%d)\n", DEFAULT_SSIM); - fprintf(stderr, " -ssim_file filename : output the ssim stats into a file\n"); - if (ARG_PSNRHVSM) - fprintf(stderr, " -nopsnrhvsm : do not print PSNRHVSM metric for every frame (print)\n"); - else - fprintf(stderr, " -psnrhvsm : print PSNRHVSM metric for every frame (don't print)\n"); - fprintf(stderr, " -debug integer : activate xvidcore internal debugging output (don't activate)\n"); - if (ARG_VOPDEBUG) - fprintf(stderr, " -novop_debug : do not print debug info directly into encoded frames (print)\n"); - else - fprintf(stderr, " -vop_debug : print some info directly into encoded frames (don't print)\n"); - if (ARG_CHROMAME) - fprintf(stderr, " -nochromame : disable chroma motion estimation (enabled)\n"); - else - fprintf(stderr, " -chromame : enable chroma motion estimation (disabled)\n"); - if (ARG_TRELLIS) - fprintf(stderr, " -notrellis : disable trellis quantization (enabled)\n"); - else - fprintf(stderr, " -trellis : enable trellis quantization (disabled)\n"); - fprintf(stderr, " -imin integer : minimum I Quantizer (1..31) (%d)\n", ARG_QUANTS[0]); - fprintf(stderr, " -imax integer : maximum I quantizer (1..31) (%d)\n", ARG_QUANTS[1]); - fprintf(stderr, " -bmin integer : minimum B Quantizer (1..31) (%d)\n", ARG_QUANTS[4]); - fprintf(stderr, " -bmax integer : maximum B quantizer (1..31) (%d)\n", ARG_QUANTS[5]); - fprintf(stderr, " -pmin integer : minimum P Quantizer (1..31) (%d)\n", ARG_QUANTS[2]); - fprintf(stderr, " -pmax integer : maximum P quantizer (1..31) (%d)\n", ARG_QUANTS[3]); - fprintf(stderr, " -drop integer : frame Drop Ratio (0..100) (%d)\n", ARG_FRAMEDROP); - fprintf(stderr, " -start integer : starting frame number (%d)\n", ARG_STARTFRAMENR); - fprintf(stderr, " -threads integer : number of threads (auto)\n"); - fprintf(stderr, " -slices integer : number of slices (%d)\n", ARG_SLICES); - fprintf(stderr, " -progress [integer] : show progress updates every n frames (%d)\n", DEFAULT_PROGRESS); - fprintf(stderr, " -par integer[:integer] : set Pixel Aspect Ratio (%d)\n", ARG_PAR); - fprintf(stderr, " 1 = 1:1\n"); - fprintf(stderr, " 2 = 12:11 (4:3 PAL)\n"); - fprintf(stderr, " 3 = 10:11 (4:3 NTSC)\n"); - fprintf(stderr, " 4 = 16:11 (16:9 PAL)\n"); - fprintf(stderr, " 5 = 40:33 (16:9 NTSC)\n"); - fprintf(stderr, " other = custom (width:height)\n"); - fprintf(stderr, " -help : print this help message\n"); + fprintf(stderr, " -noasm : do not use assembly optmized code\n"); + fprintf(stderr, " -turbo : use turbo presets for higher encoding speed\n"); + fprintf(stderr, " -quality integer : quality ([0..%d]) (6)\n", ME_ELEMENTS - 1); + fprintf(stderr, " -vhqmode integer : level of R-D optimizations ([0..4]) (1)\n"); + fprintf(stderr, " -bvhq : use R-D optimizations for B-frames\n"); + fprintf(stderr, " -metric integer : distortion metric for R-D opt (PSNR:0, PSNRHVSM: 1)\n"); + fprintf(stderr, " -qpel : use quarter pixel ME\n"); + fprintf(stderr, " -gmc : use global motion compensation\n"); + fprintf(stderr, " -qtype integer : quantization type (H263:0, MPEG4:1) (0)\n"); + fprintf(stderr, " -qmatrix filename : use custom MPEG4 quantization matrix\n"); + fprintf(stderr, " -interlaced [integer] : interlaced encoding (BFF:1, TFF:2) (1)\n"); + fprintf(stderr, " -nopacked : Disable packed mode\n"); + fprintf(stderr, " -noclosed_gop : Disable closed GOP mode\n"); + fprintf(stderr, " -masking [integer] : HVS masking mode (None:0, Lumi:1, Variance:2) (0)\n"); + fprintf(stderr, " -stats : print stats about encoded frames\n"); + fprintf(stderr, " -ssim [integer] : prints ssim for every frame (accurate: 0 fast: 4) (2)\n"); + fprintf(stderr, " -ssim_file filename : outputs the ssim stats into a file\n"); + fprintf(stderr, " -psnrhvsm : prints PSNRHVSM metric for every frame\n"); + fprintf(stderr, " -debug : activates xvidcore internal debugging output\n"); + fprintf(stderr, " -vop_debug : print some info directly into encoded frames\n"); + fprintf(stderr, " -nochromame : Disable chroma motion estimation\n"); + fprintf(stderr, " -notrellis : Disable trellis quantization\n"); + fprintf(stderr, " -imin integer : Minimum I Quantizer (1..31) (2)\n"); + fprintf(stderr, " -imax integer : Maximum I quantizer (1..31) (31)\n"); + fprintf(stderr, " -bmin integer : Minimum B Quantizer (1..31) (2)\n"); + fprintf(stderr, " -bmax integer : Maximum B quantizer (1..31) (31)\n"); + fprintf(stderr, " -pmin integer : Minimum P Quantizer (1..31) (2)\n"); + fprintf(stderr, " -pmax integer : Maximum P quantizer (1..31) (31)\n"); + fprintf(stderr, " -drop integer : Frame Drop Ratio (0..100) (0)\n"); + fprintf(stderr, " -start integer : Starting frame number\n"); + fprintf(stderr, " -threads integer : Number of threads\n"); + fprintf(stderr, " -slices integer : Number of slices\n"); + fprintf(stderr, " -progress [integer] : Show progress updates every n frames (10)\n"); + fprintf(stderr, " -par integer[:integer] : Set Pixel Aspect Ratio.\n"); + fprintf(stderr, " 1 = 1:1\n"); + fprintf(stderr, " 2 = 12:11 (4:3 PAL)\n"); + fprintf(stderr, " 3 = 10:11 (4:3 NTSC)\n"); + fprintf(stderr, " 4 = 16:11 (16:9 PAL)\n"); + fprintf(stderr, " 5 = 40:33 (16:9 NTSC)\n"); + fprintf(stderr, " other = custom (width:height)\n"); + fprintf(stderr, " -help : prints this help message\n"); fprintf(stderr, "\n"); - fprintf(stderr, "NB: You can define up to %d zones via both the -zones and the -z[qw] options as needed.\n", MAX_ZONES); + fprintf(stderr, "NB: You can define %d zones repeating the -z[qw] option as needed.\n", MAX_ZONES); } /***************************************************************************** @@ -2067,7 +1936,6 @@ return (1); fscanf(handle, "%d %d %d", &xsize, &ysize, &depth); - fread(&dummy, 1, 1, handle); if ((xsize > 4096) || (ysize > 4096*3/2) || (depth != 255)) { fprintf(stderr, "%d %d %d\n", xsize, ysize, depth); return (2); @@ -2085,6 +1953,7 @@ unsigned char *image) { int i; + char dummy; unsigned char *y = image; unsigned char *u = image + XDIM * YDIM; @@ -2105,6 +1974,9 @@ v += XDIM / 2; } + /* I don't know why, but this seems needed */ + fread(&dummy, 1, 1, handle); + return (0); } #else @@ -2166,7 +2038,6 @@ /* sample plugin */ -#if 0 int rawenc_debug(void *handle, int opt, @@ -2206,7 +2077,7 @@ return XVID_ERR_FAIL; } -#endif + #define FRAMERATE_INCR 1001 diff -Nru xvidcore-1.3.5/src/decoder.c xvidcore-1.3.2/src/decoder.c --- xvidcore-1.3.5/src/decoder.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/decoder.c 2011-05-18 09:02:35.000000000 +0000 @@ -20,7 +20,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: decoder.c 2130 2016-01-08 17:40:12Z Isibaar $ + * $Id: decoder.c 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -1647,13 +1647,9 @@ if(stats) { stats->type = XVID_TYPE_VOL; stats->data.vol.general = 0; - stats->data.vop.general = 0; - if (dec->interlacing) { - stats->data.vol.general |= XVID_VOL_INTERLACING; - if (dec->top_field_first) { - stats->data.vop.general |= XVID_VOP_TOPFIELDFIRST; - } - } stats->data.vol.width = dec->width; + /*XXX: if (dec->interlacing) + stats->data.vol.general |= ++INTERLACING; */ + stats->data.vol.width = dec->width; stats->data.vol.height = dec->height; stats->data.vol.par = dec->aspect_ratio; stats->data.vol.par_width = dec->par_width; diff -Nru xvidcore-1.3.5/src/encoder.c xvidcore-1.3.2/src/encoder.c --- xvidcore-1.3.5/src/encoder.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/encoder.c 2011-05-18 09:02:35.000000000 +0000 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: encoder.c 2099 2014-11-25 23:17:01Z Isibaar $ + * $Id: encoder.c 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -452,7 +452,7 @@ #ifndef HAVE_PTHREAD int t = MAX(1, create->num_threads); #else - int t = MAX(1, MIN(create->num_threads, (int) (pEnc->mbParam.mb_height>>1))); /* at least two rows per thread */ + int t = MIN(create->num_threads, (int) (pEnc->mbParam.mb_height>>1)); /* at least two rows per thread */ #endif int threads_per_slice = MAX(1, (t / pEnc->num_slices)); int rows_per_thread = (pEnc->mbParam.mb_height + threads_per_slice - 1) / threads_per_slice; diff -Nru xvidcore-1.3.5/src/global.h xvidcore-1.3.2/src/global.h --- xvidcore-1.3.5/src/global.h 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/global.h 2011-05-18 09:02:35.000000000 +0000 @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: global.h 2057 2011-12-30 13:04:28Z Isibaar $ + * $Id: global.h 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -251,12 +251,8 @@ /* useful macros */ -#ifndef MIN #define MIN(X, Y) ((X)<(Y)?(X):(Y)) -#endif -#ifndef MAX #define MAX(X, Y) ((X)>(Y)?(X):(Y)) -#endif /* #define ABS(X) (((X)>0)?(X):-(X)) */ #define SIGN(X) (((X)>0)?1:-1) #define CLIP(X,AMIN,AMAX) (((X)<(AMIN)) ? (AMIN) : ((X)>(AMAX)) ? (AMAX) : (X)) diff -Nru xvidcore-1.3.5/src/image/x86_asm/colorspace_rgb_mmx.asm xvidcore-1.3.2/src/image/x86_asm/colorspace_rgb_mmx.asm --- xvidcore-1.3.5/src/image/x86_asm/colorspace_rgb_mmx.asm 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/image/x86_asm/colorspace_rgb_mmx.asm 2009-09-16 17:11:39.000000000 +0000 @@ -119,8 +119,8 @@ pxor mm4, mm4 pxor mm5, mm5 - movd mm0, [x_ptr] ; x_ptr[0...] - movd mm2, [x_ptr+x_stride] ; x_ptr[x_stride...] + movd mm0, [x_ptr] ; x_ptr[0...] + movd mm2, [x_ptr+x_stride] ; x_ptr[x_stride...] punpcklbw mm0, mm4 ; [ |b |g |r ] punpcklbw mm2, mm5 ; [ |b |g |r ] movq mm6, mm0 ; = [ |b4|g4|r4] @@ -136,15 +136,8 @@ pxor mm4, mm4 pxor mm5, mm5 -%if %1 == 3 ; BGR (24-bit) - movd mm1, [x_ptr+2] - movd mm3, [x_ptr+x_stride+2] - psrlq mm1, 8 ; src[%1...] - psrlq mm3, 8 ; src[x_stride+%1...] -%else - movd mm1, [x_ptr+%1] ; src[%1...] - movd mm3, [x_ptr+x_stride+%1] ; src[x_stride+%1...] -%endif + movd mm1, [x_ptr+%1] ; src[%1...] + movd mm3, [x_ptr+x_stride+%1] ; src[x_stride+%1...] punpcklbw mm1, mm4 ; [ |b |g |r ] punpcklbw mm3, mm5 ; [ |b |g |r ] paddw mm6, mm1 ; +[ |b4|g4|r4] @@ -244,15 +237,8 @@ pxor mm4, mm4 pxor mm5, mm5 -%if %1 == 3 ; BGR (24-bit) - movd mm1, [x_ptr+2] - movd mm3, [x_ptr+x_stride+2] - psrlq mm1, 8 ; src[%1...] - psrlq mm3, 8 ; src[x_stride+%1...] -%else movd mm1, [x_ptr+%1] ; src[%1...] movd mm3, [x_ptr+x_stride+%1] ; src[x_stride+%1...] -%endif punpcklbw mm1, mm4 ; [ |b |g |r ] punpcklbw mm3, mm5 ; [ |b |g |r ] paddw mm6, mm1 ; +[ |b4|g4|r4] diff -Nru xvidcore-1.3.5/src/motion/estimation_bvop.c xvidcore-1.3.2/src/motion/estimation_bvop.c --- xvidcore-1.3.5/src/motion/estimation_bvop.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/motion/estimation_bvop.c 2011-05-18 09:02:35.000000000 +0000 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: estimation_bvop.c 2050 2011-10-25 10:53:24Z Isibaar $ + * $Id: estimation_bvop.c 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -809,26 +809,6 @@ if (Data->iMinSAD[0] < *best_sad) *best_sad = Data->iMinSAD[0]; } -static void -SearchInterpolate_final_fast(const int x, const int y, - const uint32_t MotionFlags, - const MBParam * const pParam, - int32_t * const best_sad, - SearchData * const Data) -{ - /* qpel refinement */ - if (Data->qpel) { - Data->qpel_precision = 1; - get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, - x, y, 4, pParam->width, pParam->height, Data->iFcode, 2); - - Data->currentQMV[0].x = 2 * Data->currentMV[0].x; - Data->currentQMV[0].y = 2 * Data->currentMV[0].y; - Data->currentQMV[1].x = 2 * Data->currentMV[1].x; - Data->currentQMV[1].y = 2 * Data->currentMV[1].y; - } -} - static void ModeDecision_BVOP_SAD(const SearchData * const Data_d, const SearchData * const Data_b, @@ -1103,13 +1083,9 @@ &Data_i, Data_f.currentMV[0], Data_b.currentMV[0]); if (((Data_i.iMinSAD[0] < best_sad +(best_sad>>3)) && !(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE)) - || Data_i.iMinSAD[0] <= best_sad) { + || Data_i.iMinSAD[0] <= best_sad) SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i); - } - else { - SearchInterpolate_final_fast(i, j, frame->motion_flags, pParam, &best_sad, &Data_i); - } if (Data_d.iMinSAD[0] <= 2*best_sad) if ((!(frame->motion_flags&XVID_ME_SKIP_DELTASEARCH) && (best_sad > 750)) diff -Nru xvidcore-1.3.5/src/plugins/plugin_lumimasking.c xvidcore-1.3.2/src/plugins/plugin_lumimasking.c --- xvidcore-1.3.5/src/plugins/plugin_lumimasking.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/plugins/plugin_lumimasking.c 2011-05-18 09:02:35.000000000 +0000 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: plugin_lumimasking.c 2056 2011-11-09 14:12:10Z Isibaar $ + * $Id: plugin_lumimasking.c 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ diff -Nru xvidcore-1.3.5/src/portab.h xvidcore-1.3.2/src/portab.h --- xvidcore-1.3.5/src/portab.h 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/portab.h 2011-05-18 09:02:35.000000000 +0000 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: portab.h 2145 2016-10-18 22:01:13Z Isibaar $ + * $Id: portab.h 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -90,15 +90,8 @@ #elif defined(__amigaos4__) # include -# include - -static __inline void amiga_yield(void) -{ - /* SetTaskPri() on the currently running task triggers a reschedule */ - struct Task *me = IExec->FindTask(NULL); - IExec->SetTaskPri(me, me->tc_Node.ln_Pri); -} -# define sched_yield() amiga_yield() +# include +# define sched_yield() IDOS->Delay(1) #elif defined(SYS_BEOS) diff -Nru xvidcore-1.3.5/src/utils/mbtransquant.c xvidcore-1.3.2/src/utils/mbtransquant.c --- xvidcore-1.3.5/src/utils/mbtransquant.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/utils/mbtransquant.c 2011-05-18 09:02:35.000000000 +0000 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: mbtransquant.c 2053 2011-11-04 15:23:46Z Isibaar $ + * $Id: mbtransquant.c 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -782,7 +782,7 @@ u = ((u + iCSF_Round[index]) * iCSF_Coeff[index]) >> 16; - return Lambda*((((u*u)>>4) + 4*(dQ*dQ))/5); + return (((Lambda*u*u)>>4) + 4*Lambda*dQ*dQ) / 5; } /* this routine has been strippen of all debug code */ diff -Nru xvidcore-1.3.5/src/xvid.c xvidcore-1.3.2/src/xvid.c --- xvidcore-1.3.5/src/xvid.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/xvid.c 2011-05-23 07:47:37.000000000 +0000 @@ -3,8 +3,8 @@ * XVID MPEG-4 VIDEO CODEC * - Native API implementation - * - * Copyright(C) 2001-2014 Peter Ross - * 2002-2014 Michael Militzer + * Copyright(C) 2001-2011 Peter Ross + * 2002-2011 Michael Militzer * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid.c 2130 2016-01-08 17:40:12Z Isibaar $ + * $Id: xvid.c 2011 2011-05-23 07:47:37Z Isibaar $ * ****************************************************************************/ @@ -367,7 +367,7 @@ /* Quantization related functions */ quant_h263_intra = quant_h263_intra_mmx; - quant_h263_inter = quant_h263_inter_mmx; + quant_h263_inter = quant_h263_inter_mmx; dequant_h263_intra = dequant_h263_intra_mmx; dequant_h263_inter = dequant_h263_inter_mmx; quant_mpeg_intra = quant_mpeg_intra_mmx; @@ -699,7 +699,7 @@ return XVID_ERR_VERSION; info->actual_version = XVID_VERSION; - info->build = "xvid-1.3.5"; + info->build = "xvid-1.3.2"; info->cpu_flags = detect_cpu_flags(); info->num_threads = 0; /* single-thread */ diff -Nru xvidcore-1.3.5/src/xvid.h xvidcore-1.3.2/src/xvid.h --- xvidcore-1.3.5/src/xvid.h 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/src/xvid.h 2011-05-18 09:02:35.000000000 +0000 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - Xvid Main header file - * - * Copyright(C) 2001-2014 Peter Ross + * Copyright(C) 2001-2011 Peter Ross * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid.h 2130 2016-01-08 17:40:12Z Isibaar $ + * $Id: xvid.h 1985 2011-05-18 09:02:35Z Isibaar $ * ****************************************************************************/ @@ -57,7 +57,7 @@ #define XVID_API_MAJOR(a) (((a)>>16) & 0xff) #define XVID_API_MINOR(a) (((a)>> 0) & 0xff) -#define XVID_VERSION XVID_MAKE_VERSION(1,3,5) +#define XVID_VERSION XVID_MAKE_VERSION(1,3,2) #define XVID_API XVID_MAKE_API(4, 3) /* Bitstream Version @@ -71,7 +71,7 @@ * doesnt hurt but not increasing it could cause difficulty for decoders in the * future */ -#define XVID_BS_VERSION 67 +#define XVID_BS_VERSION 64 /***************************************************************************** * error codes diff -Nru xvidcore-1.3.5/vfw/src/codec.c xvidcore-1.3.2/vfw/src/codec.c --- xvidcore-1.3.5/vfw/src/codec.c 2017-12-11 20:26:37.000000000 +0000 +++ xvidcore-1.3.2/vfw/src/codec.c 2011-05-18 09:02:35.000000000 +0000 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: codec.c 2160 2017-07-12 08:23:51Z Isibaar $ + * $Id: codec.c 1985 2011-05-18 09:02:35Z Isibaar $ * *************************************************************************/ @@ -560,11 +560,10 @@ create.num_plugins++; } - if (codec->config.debug > 0) { - plugins[create.num_plugins].func = vfw_debug; - plugins[create.num_plugins].param = NULL; - create.num_plugins++; - } + plugins[create.num_plugins].func = vfw_debug; + plugins[create.num_plugins].param = NULL; + create.num_plugins++; + create.profile = profiles[codec->config.profile].id; create.width = lpbiInput->bmiHeader.biWidth; @@ -934,7 +933,7 @@ if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX && inhdr->biCompression != FOURCC_DX50 && inhdr->biCompression != FOURCC_MP4V && inhdr->biCompression != FOURCC_xvid && inhdr->biCompression != FOURCC_divx && inhdr->biCompression != FOURCC_dx50 && inhdr->biCompression != FOURCC_mp4v && - inhdr->biCompression != FOURCC_YV12 && (in_csp = get_colorspace(inhdr)) != XVID_CSP_YV12) + (in_csp = get_colorspace(inhdr)) != XVID_CSP_YV12) { return ICERR_BADFORMAT; }