diff -Nru ffmpeg-0.5.2/Changelog ffmpeg-0.5+svn20090706/Changelog --- ffmpeg-0.5.2/Changelog 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/Changelog 2009-06-07 15:14:56.000000000 -0500 @@ -2,29 +2,14 @@ releases are sorted from youngest to oldest. -version 0.5.2: - -- Hurd support -- PowerPC without Altivec compilation issues -- validate channels and samplerate in the Vorbis decoder - - - version 0.5.1: - build system updates - documentation updates -- libswscale now is LGPL except for x86 optimizations - fix for GPL code in libswscale that was erroneously activated - AltiVec code in libswscale is now LGPL - remaining GPL parts in AC-3 decoder converted to LGPL -- (L)GPL license upgrade support - AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries -- enable symbol versioning by default for linkers that support it -- backport av_lockmgr_register(), see doc/APIchanges for details -- security fixes for: - - ASF, Ogg and MOV demuxers - - FFv1, H.264, HuffYUV, MLP, MPEG audio and Snow decoders diff -Nru ffmpeg-0.5.2/common.mak ffmpeg-0.5+svn20090706/common.mak --- ffmpeg-0.5.2/common.mak 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/common.mak 2009-01-26 03:24:52.000000000 -0600 @@ -9,7 +9,6 @@ vpath %.h $(SRC_DIR) vpath %.S $(SRC_DIR) vpath %.asm $(SRC_DIR) -vpath %.v $(SRC_DIR) ifeq ($(SRC_DIR),$(SRC_PATH_BARE)) BUILD_ROOT_REL = . @@ -44,9 +43,6 @@ %$(EXESUF): %.c -%.ver: %.v - sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@ - SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES)) $(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES) @@ -81,7 +77,7 @@ DEPS := $(OBJS:.o=.d) depend dep: $(DEPS) -CLEANSUFFIXES = *.o *~ *.ho *.ver +CLEANSUFFIXES = *.o *~ *.ho LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map DISTCLEANSUFFIXES = *.d *.pc diff -Nru ffmpeg-0.5.2/configure ffmpeg-0.5+svn20090706/configure --- ffmpeg-0.5.2/configure 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/configure 2009-07-05 15:35:02.000000000 -0500 @@ -82,7 +82,7 @@ echo " --disable-ffplay disable ffplay build" echo " --disable-ffserver disable ffserver build" echo " --enable-postproc enable GPLed postprocessing support [no]" - echo " --enable-swscale enable software scaler support [no]" + echo " --enable-swscale enable GPLed software scaler support [no]" echo " --enable-avfilter video filter support (replaces vhook) [no]" echo " --enable-avfilter-lavf video filters dependent on avformat [no]" echo " --disable-vhook disable video hooking support" @@ -103,7 +103,6 @@ echo " --disable-golomb disable Golomb code" echo " --disable-mdct disable MDCT code" echo " --disable-rdft disable RDFT code" - echo " --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)" echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation" echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers" echo " --enable-beos-netserver enable BeOS netserver" @@ -567,16 +566,11 @@ EOF } -test_ldflags(){ - log test_ldflags "$@" - check_ld "$@" <= 65" || die "ERROR: libx264 version must be >= 0.65."; } enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore @@ -2173,10 +2160,6 @@ check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' check_ldflags -Wl,-Bsymbolic -echo "X{};" > $TMPV -test_ldflags -Wl,--version-script,$TMPV && - append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' - if enabled small; then check_cflags -Os # not all compilers support -Os optimizations="small" @@ -2222,7 +2205,7 @@ # LIBOBJFLAGS may have already been set in the OS configuration if test -z "$LIBOBJFLAGS" ; then case "${subarch-$arch}" in - x86_64|ia64|alpha|sparc*|ppc|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;; + x86_64|ia64|alpha|sparc*|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;; esac fi fi @@ -2275,7 +2258,6 @@ echo "version string suffix $extra_version" fi echo "big-endian ${bigendian-no}" -echo "runtime cpu detection ${runtime_cpudetect-no}" if enabled x86; then echo "yasm ${yasm-no}" echo "MMX enabled ${mmx-no}" diff -Nru ffmpeg-0.5.2/debian/changelog ffmpeg-0.5+svn20090706/debian/changelog --- ffmpeg-0.5.2/debian/changelog 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/changelog 2010-08-17 20:15:30.000000000 -0500 @@ -1,135 +1,89 @@ -ffmpeg (4:0.5.2-1) lenny; urgency=low +ffmpeg (4:0.5+svn20090706-2ubuntu2.2) lenny; urgency=low - [ Andres Mejia ] - * Fix dependency problem for ffmpeg so it can use extra ffmpeg libs. - - [ Reinhard Tartler ] - * move presets back to 'ffmpeg' package. Closes: #581748 - - [ Fabian Greffrath ] - * Imported Upstream version 0.5.2 - * Remove ffmpeg-debian_hurd.patch, applied upstream. - * Remove fix-ftbfs-altivec.patch, applied upstream. - - -- Reinhard Tartler Tue, 25 May 2010 23:01:08 +0200 - -ffmpeg (4:0.5.1-3) unstable; urgency=low - - * fix ftbfs on powerpc - - -- Reinhard Tartler Fri, 12 Mar 2010 21:43:55 +0100 - -ffmpeg (4:0.5.1-2) unstable; urgency=low - - * reintroduce gnu/hurd patch - * Fix compilation on powerpc with --disable-altivec - - -- Reinhard Tartler Wed, 10 Mar 2010 21:19:40 +0100 - -ffmpeg (4:0.5.1-1) unstable; urgency=low - - * new upstream release: - - clarifies documentation on metadata, Closes: #570050, LP: #501729 - - further security backports, Closes: #570713 - * adapt to new versioning scheme - * use '<<' instead of '<' relationship for internal shlib file - * merge changes from ubuntu packaging - * drop wmapro backport again as discussed with upstream. The unrelated - changes seem too risky for a stable release. - - -- Reinhard Tartler Wed, 03 Mar 2010 22:28:24 +0100 - -ffmpeg (4:0.5+svn20090706-6) unstable; urgency=low - - [ Fabian Greffrath ] - * debian/patches/901-fix-misc-typos.patch: New patch taken from - upstream GIT (slightly modified) to fix some spelling errors. - * Document our calling of debhelper programs in an odd order in - debian/rules. - - [ Reinhard Tartler ] - * document some unattributed patches - * enable cpu autodetection in libswscale, Closes: #567725, LP: #386397 - - [ Christopher Martin ] - * backport wmapro codec from ffmpeg trunk - - -- Reinhard Tartler Sun, 31 Jan 2010 16:53:47 +0100 - -ffmpeg (4:0.5+svn20090706-5) unstable; urgency=medium - - * Upload to unstable - * Urgency medium because of fixed RC bugs (security issues) + * debian/patches/CVE-2009-46XX/security-issue22.patch: removed this + patch as it was causing a regression. (LP: #567913) - -- Reinhard Tartler Fri, 22 Jan 2010 16:04:39 +0000 + -- Marc Deslauriers Fri, 23 Apr 2010 08:11:04 -0400 -ffmpeg (4:0.5+svn20090706-4) experimental; urgency=low +ffmpeg (4:0.5+svn20090706-2ubuntu2.1) karmic-security; urgency=low - [ Loïc Minier ] - * Use default toolchain setup on ARM flavors for noopt and only add FPU - CFLAGS in the VFP and NEON flavors; this is ok since internally, cpu will - be set to "generic" but -march=generic or -mcpu=generic will NOT be added - to the build flags. - * Build all armel flavours with -marm since ffmpeg has a lot of hand crafted - assembly which doesn't build in the new lucid default mode (Thumb 2); - LP: #488267 - * Build all armel flavours with -fPIC -DPIC instead of just the neon flavour - as the new flags/toolchain require this in Ubuntu lucid. - * Build some assembly test code -- just like configure -- to decide whether - the *default* toolchain uses vfp or neon to decided whether to build the - vfp and neon flavors. - * Drop --disable/--enable opt flags such as --disable-neon or - --enable-armvfp on ARM since the upstream configure script will do the - right thing when the proper flags are set. - - [ Reinhard Tartler ] - * build with PIC on powerpc (Closes: #561956) - - -- Reinhard Tartler Fri, 15 Jan 2010 21:46:49 +0100 - -ffmpeg (4:0.5+svn20090706-3) experimental; urgency=low - - [ Loïc Minier ] - * Disable more autodetecter ARM arch features - * Enable neon flavour - * Update NEON confflags to assume v7 and VFP - * Add backported NEON patches from ffmpeg trunk - * Pass proper --cpu and --extra-flags on armel - * Pass -fPIC -DPIC to neon pass - - [ Fabian Greffrath ] - * Initialize the FLAVORS variable to static instead of appending to - it. Also, we do not support the internalencoders variable anymore. - - [ Andres Mejia ] - * Remove unused patches from packaging. - * Update Vcs-* entries to new location. - * Bump Standards-Version to 3.8.3. - - [ Reinhard Tartler ] - * change shlibs file to make applications depend on the -extra- packages - * loosen dependencies further, so that the -dev packages remain - installable even if ffmpeg-extra is 'out-of-date' - * add patch for issue1245: Make arguments of av_set_pts_info() unsigned. + * SECURITY UPDATE: Fix a multitude of security issues + - debian/patches/CVE-2009-46XX/security-issue03.patch: check stream + existence before assignment + - debian/patches/CVE-2009-46XX/security-issue04.patch: check submap + indexes + - debian/patches/CVE-2009-46XX/security-issue05.patch: check classbook + value + - debian/patches/CVE-2009-46XX/security-issue06.patch: add checks for + per-packet mode indexes and per-header mode mapping indexes + - debian/patches/CVE-2009-46XX/security-issue07.patch: check masterbook + index and subclass book index. + - debian/patches/CVE-2009-46XX/security-issue08.patch: check + res_setup->books + - debian/patches/CVE-2009-46XX/security-issue09.patch: check + begin/end/partition_size + - debian/patches/CVE-2009-46XX/security-issue10.patch: check validity + of channels & samplerate + - debian/patches/CVE-2009-46XX/security-issue11.patch: fix book_idx + check + - debian/patches/CVE-2009-46XX/security-issue12.patch: sanity checks + for magnitude and angle + - debian/patches/CVE-2009-46XX/security-issue13.patch: fix = -> == typo + - debian/patches/CVE-2009-46XX/security-issue14.patch: check dimensions + against 0 too + - debian/patches/CVE-2009-46XX/security-issue15.patch: fix + init_get_bits() buffer size + - debian/patches/CVE-2009-46XX/security-issue17.patch: make sure that + all memory allocations succeed + - debian/patches/CVE-2009-46XX/security-issue18.patch: fix possible + buffer over-read in vorbis_comment + - debian/patches/CVE-2009-46XX/security-issue19.patch: set data_size to + 0 to avoid having it uninitialized + - debian/patches/CVE-2009-46XX/security-issue20.patch: disable parsing + for ogg streams where no ogg header was found + - debian/patches/CVE-2009-46XX/security-issue22.patch: check codec_id + and codec_type, make sure priv_data is freed and codec is set to NULL + - CVE-2009-4632 + - CVE-2009-4633 + - CVE-2009-4634 + - CVE-2009-4635 + - CVE-2009-4637 + - CVE-2009-4639 + - CVE-2009-4640 + + -- Marc Deslauriers Thu, 08 Apr 2010 09:34:05 -0400 + +ffmpeg (4:0.5+svn20090706-2ubuntu2) karmic; urgency=low + + [ Reinhard Tartler ] + * Make arguments of av_set_pts_info() unsigned. + * update debian/changelog + * use patch for issue1245 from git.ffmpeg.org * Support constant-quant encoding for libtheora, LP: #356322 * increase swscale compile time width (VOF/VOFW), LP: #443264 - * Backports of various security patches, Closes: #550442, including: - - backport fixes for vorbis_dec - - backport oggparsevorbis fix - - backport vp3 fixes - - backport ffv1 fix - - libavcodec/mpegaudiodec.c backports - - h264 security backports - - backported libavformat/mov.c security fixes - - backported libavformat/oggdec.c security fixes - - backport svn r18016 aka 'MOV-Support-stz2-Compact-Sample-Size-Box' - to fix FTBFS - * enable symbol versioning - * bump shlibs version - * add README.source describing how this source package manages patches - * make sure the ${misc:Depends} substvar is used for each binary package - -- Reinhard Tartler Wed, 06 Jan 2010 16:27:40 +0100 + [ Loïc Minier ] + * Update config for karmic's armel toolchain. + * Enable neon flavour; LP: #383240. + * Update NEON confflags to assume v7 and VFP. + * Add backported NEON patches from ffmpeg trunk; see debian/patches/neon/. + * Pass proper --cpu and --extra-flags on armel. + * Pass -fPIC -DPIC to neon pass. + + -- Loïc Minier Tue, 13 Oct 2009 23:56:04 +0200 + +ffmpeg (4:0.5+svn20090706-2ubuntu1) karmic; urgency=low + + * merge from debian. Remaining changes: + - disabled output decoders: faad, openjpeg, dirac (all not in main) + - build arm vfp variant + - don't build depend on yasm. + * fix dependencies on -extra packages: LP: #418705, #416348 + * no need to remove mpeg encoders in the ubuntu package, unless we hear + otherwise from some patent owner. This brings back the mpeg2video + encoder is available. cf. formats.txt.gz LP: #416585 + + -- Reinhard Tartler Wed, 26 Aug 2009 11:20:03 +0200 ffmpeg (4:0.5+svn20090706-2) unstable; urgency=low @@ -146,6 +100,30 @@ -- Reinhard Tartler Wed, 26 Aug 2009 09:12:49 +0200 +ffmpeg (4:0.5+svn20090706-1ubuntu3) karmic; urgency=low + + * update the dependencies of the -dev packages for the + unstripped -> extra renaming + + -- Reinhard Tartler Tue, 25 Aug 2009 16:37:23 +0200 + +ffmpeg (4:0.5+svn20090706-1ubuntu2) karmic; urgency=low + + * really drop libopenjpeg from build depends. + + -- Reinhard Tartler Tue, 25 Aug 2009 08:17:17 +0200 + +ffmpeg (4:0.5+svn20090706-1ubuntu1) karmic; urgency=low + + * merge from debian. Remaining changes: + - don't build-depend on libfaad-dev, disabling faad decoder. + - build arm vfp variant + - don't build libopenjpeg support (not in main) + * change shlibs file to make applications depend on the -extra- packages. + * don't build depend on yasm. + + -- Reinhard Tartler Sat, 15 Aug 2009 18:18:23 +0200 + ffmpeg (4:0.5+svn20090706-1) unstable; urgency=low * preparing new upstream version, 0.5 release branch, rev 19352 @@ -206,6 +184,31 @@ -- Reinhard Tartler Thu, 13 Aug 2009 12:46:46 +0200 +ffmpeg-debian (4:0.5+svn20090609-1ubuntu3) karmic; urgency=low + + * do not forcefully enable objenjpeg, it is not avaiable in this build + anyway + * don't build against faac in any case, it is deemed non-free + + -- Reinhard Tartler Sat, 25 Jul 2009 09:15:12 +0200 + +ffmpeg-debian (4:0.5+svn20090609-1ubuntu2) karmic; urgency=low + + * remove libopenjpeg-dev from build depends (fixes FTBFS) + * remove duplicate libxvmc-dev build-dependency + + -- Reinhard Tartler Fri, 24 Jul 2009 21:53:47 +0200 + +ffmpeg-debian (4:0.5+svn20090609-1ubuntu1) karmic; urgency=low + + * merge from debian. Remaining changes: + - don't build-depend on libfaad-dev, disabling faad decoder. + - build arm vfp variant + * update gbp.conf + * move gbp.conf to debian/ + + -- Reinhard Tartler Sat, 18 Jul 2009 10:55:24 +0200 + ffmpeg-debian (4:0.5+svn20090609-1) unstable; urgency=low [ Andres Mejia ] @@ -320,6 +323,49 @@ -- Reinhard Tartler Sat, 02 May 2009 09:09:54 +0200 +ffmpeg-debian (3:0.svn20090303-1ubuntu6) jaunty; urgency=low + + * vfp CFLAGS: add "-mfpu=vfp -mfloat-abi=softfp". + + -- Loic Minier Fri, 10 Apr 2009 21:34:29 +0200 + +ffmpeg-debian (3:0.svn20090303-1ubuntu5) jaunty; urgency=low + + * Disable more autodetected ARM arch features. + * Add neon and vfp flavors to armel disabled for now. + * Enable vfp pass on armel; leave the neon disabled. + + -- Loïc Minier Fri, 10 Apr 2009 17:58:52 +0200 + +ffmpeg-debian (3:0.svn20090303-1ubuntu4) jaunty; urgency=low + + * brown paperbag upload. Actually include the patch intended for the + last upload. + + -- Reinhard Tartler Sat, 21 Mar 2009 14:55:46 +0100 + +ffmpeg-debian (3:0.svn20090303-1ubuntu3) jaunty; urgency=low + + * don't disable ffserver in specialised flavors. Fixes LP: #345370 + + -- Reinhard Tartler Sat, 21 Mar 2009 14:52:25 +0100 + +ffmpeg-debian (3:0.svn20090303-1ubuntu2) jaunty; urgency=low + + * No-change rebuild to fix lpia shared library dependencies. + + -- Colin Watson Thu, 19 Mar 2009 17:26:36 +0000 + +ffmpeg-debian (3:0.svn20090303-1ubuntu1) jaunty; urgency=low + + * FFE granted in LP: #340303. + + * merge from debian/unstable. + * remaining changes to debian: + - don't build-depend on libfaad-dev, disabling faad decoder. + + -- Reinhard Tartler Fri, 13 Mar 2009 08:54:33 +0100 + ffmpeg-debian (3:0.svn20090303-1) unstable; urgency=low * New Upstream Version (svn revision 17737 libswscale revision 28799) @@ -358,6 +404,13 @@ -- Reinhard Tartler Sun, 22 Feb 2009 09:32:49 +0100 +ffmpeg-debian (3:0.svn20090204-2ubuntu1) jaunty; urgency=low + + * merge from debian. Remaining changes: + - don't build depend on libfaad-dev + + -- Reinhard Tartler Thu, 05 Feb 2009 21:22:01 +0100 + ffmpeg-debian (3:0.svn20090204-2) experimental; urgency=low * add libxvmc-dev to build-depends in the 'ffmpeg' variant @@ -408,6 +461,13 @@ -- Reinhard Tartler Sun, 01 Feb 2009 19:54:27 +0100 +ffmpeg-debian (3:0.svn20090119-1ubuntu1) jaunty; urgency=low + + * merge from debian. LP: #318501 + * new version fixes CVE-2008-3230, LP: #253767 + + -- Reinhard Tartler Tue, 20 Jan 2009 09:20:53 +0100 + ffmpeg-debian (3:0.svn20090119-1) experimental; urgency=low * New Upstream Version (svn revision 16681 libswscale revision 28341) @@ -438,6 +498,16 @@ -- Reinhard Tartler Sun, 11 Jan 2009 20:55:48 +0100 +ffmpeg-debian (3:0.svn20081115-1ubuntu1) jaunty; urgency=low + + * merge from debian. + * keep myself in the maintainer field. If you are touching this or the + 'ffmpeg' package in multiverse, please get in touch with me. Both + source packages come from the same packaging branch. + * drop dependency on faad. + + -- Reinhard Tartler Sat, 15 Nov 2008 19:44:29 +0100 + ffmpeg-debian (3:0.svn20081115-1) experimental; urgency=low * new upstream svn snapshot (svn revision 15824, libswscale revision 27910) @@ -447,6 +517,31 @@ -- Reinhard Tartler Mon, 10 Nov 2008 21:37:16 +0100 +ffmpeg-debian (3:0.svn20081108-1ubuntu3) jaunty; urgency=low + + * really disable faad support completely. + + -- Reinhard Tartler Mon, 10 Nov 2008 10:58:01 +0100 + +ffmpeg-debian (3:0.svn20081108-1ubuntu2) jaunty; urgency=low + + * drop the patch to dlopen faad at runtime for now. it needs more + polishing, and we can have that functionality easier with the 'ffmpeg' + source package that will appear in multiverse. + + -- Reinhard Tartler Mon, 10 Nov 2008 10:31:47 +0100 + +ffmpeg-debian (3:0.svn20081108-1ubuntu1) jaunty; urgency=low + + * merge from debian. + * keep myself in the maintainer field. If you are touching this or the + 'ffmpeg' package in multiverse, please get in touch with me. Both + source packages come from the same packaging branch. + * drop dependency on faad. + * import patches from old packaging to dlopen libfaad at runtime. + + -- Reinhard Tartler Mon, 10 Nov 2008 07:31:16 +0100 + ffmpeg-debian (3:0.svn20081108-1) experimental; urgency=low * upstream svn snapshot (svn revision 15786, libswscale revision 27900). diff -Nru ffmpeg-0.5.2/debian/confflags ffmpeg-0.5+svn20090706/debian/confflags --- ffmpeg-0.5.2/debian/confflags 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/confflags 2010-08-17 20:14:38.000000000 -0500 @@ -1,8 +1,8 @@ # -*- mode: makefile -*- # vim:syntax=make - +# # build a static version on every architecture in the 'debian' ffmpeg package -FLAVORS := static +FLAVORS += static # shared is generic, i.e. without arch specific opcodes FLAVORS += shared @@ -13,55 +13,31 @@ SVNREVISION=$(shell cat .svnrevision 2>/dev/null || echo "UNKNOWN") -# this is only used for the check_asm macro -ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) - CC := gcc -else - CC := $(DEB_HOST_GNU_TYPE)-gcc -endif - -# this outputs 0 or 1 depending on whether a piece of assembly can be compiled -# with the *default* gcc flags; this is used to test the toolchain *default* -# configuration -check_asm = $(shell echo 'void foo(void) { __asm__ volatile("$(1)"); }' | $(CC) -x c -c - -o /dev/null 2>/dev/null && echo 1 || echo 0) - # the other flavors always build dynamic versions # Also, disable architecture-specific optimizations for default shared build -ifeq ($(DEB_HOST_ARCH),armel) - # whether the toolchain *default* configuration includes vfp and neon - vfp_asm := fadds s0, s0, s0 - has_vfp := $(call check_asm, $(vfp_asm)) - neon_asm := vadd.i16 q0, q0, q0 - has_neon := $(call check_asm, $(neon_asm)) - - # only build - ifneq ($(has_vfp),1) - FLAVORS += vfp - endif - ifneq ($(has_neon),1) - FLAVORS += neon - endif +ifeq ($(DEB_HOST_ARCH),armel) +# Ubuntu karmic and later assume v6 + VFP; just override CPU since it defaults +# to uname -m +nooptflags += --cpu=armv6 --extra-cflags="-mfpu=vfp -mfloat-abi=softfp" +#FLAVORS += vfp +FLAVORS += neon +else ifeq ($(DEB_HOST_ARCH),arm) +nooptflags += --disable-armv5te --disable-armv6 --disable-armv6t2 +nooptflags += --disable-armvfp --disable-neon else ifeq ($(DEB_HOST_ARCH),i386) - FLAVORS += cmov +FLAVORS += cmov else ifeq ($(DEB_HOST_ARCH),powerpc) - FLAVORS += altivec - nooptflags += --disable-altivec +FLAVORS += altivec +nooptflags += --disable-altivec else ifeq ($(DEB_HOST_ARCH),sparc) - FLAVORS += vis - nooptflags += --disable-vis +FLAVORS += vis +nooptflags += --disable-vis endif -$(info Building FLAVORS=$(FLAVORS)) - define cond_enable $(shell test -r $(1) && echo --enable-$(2) ) endef -# variant that also require --enable-version3 -define cond_enable_v3 - $(shell test -r $(1) && echo --enable-$(2) --enable-version3 ) -endef - # variant that also require --enable-nonfree define cond_enable_nf $(shell test -r $(1) && echo --enable-$(2) --enable-nonfree ) @@ -76,17 +52,10 @@ # there is no libfaad in ubuntu/main, on in ubuntu/multiverse gpl_confflags += $(call cond_enable,/usr/include/faad.h,libfaad) -# "forbidden" encoders, see README.Debian for details -disable_encoders += --disable-encoder=h263 -disable_encoders += --disable-encoder=h263p -disable_encoders += --disable-encoder=mpeg2video -disable_encoders += --disable-encoder=mpeg4 -disable_encoders += --disable-encoder=msmpeg4v1 -disable_encoders += --disable-encoder=msmpeg4v2 -disable_encoders += --disable-encoder=msmpeg4v3 - -# Comment out the following line to *not* disable the above encoders +# don't disable encoders if internalencoders is set in DEB_BUILD_OPTIONS +ifeq (,$(filter internalencoders,$(DEB_BUILD_OPTIONS))) confflags += $(disable_encoders) +endif # Common configuration flags confflags += --extra-version='$(DEB_VERSION)' @@ -95,9 +64,7 @@ confflags += --enable-avfilter-lavf confflags += --enable-vdpau confflags += --enable-bzlib -confflags += --enable-libdirac confflags += --enable-libgsm -confflags += --enable-libopenjpeg confflags += --enable-libschroedinger confflags += --enable-libspeex confflags += --enable-libtheora @@ -106,12 +73,6 @@ confflags += --enable-zlib confflags += --disable-stripping confflags += --disable-vhook -confflags += --enable-runtime-cpudetect -ifeq ($(DEB_HOST_ARCH),armel) -# this is required on Ubuntu lucid as it defaults to thumb2 and ffmpeg has -# plenty of incompatible assembly; not sure how to detect that properly -confflags += --extra-cflags="-marm -fPIC -DPIC" -endif confflags += $(extra_common_confflags) # this part below is intended for the 'ffmpeg' package in ubuntu/multiverse @@ -123,16 +84,11 @@ confflags += $(call cond_enable_nf,/usr/include/amrnb/sp_dec.h,libamr-nb) confflags += $(call cond_enable_nf,/usr/include/amrwb/dec.h,libamr-wb) -# Opencore-amr requires GPL v3 -v3_confflags += $(call cond_enable_v3,/usr/include/opencore-amrnb/interf_dec.h,libopencore-amrnb) -v3_confflags += $(call cond_enable_v3,/usr/include/opencore-amrwb/dec_if.h,libopencore-amrwb) - # AAC is considered non-free upstream confflags += $(call cond_enable_nf,/usr/include/faac.h,libfaac) # comment out following line for LGPL versions of the libraries confflags += $(gpl_confflags) -confflags += $(v3_confflags) # Enable IEEE 1394 (FireWire) support on Linux only ifneq (,$(findstring linux,$(DEB_HOST_GNU_TYPE))) @@ -140,6 +96,9 @@ lib1394-dev += libraw1394-dev, libdc1394-22-dev endif +# We add vdpau headers ourselves so ffmpeg can stay in main +confflags += --extra-cflags="-I$(CURDIR)/debian/include" + # XXX this probably needs fixing CFLAGS := @@ -166,6 +125,7 @@ # Configuration flags for the optimised shared libraries vfp_build_confflags += $(confflags) vfp_build_confflags += --shlibdir=/usr/lib/vfp +vfp_build_confflags += --enable-armvfp vfp_build_confflags += --enable-shared vfp_build_confflags += --disable-static vfp_build_confflags += --extra-cflags="-mfpu=vfp -mfloat-abi=softfp" @@ -174,6 +134,7 @@ # NB: NEON always implies v7+ and ffmpeg's NEON implementation requires VFP neon_build_confflags += $(confflags) neon_build_confflags += --shlibdir=/usr/lib/neon/vfp +neon_build_confflags += --cpu=armv7-a neon_build_confflags += --extra-cflags="-mfpu=neon -mfloat-abi=softfp -fPIC -DPIC" neon_build_confflags += --enable-shared neon_build_confflags += --disable-static @@ -198,6 +159,7 @@ altivec_build_confflags += --cpu='g4' altivec_build_confflags += --enable-shared altivec_build_confflags += --disable-static +altivec_build_confflags += --extra-cflags="-fPIC -DPIC" altivec_build_confflags += --enable-altivec altivec_build_confflags += --disable-ffmpeg altivec_build_confflags += --disable-ffplay diff -Nru ffmpeg-0.5.2/debian/control ffmpeg-0.5+svn20090706/debian/control --- ffmpeg-0.5.2/debian/control 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/control 2010-08-17 20:14:38.000000000 -0500 @@ -1,28 +1,26 @@ Source: ffmpeg Section: libs Priority: optional -Maintainer: Debian multimedia packages maintainers +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian multimedia packages maintainers Uploaders: Sam Hocevar (Debian packages) , Loic Minier , Reinhard Tartler , - Fabian Greffrath , + Fabian Greffrath , Andres Mejia DM-Upload-Allowed: yes -Standards-Version: 3.8.4 -Vcs-Git: git://git.debian.org/git/pkg-multimedia/ffmpeg.git -Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/ffmpeg.git;a=summary +Standards-Version: 3.8.2 +Vcs-Git: git://git.debian.org/git/pkg-multimedia/ffmpeg-debian.git +Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/ffmpeg-debian.git;a=summary Homepage: http://ffmpeg.org/ Build-Depends-Indep: doxygen Build-Depends: debhelper (>= 7), libasound2-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libbz2-dev, libdc1394-22-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], - libdirac-dev, - libfaad-dev | libfaad2-dev, libfreetype6-dev, libgsm1-dev, libimlib2-dev, - libopenjpeg-dev, libraw1394-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libschroedinger-dev, libsdl1.2-dev, @@ -31,17 +29,13 @@ libvorbis-dev, libx11-dev, libxext-dev, - libvdpau-dev, libxvmc-dev, quilt, texi2html, - yasm [i386 amd64], zlib1g-dev Package: ffmpeg Section: video -Replaces: libavcodec52 (<< 4:0.5.2-1), - libavcodec-extra-52 (<< 4:0.5.1-3) Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -61,8 +55,7 @@ libpostproc51 (= ${binary:Version}), libavformat52 (= ${binary:Version}), libswscale0 (= ${binary:Version}), - ffmpeg (= ${binary:Version}), - ${misc:Depends} + ffmpeg (= ${binary:Version}) Description: Debug symbols for ffmpeg related packages This package contains debug data of the ffmpeg related shared libraries. . @@ -91,7 +84,6 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Replaces: ffmpeg (<< 4:0.5.1-1) Description: ffmpeg codec library This is the codec library from the ffmpeg project. It supports most existing encoding formats (MPEG, DivX, MPEG4, AC3, DV...). @@ -155,8 +147,7 @@ Section: libdevel Architecture: any Depends: libavutil49 (>= ${binary:Version}) | libavutil-extra-49 (>= ${source:Upstream-Version}), - libavutil49 (<= ${source:Upstream-Version}-99) | libavutil-extra-49 (<= ${source:Upstream-Version}-99), - ${misc:Depends} + libavutil49 (<= ${source:Upstream-Version}-99) | libavutil-extra-49 (<= ${source:Upstream-Version}-99) Description: development files for libavutil This is the common utility library from the ffmpeg project. It is required by all other ffmpeg libraries. @@ -169,8 +160,7 @@ Architecture: any Depends: libavcodec52 (>= ${binary:Version}) | libavcodec-extra-52 (>= ${source:Upstream-Version}), libavcodec52 (<= ${source:Upstream-Version}-99) | libavcodec-extra-52 (<= ${source:Upstream-Version}-99), - libavutil-dev (= ${binary:Version}), - ${misc:Depends} + libavutil-dev (= ${binary:Version}) Suggests: libfaad-dev, libgsm1-dev, libogg-dev, @@ -194,8 +184,7 @@ Architecture: any Depends: libavdevice52 (>= ${binary:Version}) | libavdevice-extra-52 (>= ${source:Upstream-Version}), libavdevice52 (<= ${source:Upstream-Version}-99) | libavdevice-extra-52 (<= ${source:Upstream-Version}-99), - libavformat-dev (= ${binary:Version}), - ${misc:Depends} + libavformat-dev (= ${binary:Version}) Description: development files for libavdevice This is the device handling library from the ffmpeg project. . @@ -207,8 +196,7 @@ Architecture: any Depends: libavformat52 (>= ${binary:Version}) | libavformat-extra-52 (>= ${source:Upstream-Version}), libavformat52 (<= ${source:Upstream-Version}-99) | libavformat-extra-52 (<= ${source:Upstream-Version}-99), - libavcodec-dev (= ${binary:Version}), - ${misc:Depends} + libavcodec-dev (= ${binary:Version}) Description: development files for libavformat This is the demuxer library from the ffmpeg project. It supports most existing file formats (AVI, MPEG, OGG, Matroska, ASF...). @@ -221,8 +209,7 @@ Architecture: any Depends: libavfilter0 (>= ${binary:Version}) | libavfilter-extra-0 (>= ${source:Upstream-Version}), libavfilter0 (<= ${source:Upstream-Version}-99) | libavfilter-extra-0 (<= ${source:Upstream-Version}-99), - libavcodec-dev (= ${binary:Version}), - ${misc:Depends} + libavcodec-dev (= ${binary:Version}) Description: development files for libavfilter This is the video filtering library from the ffmpeg project. . @@ -234,8 +221,7 @@ Architecture: any Depends: libpostproc51 (>= ${binary:Version}) | libpostproc-extra-51 (>= ${source:Upstream-Version}), libpostproc51 (<= ${source:Upstream-Version}-99) | libpostproc-extra-51 (<= ${source:Upstream-Version}-99), - libavutil-dev (= ${binary:Version}), - ${misc:Depends} + libavutil-dev (= ${binary:Version}) Description: development files for libpostproc This is the video postprocessing library from the ffmpeg project. . @@ -247,8 +233,7 @@ Architecture: any Depends: libswscale0 (>= ${binary:Version}) | libswscale-extra-0 (>= ${source:Upstream-Version}), libswscale0 (<= ${source:Upstream-Version}-99) | libswscale-extra-0 (<= ${source:Upstream-Version}-99), - libavutil-dev (= ${binary:Version}), - ${misc:Depends} + libavutil-dev (= ${binary:Version}) Description: development files for libswscale This is the video scaling library from the ffmpeg project. . diff -Nru ffmpeg-0.5.2/debian/copyright ffmpeg-0.5+svn20090706/debian/copyright --- ffmpeg-0.5.2/debian/copyright 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/copyright 2010-08-17 20:14:38.000000000 -0500 @@ -1,5 +1,5 @@ SVN snapshots are downloaded with subversion from the ffmpeg SVN at: - + Upstream Authors: Fabrice Bellard Alex Beregszaszi @@ -94,3 +94,31 @@ License can be found in `/usr/share/common-licenses/GPL' and the text of the GNU Lesser General Public License is in `/usr/share/common-licenses/LGPL'. +The VDPAU headers found in `debian/include/vdpau' were downloaded from +. +For them the following copyright notice and license apply: + + * This copyright notice applies to this header file: + * + * Copyright (c) 2008 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. diff -Nru ffmpeg-0.5.2/debian/gbp.conf ffmpeg-0.5+svn20090706/debian/gbp.conf --- ffmpeg-0.5.2/debian/gbp.conf 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/gbp.conf 2010-08-17 20:14:38.000000000 -0500 @@ -1,6 +1,6 @@ [DEFAULT] -upstream-branch = upstream-0.5 -debian-branch = master +upstream-branch = upstream +debian-branch = ubuntu.karmic upstream-tag = upstream/%(version)s debian-tag = debian/%(version)s pristine-tar = True diff -Nru ffmpeg-0.5.2/debian/get-orig-source.sh ffmpeg-0.5+svn20090706/debian/get-orig-source.sh --- ffmpeg-0.5.2/debian/get-orig-source.sh 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/get-orig-source.sh 2010-08-17 20:14:38.000000000 -0500 @@ -1,7 +1,7 @@ #!/bin/sh # # Script to create a 'pristine' tarball for the debian ffmpeg source package -# Copyright (C) 2008, 2009, 2010 Reinhard Tartler +# Copyright (C) 2008, Reinhard Tartler # # 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 @@ -23,7 +23,7 @@ cat >&2 < q_full_surfaces; + * Queue q_empty_surfaces; + * + * thread_1() { + * for (;;) { + * VdpVideoSurface s = q_empty_surfaces.get(); + * // Parse compressed stream here + * VdpDecoderRender(s, ...); + * q_full_surfaces.put(s); + * } + * } + * + * // This would need to be more complex if + * // VdpVideoMixerRender were to be provided with more + * // than one field/frame at a time. + * thread_1() { + * for (;;) { + * // Possibly, other rendering operations to mixer + * // layer surfaces here. + * VdpOutputSurface t = ...; + * VdpPresentationQueueBlockUntilSurfaceIdle(t); + * VdpVideoSurface s = q_full_surfaces.get(); + * VdpVideoMixerRender(s, t, ...); + * q_empty_surfaces.put(s); + * // Possibly, other rendering operations to "t" here + * VdpPresentationQueueDisplay(t, ...); + * } + * } + * \endcode + * + * Finally, note that VDPAU makes no guarantees regarding any + * level of parallelism in any given implementation. Put another + * way, use of multi-threading is not guaranteed to yield any + * performance gain, and in theory could even slightly reduce + * performance due to threading/synchronization overhead. + * + * However, the intent of the threading requirements is to allow + * for e.g. video decoding and video mixer operations to proceed + * in parallel in hardware. Given a (presumably multi-threaded) + * application that kept each portion of the hardware busy, this + * would yield a performance increase. + * + * \section endianness Surface Endianness + * + * When dealing with surface content, i.e. the input/output of + * Put/GetBits functions, applications must take care to access + * memory in the correct fashion, so as to avoid endianness + * issues. + * + * By established convention in the 3D graphics world, RGBA data + * is defined to be an array of 32-bit pixels containing packed + * RGBA components, not as an array of bytes or interleaved RGBA + * components. VDPAU follows this convention. As such, + * applications are expected to access such surfaces as arrays + * of 32-bit components (i.e. using a 32-bit pointer), and not + * as interleaved arrays of 8-bit components (i.e. using an + * 8-bit pointer.) Deviation from this convention will lead to + * endianness issues, unless appropriate care is taken. + * + * The same convention is followed for some packed YCbCr formats + * such as \ref VDP_YCBCR_FORMAT_Y8U8V8A8; i.e. they are + * considered arrays of 32-bit pixels, and hence should be + * accessed as such. + * + * For YCbCr formats with chroma decimation and/or planar + * formats, however, this convention is awkward. Therefore, + * formats such as \ref VDP_YCBCR_FORMAT_NV12 are defined as + * arrays of (potentially interleaved) byte-sized components. + * Hence, applications should manipulate such data 8-bits at a + * time, using 8-bit pointers. + * + * Note that one common usage for the input/output of + * Put/GetBits APIs is file I/O. Typical file I/O APIs treat all + * memory as a simple array of 8-bit values. This violates the + * rule requiring surface data to be accessed in its true native + * format. As such, applications may be required to solve + * endianness issues. Possible solutions include: + * + * - Authoring static UI data files according to the endianness + * of the target execution platform. + * - Conditionally byte-swapping Put/GetBits data buffers at + * run-time based on execution platform. + * + * Note: Complete details regarding each surface format's + * precise pixel layout is included with the documentation of + * each surface type. For example, see \ref + * VDP_RGBA_FORMAT_B8G8R8A8. + * + * \section video_mixer_usage Video Mixer Usage + * + * \subsection video_surface_content VdpVideoSurface Content + * + * Each \ref VdpVideoSurface "VdpVideoSurface" is expected to contain an + * entire frame's-worth of data, irrespective of whether an interlaced of + * progressive sequence is being decoded. + * + * Depending on the exact encoding structure of the compressed video stream, + * the application may need to call \ref VdpDecoderRender twice to fill a + * single \ref VdpVideoSurface "VdpVideoSurface". When the stream contains an + * encoded progressive frame, or a "frame coded" interlaced field-pair, a + * single \ref VdpDecoderRender call will fill the entire surface. When the + * stream contains separately encoded interlaced fields, two + * \ref VdpDecoderRender calls will be required; one for the top field, and + * one for the bottom field. + * + * Implementation note: When \ref VdpDecoderRender renders an interlaced + * field, this operation must not disturb the content of the other field in + * the surface. + * + * \subsection vm_surf_list VdpVideoMixer Surface List + * + * An video stream is logically composed of a sequence of fields. An + * example is shown below, in display order, assuming top field first: + * + *
t0 b0 t1 b1 t2 b2 t3 b3 t4 b4 t5 b5 t6 b6 t7 b7 t8 b8 t9 b9
+ * + * The canonical usage is to call \ref VdpVideoMixerRender once for decoded + * field, in display order, to yield one post-processed frame for display. + * + * For each call to \ref VdpVideoMixerRender, the field to be processed should + * be provided as the \b video_surface_current parameter. + * + * To enable operation of advanced de-interlacing algorithms and/or + * post-processing algorithms, some past and/or future surfaces should be + * provided as context. These are provided in the \b video_surface_past and + * \b video_surface_future lists. In general, these lists may contain any + * number of surfaces. Specific implementations may have specific requirements + * determining the minimum required number of surfaces for optimal operation, + * and the maximum number of useful surfaces, beyond which surfaces are not + * used. It is recommended that in all cases other than plain bob/weave, at + * least 2 past and 1 future frame be provided. + * + * Note that it is entirely possible, in general, for any of the + * \ref VdpVideoMixer "VdpVideoMixer" post-processing steps other than + * de-interlacing to require access to multiple input fields/frames. For + * example, an motion-sensitive noise-reduction algorithm. + * + * For example, when processing field t4, the \ref VdpVideoMixerRender + * parameters may contain the following values, if the application chose to + * provide 3 fields of context for both the past and future: + * + *
+ * current_picture_structure: VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD
+ * past:    [b3, t3, b2]
+ * current: t4
+ * future:  [b4, t5, b5]
+ * 
+ * + * Note that for both the past/future lists, array index 0 represents the + * field temporally closest to current, in display order. + * + * The \ref VdpVideoMixerRender parameter \b current_picture_structure applies + * to \b video_surface_current. The picture structure for the other surfaces + * will be automatically derived from that for the current picture. The + * derivation algorithm is extremely simple; the concatenated list + * past/current/future is simply assumed to have an alternating top/bottom + * pattern throughout. + * + * Continuing the example above, subsequent calls to \ref VdpVideoMixerRender + * would provide the following sets of parameters: + * + *
+ * current_picture_structure: VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD
+ * past:    [t4, b3, t3]
+ * current: b4
+ * future:  [t5, b5, t6]
+ * 
+ * + * then: + * + *
+ * current_picture_structure: VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD
+ * past:    [b4, t4, b3]
+ * current: t5
+ * future:  [b5, t6, b7]
+ * 
+ * + * In other words, the concatenated list of past/current/future frames simply + * forms a window that slides through the sequence of decoded fields. + * + * It is syntactically legal for an application to choose not to provide a + * particular entry in the past or future lists. In this case, the "slot" in + * the surface list must be filled with the special value + * \ref VDP_INVALID_HANDLE, to explicitly indicate that the picture is + * missing; do not simply shuffle other surfaces together to fill in the gap. + * Note that entries should only be omitted under special circumstances, such + * as failed decode due to bitstream error during picture header parsing, + * since missing entries will typically cause advanced de-interlacing + * algorithms to experience significantly degraded operation. + * + * Specific examples for different de-interlacing types are presented below. + * + * \subsection deint_weave Weave De-interlacing + * + * Weave de-interlacing is the act of interleaving the lines of two temporally + * adjacent fields to form a frame for display. + * + * To disable de-interlacing for progressive streams, simply specify + * \b current_picture_structure as \ref VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME; + * no de-interlacing will be applied. + * + * Weave de-interlacing for interlaced streams is identical to disabling + * de-interlacing, as describe immediately above, because each + * \ref VdpVideoSurface already contains an entire frame's worth (i.e. two + * fields) of picture data. + * + * Inverse telecine is disabled when using weave de-interlacing. + * + * Weave de-interlacing produces one output frame for each input frame. The + * application should make one \ref VdpVideoMixerRender call per pair of + * decoded fields, or per decoded frame. + * + * Weave de-interlacing requires no entries in the past/future lists. + * + * All implementations must support weave de-interlacing. + * + * \subsection deint_bob Bob De-interlacing + * + * Bob de-interlacing is the act of vertically scaling a single field to the + * size of a single frame. + * + * To achieve bob de-interlacing, simply provide a single field as + * \b video_surface_current, and set \b current_picture_structure + * appropriately, to indicate whether a top or bottom field was provided. + * + * Inverse telecine is disabled when using bob de-interlacing. + * + * Bob de-interlacing produces one output frame for each input field. The + * application should make one \ref VdpVideoMixerRender call per decoded + * field. + * + * Bob de-interlacing requires no entries in the past/future lists. + * + * Bob de-interlacing is the default when no advanced method is requested and + * enabled. Advanced de-interlacing algorithms may fall back to bob e.g. when + * required past/future fields are missing. + * + * All implementations must support bob de-interlacing. + * + * \subsection deint_adv Advanced De-interlacing + * + * Operation of both temporal and temporal-spatial de-interlacing is + * identical; the only difference is the internal processing the algorithm + * performs in generating the output frame. + * + * These algorithms use various advanced processing on the pixels of both the + * current and various past/future fields in order to determine how best to + * de-interlacing individual portions of the image. + * + * Inverse telecine may be enabled when using advanced de-interlacing. + * + * Advanced de-interlacing produces one output frame for each input field. The + * application should make one \ref VdpVideoMixerRender call per decoded + * field. + * + * Advanced de-interlacing requires entries in the past/future lists. + * + * Availability of advanced de-interlacing algorithms is implementation + * dependent. + * + * \subsection deint_rate De-interlacing Rate + * + * For all de-interlacing algorithms except weave, a choice may be made to + * call \ref VdpVideoMixerRender for either each decoded field, or every + * second decoded field. + * + * If \ref VdpVideoMixerRender is called for every decoded field, the + * generated post-processed frame rate is equal to the decoded field rate. + * Put another way, the generated post-processed nominal field rate is equal + * to 2x the decoded field rate. This is standard practice. + * + * If \ref VdpVideoMixerRender is called for every second decoded field (say + * every top field), the generated post-processed frame rate is half to the + * decoded field rate. This mode of operation is thus referred to as + * "half-rate". + * + * Implementations may choose whether to support half-rate de-interlacing mode + * or not. Regular de-interlacing mode should be supported to any supported + * advanced de-interlacing algorithm. + * + * The descriptions of de-interlacing algorithms above assume that regular + * (not half-rate) operation is being performed, when detailing the number of + "half-rate" de-interlacing is used.deoMixerRender calls. + * + * Recall that the concatenation of past/current/future surface lists simply + * forms a window into the stream of decoded fields. To achieve standard + * de-interlacing, the window is slid through the list of decoded fields one + * field at a time, and a call is made to \ref VdpVideoMixerRender for each + * movement of the window. To achieve half-rate de-interlacing, the window is + * slid through the* list of decoded fields two fields at a time, and a + * call is made to \ref VdpVideoMixerRender for each movement of the window. + * + * \subsection invtc Inverse Telecine + * + * Assuming the implementation supports it, inverse telecine may be enabled + * alongside any advanced de-interlacing algorithm. Inverse telecine is never + * active for bob or weave. + * + * Operation of \ref VdpVideoMixerRender with inverse telecine active is + * identical to the basic operation mechanisms describe above in every way; + * all inverse telecine processing is performed internally to the + * \ref VdpVideoMixer "VdpVideoMixer". + * + * In particular, there is no provision way for \ref VdpVideoMixerRender to + * indicate when identical input fields have been observed, and consequently + * identical output frames may have been produced. + * + * De-interlacing (and inverse telecine) may be applied to streams that are + * marked as being progressive. This will allow detection of, and correct + * de-interlacing of, mixed interlace/progressive streams, bad edits, etc. + * To implement de-interlacing/inverse-telecine on progressive material, + * simply treat the stream of decoded frames as a stream of decoded fields, + * apply any telecine flags (see the next section), and then apply + * de-interlacing to those fields as described above. + * + * Implementations are free to determine whether inverse telecine operates + * in conjunction with half-rate de-interlacing or not. It should always + * operate with regular de-interlacing, when advertized. + * + * \subsection tcflags Telecine (Pull-Down) Flags + * + * Some media delivery formats, e.g. DVD-Video, include flags that are + * intended to modify the decoded field sequence before display. This allows + * e.g. 24p content to be encoded at 48i, which saves space relative to a 60i + * encoded stream, but still displayed at 60i, to match target consumer + * display equipment. + * + * If the inverse telecine option is not activated in the + * \ref VdpVideoMixer "VdpVideoMixer", these flags should be ignored, and the + * decoded fields passed directly to \ref VdpVideoMixerRender as detailed + * above. + * + * However, to make full use of the inverse telecine feature, these flags + * should be applied to the field stream, yielding another field stream with + * some repeated fields, before passing the field stream to + * \ref VdpVideoMixerRender. In this scenario, the sliding window mentioned + * in the descriptions above applies to the field stream after application of + * flags. + * + * \section extending Extending the API + * + * \subsection extend_enums Enumerations and Other Constants + * + * VDPAU defines a number of enumeration types. + * + * When modifying VDPAU, existing enumeration constants must + * continue to exist (although they may be deprecated), and do + * so in the existing order. + * + * The above discussion naturally applies to "manually" defined + * enumerations, using pre-processor macros, too. + * + * \subsection extend_structs Structures + * + * In most case, VDPAU includes no provision for modifying existing + * structure definitions, although they may be deprecated. + * + * New structures may be created, together with new API entry + * points or feature/attribute/parameter values, to expose new + * functionality. + * + * A few structures are considered plausible candidates for future extension. + * Such structures include a version number as the first field, indicating the + * exact layout of the client-provided data. Such structures may only be + * modified by adding new fields to the end of the structure, so that the + * original structure definition is completely compatible with a leading + * subset of fields of the extended structure. + * + * \subsection extend_functions Functions + * + * Existing functions may not be modified, although they may be + * deprecated. + * + * New functions may be added at will. Note the enumeration + * requirements when modifying the enumeration that defines the + * list of entry points. + * + * \section preemption_note Display Preemption + * + * Please note that the display may be preempted away from + * VDPAU at any time. See \ref display_preemption for more + * details. + * + * \subsection trademarks Trademarks + * + * VDPAU is a trademark of NVIDIA Corporation. You may freely use the + * VDPAU trademark, as long as trademark ownership is attributed to + * NVIDIA Corporation. + */ + +/** + * \file vdpau.h + * \brief The Core API + * + * This file contains the \ref api_core "Core API". + */ + +#ifndef _VDPAU_H +#define _VDPAU_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup api_core Core API + * + * The core API encompasses all VDPAU functionality that operates + * in the same fashion across all Window Systems. + * + * @{ + */ + +/** + * \defgroup base_types Basic Types + * + * VDPAU primarily uses ISO C99 types from \c stdint.h. + * + * @{ + */ + +/** \brief A true \ref VdpBool value */ +#define VDP_TRUE 1 +/** \brief A false \ref VdpBool value */ +#define VDP_FALSE 0 +/** + * \brief A boolean value, holding \ref VDP_TRUE or \ref + * VDP_FALSE. + */ +typedef int VdpBool; + +/*@}*/ + +/** + * \defgroup misc_types Miscellaneous Types + * + * @{ + */ + +/** + * \brief An invalid object handle value. + * + * This value may be used to represent an invalid, or + * non-existent, object (\ref VdpDevice "VdpDevice", + * \ref VdpVideoSurface "VdpVideoSurface", etc.) + * + * Note that most APIs require valid object handles in all + * cases, and will fail when presented with this value. + */ +#define VDP_INVALID_HANDLE 0xffffffffU + +/** + * \brief The set of all chroma formats for \ref VdpVideoSurface + * "VdpVideoSurface"s. + */ +typedef uint32_t VdpChromaType; + +/** \hideinitializer \brief 4:2:0 chroma format. */ +#define VDP_CHROMA_TYPE_420 (VdpChromaType)0 +/** \hideinitializer \brief 4:2:2 chroma format. */ +#define VDP_CHROMA_TYPE_422 (VdpChromaType)1 +/** \hideinitializer \brief 4:4:4 chroma format. */ +#define VDP_CHROMA_TYPE_444 (VdpChromaType)2 + +/** + * \brief The set of all known YCbCr surface formats. + */ +typedef uint32_t VdpYCbCrFormat; + +/** + * \hideinitializer + * \brief The "NV12" YCbCr surface format. + * + * This format has a two planes, a Y plane and a UV plane. + * + * The Y plane is an array of byte-sized Y components. + * Applications should access this data via a uint8_t pointer. + * + * The UV plane is an array of interleaved byte-sized U and V + * components, in the order U, V, U, V. Applications should + * access this data via a uint8_t pointer. + */ +#define VDP_YCBCR_FORMAT_NV12 (VdpYCbCrFormat)0 +/** + * \hideinitializer + * \brief The "YV12" YCbCr surface format. + * + * This format has a three planes, a Y plane, a U plane, and a V + * plane. + * + * Each of the planes is an array of byte-sized components. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_YCBCR_FORMAT_YV12 (VdpYCbCrFormat)1 +/** + * \hideinitializer + * \brief The "UYVY" YCbCr surface format. + * + * This format may also be known as Y422, UYNV, HDYC. + * + * This format has a single plane. + * + * This plane is an array of interleaved byte-sized Y, U, and V + * components, in the order U, Y, V, Y, U, Y, V, Y. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_YCBCR_FORMAT_UYVY (VdpYCbCrFormat)2 +/** + * \hideinitializer + * \brief The "YUYV" YCbCr surface format. + * + * This format may also be known as YUY2, YUNV, V422. + * + * This format has a single plane. + * + * This plane is an array of interleaved byte-sized Y, U, and V + * components, in the order Y, U, Y, V, Y, U, Y, V. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_YCBCR_FORMAT_YUYV (VdpYCbCrFormat)3 +/** + * \hideinitializer + * \brief A packed YCbCr format. + * + * This format has a single plane. + * + * This plane is an array packed 32-bit pixel data. Within each + * 32-bit pixel, bits [31:24] contain A, bits [23:16] contain V, + * bits [15:8] contain U, and bits [7:0] contain Y. + * + * Applications should access this data via a uint32_t pointer. + */ +#define VDP_YCBCR_FORMAT_Y8U8V8A8 (VdpYCbCrFormat)4 +/** + * \hideinitializer + * \brief A packed YCbCr format. + * + * This format has a single plane. + * + * This plane is an array packed 32-bit pixel data. Within each + * 32-bit pixel, bits [31:24] contain A, bits [23:16] contain Y, + * bits [15:8] contain U, and bits [7:0] contain V. + * + * Applications should access this data via a uint32_t pointer. + */ +#define VDP_YCBCR_FORMAT_V8U8Y8A8 (VdpYCbCrFormat)5 + +/** + * \brief The set of all known RGB surface formats. + */ +typedef uint32_t VdpRGBAFormat; + +/** + * \hideinitializer + * \brief A packed RGB format. + * + * This format has a single plane. + * + * This plane is an array packed 32-bit pixel data. Within each + * 32-bit pixel, bits [31:24] contain A, bits [23:16] contain R, + * bits [15:8] contain G, and bits [7:0] contain B. + * + * Applications should access this data via a uint32_t pointer. + */ +#define VDP_RGBA_FORMAT_B8G8R8A8 (VdpRGBAFormat)0 +/** + * \hideinitializer + * \brief A packed RGB format. + * + * This format has a single plane. + * + * This plane is an array packed 32-bit pixel data. Within each + * 32-bit pixel, bits [31:24] contain A, bits [23:16] contain B, + * bits [15:8] contain G, and bits [7:0] contain R. + * + * Applications should access this data via a uint32_t pointer. + */ +#define VDP_RGBA_FORMAT_R8G8B8A8 (VdpRGBAFormat)1 +/** + * \hideinitializer + * \brief A packed RGB format. + * + * This format has a single plane. + * + * This plane is an array packed 32-bit pixel data. Within each + * 32-bit pixel, bits [31:30] contain A, bits [29:20] contain B, + * bits [19:10] contain G, and bits [9:0] contain R. + * + * Applications should access this data via a uint32_t pointer. + */ +#define VDP_RGBA_FORMAT_R10G10B10A2 (VdpRGBAFormat)2 +/** + * \hideinitializer + * \brief A packed RGB format. + * + * This format has a single plane. + * + * This plane is an array packed 32-bit pixel data. Within each + * 32-bit pixel, bits [31:30] contain A, bits [29:20] contain R, + * bits [19:10] contain G, and bits [9:0] contain B. + * + * Applications should access this data via a uint32_t pointer. + */ +#define VDP_RGBA_FORMAT_B10G10R10A2 (VdpRGBAFormat)3 +/** + * \hideinitializer + * \brief An alpha-only surface format. + * + * This format has a single plane. + * + * This plane is an array of byte-sized components. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_RGBA_FORMAT_A8 (VdpRGBAFormat)4 + +/** + * \brief The set of all known indexed surface formats. + */ +typedef uint32_t VdpIndexedFormat; + +/** + * \hideinitializer + * \brief A 4-bit indexed format, with alpha. + * + * This format has a single plane. + * + * This plane is an array of byte-sized components. Within each + * byte, bits [7:4] contain I (index), and bits [3:0] contain A. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_INDEXED_FORMAT_A4I4 (VdpIndexedFormat)0 +/** + * \hideinitializer + * \brief A 4-bit indexed format, with alpha. + * + * This format has a single plane. + * + * This plane is an array of byte-sized components. Within each + * byte, bits [7:4] contain A, and bits [3:0] contain I (index). + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_INDEXED_FORMAT_I4A4 (VdpIndexedFormat)1 +/** + * \hideinitializer + * \brief A 8-bit indexed format, with alpha. + * + * This format has a single plane. + * + * This plane is an array of interleaved byte-sized A and I + * (index) components, in the order A, I, A, I. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_INDEXED_FORMAT_A8I8 (VdpIndexedFormat)2 +/** + * \hideinitializer + * \brief A 8-bit indexed format, with alpha. + * + * This format has a single plane. + * + * This plane is an array of interleaved byte-sized A and I + * (index) components, in the order I, A, I, A. + * + * Applications should access this data via a uint8_t pointer. + */ +#define VDP_INDEXED_FORMAT_I8A8 (VdpIndexedFormat)3 + +/** + * \brief A location within a surface. + * + * The VDPAU co-ordinate system has its origin at the top-left + * of a surface, with x and y components increasing right and + * down. + */ +typedef struct { + /** X co-ordinate. */ + uint32_t x; + /** Y co-ordinate. */ + uint32_t y; +} VdpPoint; + +/** + * \brief A rectangular region of a surface. + * + * The co-ordinates are top-left inclusive, bottom-right + * exclusive. + * + * The VDPAU co-ordinate system has its origin at the top-left + * of a surface, with x and y components increasing right and + * down. + */ +typedef struct { + /** Left X co-ordinate. Inclusive. */ + uint32_t x0; + /** Top Y co-ordinate. Inclusive. */ + uint32_t y0; + /** Right X co-ordinate. Exclusive. */ + uint32_t x1; + /** Bottom Y co-ordinate. Exclusive. */ + uint32_t y1; +} VdpRect; + +/** + * A constant RGBA color. + * + * Note that the components are stored as float values in the + * range 0.0...1.0 rather than format-specific integer values. + * This allows VdpColor values to be independent from the exact + * surface format(s) in use. + */ +typedef struct { + float red; + float green; + float blue; + float alpha; +} VdpColor; + +/*@}*/ + +/** + * \defgroup error_handling Error Handling + * + * @{ + */ + +/** + * \hideinitializer + * \brief The set of all possible error codes. + */ +typedef enum { + /** The operation completed successfully; no error. */ + VDP_STATUS_OK = 0, + /** + * No backend implementation could be loaded. + */ + VDP_STATUS_NO_IMPLEMENTATION, + /** + * The display was preempted, or a fatal error occurred. + * + * The application must re-initialize VDPAU. + */ + VDP_STATUS_DISPLAY_PREEMPTED, + /** + * An invalid handle value was provided. + * + * Either the handle does not exist at all, or refers to an object of an + * incorrect type. + */ + VDP_STATUS_INVALID_HANDLE, + /** + * An invalid pointer was provided. + * + * Typically, this means that a NULL pointer was provided for an "output" + * parameter. + */ + VDP_STATUS_INVALID_POINTER, + /** + * An invalid/unsupported \ref VdpChromaType value was supplied. + */ + VDP_STATUS_INVALID_CHROMA_TYPE, + /** + * An invalid/unsupported \ref VdpYCbCrFormat value was supplied. + */ + VDP_STATUS_INVALID_Y_CB_CR_FORMAT, + /** + * An invalid/unsupported \ref VdpRGBAFormat value was supplied. + */ + VDP_STATUS_INVALID_RGBA_FORMAT, + /** + * An invalid/unsupported \ref VdpIndexedFormat value was supplied. + */ + VDP_STATUS_INVALID_INDEXED_FORMAT, + /** + * An invalid/unsupported \ref VdpColorStandard value was supplied. + */ + VDP_STATUS_INVALID_COLOR_STANDARD, + /** + * An invalid/unsupported \ref VdpColorTableFormat value was supplied. + */ + VDP_STATUS_INVALID_COLOR_TABLE_FORMAT, + /** + * An invalid/unsupported \ref VdpOutputSurfaceRenderBlendFactor value was + * supplied. + */ + VDP_STATUS_INVALID_BLEND_FACTOR, + /** + * An invalid/unsupported \ref VdpOutputSurfaceRenderBlendEquation value + * was supplied. + */ + VDP_STATUS_INVALID_BLEND_EQUATION, + /** + * An invalid/unsupported flag value/combination was supplied. + */ + VDP_STATUS_INVALID_FLAG, + /** + * An invalid/unsupported \ref VdpDecoderProfile value was supplied. + */ + VDP_STATUS_INVALID_DECODER_PROFILE, + /** + * An invalid/unsupported \ref VdpVideoMixerFeature value was supplied. + */ + VDP_STATUS_INVALID_VIDEO_MIXER_FEATURE, + /** + * An invalid/unsupported \ref VdpVideoMixerParameter value was supplied. + */ + VDP_STATUS_INVALID_VIDEO_MIXER_PARAMETER, + /** + * An invalid/unsupported \ref VdpVideoMixerAttribute value was supplied. + */ + VDP_STATUS_INVALID_VIDEO_MIXER_ATTRIBUTE, + /** + * An invalid/unsupported \ref VdpVideoMixerPictureStructure value was + * supplied. + */ + VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE, + /** + * An invalid/unsupported \ref VdpFuncId value was supplied. + */ + VDP_STATUS_INVALID_FUNC_ID, + /** + * The size of a supplied object does not match the object it is being + * used with. + * + * For example, a \ref VdpVideoMixer "VdpVideoMixer" is configured to + * process \ref VdpVideoSurface "VdpVideoSurface" objects of a specific + * size. If presented with a \ref VdpVideoSurface "VdpVideoSurface" of a + * different size, this error will be raised. + */ + VDP_STATUS_INVALID_SIZE, + /** + * An invalid/unsupported value was supplied. + * + * This is a catch-all error code for values of type other than those + * with a specific error code. + */ + VDP_STATUS_INVALID_VALUE, + /** + * An invalid/unsupported structure version was specified in a versioned + * structure. This implies that the implementation is older than the + * header file the application was built against. + */ + VDP_STATUS_INVALID_STRUCT_VERSION, + /** + * The system does not have enough resources to complete the requested + * operation at this time. + */ + VDP_STATUS_RESOURCES, + /** + * The set of handles supplied are not all related to the same VdpDevice. + * + * When performing operations that operate on multiple surfaces, such as + * \ref VdpOutputSurfaceRenderOutputSurface or \ref VdpVideoMixerRender, + * all supplied surfaces must have been created within the context of the + * same \ref VdpDevice "VdpDevice" object. This error is raised if they were + * not. + */ + VDP_STATUS_HANDLE_DEVICE_MISMATCH, + /** + * A catch-all error, used when no other error code applies. + */ + VDP_STATUS_ERROR, +} VdpStatus; + +/** + * \brief Retrieve a string describing an error code. + * \param[in] status The error code. + * \return A pointer to the string. Note that this is a + * statically allocated read-only string. As such, the + * application must not free the returned pointer. The + * pointer is valid as long as the VDPAU implementation is + * present within the application's address space. + */ +typedef char const * VdpGetErrorString( + VdpStatus status +); + +/*@}*/ + +/** + * \defgroup versioning Versioning + * + * + * @{ + */ + +/** + * \brief The VDPAU version described by this header file. + * + * Note that VDPAU version numbers are simple integers that + * increase monotonically (typically by value 1) with each VDPAU + * header revision. + */ +#define VDPAU_VERSION 0 + +/** + * \brief Retrieve the VDPAU version implemented by the backend. + * \param[out] api_version The API version. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpGetApiVersion( + /* output parameters follow */ + uint32_t * api_version +); + +/** + * \brief Retrieve an implementation-specific string description + * of the implementation. This typically includes detailed version + * information. + * \param[out] information_string A pointer to the information + * string. Note that this is a statically allocated + * read-only string. As such, the application must not + * free the returned pointer. The pointer is valid as long + * as the implementation is present within the + * application's address space. + * \return VdpStatus The completion status of the operation. + * + * Note that the returned string is useful for information + * reporting. It is not intended that the application should + * parse this string in order to determine any information about + * the implementation. + */ +typedef VdpStatus VdpGetInformationString( + /* output parameters follow */ + char const * * information_string +); + +/*@}*/ + +/** + * \defgroup VdpDevice VdpDevice; Primary API object + * + * The VdpDevice is the root of the VDPAU object system. Using a + * VdpDevice object, all other object types may be created. See + * the sections describing those other object types for details + * on object creation. + * + * Note that VdpDevice objects are created using the \ref + * api_winsys. + * + * @{ + */ + +/** + * \brief An opaque handle representing a VdpDevice object. + */ +typedef uint32_t VdpDevice; + +/** + * \brief Destroy a VdpDevice. + * \param[in] device The device to destroy. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpDeviceDestroy( + VdpDevice device +); + +/*@}*/ + +/** + * \defgroup VdpCSCMatrix VdpCSCMatrix; CSC Matrix Manipulation + * + * When converting from YCbCr to RGB data formats, a color space + * conversion operation must be performed. This operation is + * parameterized using a "color space conversion matrix". The + * VdpCSCMatrix is a data structure representing this + * information. + * + * @{ + */ + +/** + * \brief Storage for a color space conversion matrix. + * + * Note that the application may choose to construct the matrix + * content by either: + * - Directly filling in the fields of the CSC matrix + * - Using the \ref VdpGenerateCSCMatrix helper function. + * + * The color space conversion equation is as follows: + * + * \f[ + * \left( \begin{array}{c} R \\ G \\ B \end{array} \right) + * = + * \left( \begin{array}{cccc} + * m_{0,0} & m_{0,1} & m_{0,2} & m_{0,3} \\ + * m_{1,0} & m_{1,1} & m_{1,2} & m_{1,3} \\ + * m_{2,0} & m_{2,1} & m_{2,2} & m_{2,3} + * \end{array} + * \right) + * * + * \left( \begin{array}{c} Y \\ Cb \\ Cr \\ 1.0 \end{array} + * \right) + * \f] + */ +typedef float VdpCSCMatrix[3][4]; + +#define VDP_PROCAMP_VERSION 0 + +/** + * \brief Procamp operation parameterization data. + * + * When performing a color space conversion operation, various + * adjustments can be performed at the same time, such as + * brightness and contrast. This structure defines the level of + * adjustments to make. + */ +typedef struct { + /** + * This field must be filled with VDP_PROCAMP_VERSION + */ + uint32_t struct_version; + /** + * Brightness adjustment amount. A value clamped between + * -1.0 and 1.0. 0.0 represents no modification. + */ + float brightness; + /** + * Contrast adjustment amount. A value clamped between + * 0.0 and 10.0. 1.0 represents no modification. + */ + float contrast; + /** + * Saturation adjustment amount. A value clamped between 0.0 and + * 10.0. 1.0 represents no modification. + */ + float saturation; + /** + * Hue adjustment amount. A value clamped between + * -PI and PI. 0.0 represents no modification. + */ + float hue; +} VdpProcamp; + +/** + * \brief YCbCr color space specification. + * + * A number of YCbCr color spaces exist. This enumeration + * defines the specifications known to VDPAU. + */ +typedef uint32_t VdpColorStandard; + +/** \hideinitializer \brief ITU-R BT.601 */ +#define VDP_COLOR_STANDARD_ITUR_BT_601 (VdpColorStandard)0 +/** \hideinitializer \brief ITU-R BT.709 */ +#define VDP_COLOR_STANDARD_ITUR_BT_709 (VdpColorStandard)1 +/** \hideinitializer \brief SMPTE-240M */ +#define VDP_COLOR_STANDARD_SMPTE_240M (VdpColorStandard)2 + +/** + * \brief Generate a color space conversion matrix + * \param[in] procamp The procamp adjustments to make. If NULL, + * no adjustments will be made. + * \param[in] standard The YCbCr color space to convert from. + * \param[out] csc_matrix The CSC matrix to initialize. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpGenerateCSCMatrix( + VdpProcamp * procamp, + VdpColorStandard standard, + /* output parameters follow */ + VdpCSCMatrix * csc_matrix +); + +/*@}*/ + +/** + * \defgroup VdpVideoSurface VdpVideoSurface; Video Surface object + * + * A VdpVideoSurface stores YCbCr data in an internal format, + * with a variety of possible chroma sub-sampling options. + * + * A VdpVideoSurface may be filled with: + * - Data provided by the CPU via \ref + * VdpVideoSurfacePutBitsYCbCr (i.e. software decode.) + * - The result of applying a \ref VdpDecoder "VdpDecoder" to + * compressed video data. + * + * VdpVideoSurface content may be accessed by: + * - The application via \ref VdpVideoSurfaceGetBitsYCbCr + * - The Hardware that implements \ref VdpOutputSurface + * "VdpOutputSurface" \ref VdpOutputSurfaceRender + * "rendering functionality". + * - The Hardware the implements \ref VdpVideoMixer + * "VdpVideoMixer" functionality. + * + * VdpVideoSurfaces are not directly displayable. They must be + * converted into a displayable format using \ref VdpVideoMixer + * "VdpVideoMixer" objects. + * + * See \ref video_mixer_usage for additional information. + * + * @{ + */ + +/** + * \brief Query the implementation's VdpVideoSurface + * capabilities. + * \param[in] device The device to query. + * \param[in] surface_chroma_type The type of chroma type for + * which information is requested. + * \param[out] is_supported Is this chroma type supported? + * \param[out] max_width The maximum supported surface width for + * this chroma type. + * \param[out] max_height The maximum supported surface height + * for this chroma type. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoSurfaceQueryCapabilities( + VdpDevice device, + VdpChromaType surface_chroma_type, + /* output parameters follow */ + VdpBool * is_supported, + uint32_t * max_width, + uint32_t * max_height +); + +/** + * \brief Query the implementation's VdpVideoSurface + * GetBits/PutBits capabilities. + * \param[in] device The device to query. + * \param[in] surface_chroma_type The type of chroma type for + * which information is requested. + * \param[in] bits_ycbcr_format The format of application "bits" + * buffer for which information is requested. + * \param[out] is_supported Is this chroma type supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities( + VdpDevice device, + VdpChromaType surface_chroma_type, + VdpYCbCrFormat bits_ycbcr_format, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief An opaque handle representing a VdpVideoSurface + * object. + */ +typedef uint32_t VdpVideoSurface; + +/** + * \brief Create a VdpVideoSurface. + * \param[in] device The device that will contain the surface. + * \param[in] chroma_type The chroma type of the new surface. + * \param[in] width The width of the new surface. + * \param[in] height The height of the new surface. + * \param[out] surface The new surface's handle. + * \return VdpStatus The completion status of the operation. + * + * The memory backing the surface may not be initialized during + * creation. Applications are expected to initialize any region + * that they use, via \ref VdpDecoderRender or \ref + * VdpVideoSurfacePutBitsYCbCr. + */ +typedef VdpStatus VdpVideoSurfaceCreate( + VdpDevice device, + VdpChromaType chroma_type, + uint32_t width, + uint32_t height, + /* output parameters follow */ + VdpVideoSurface * surface +); + +/** + * \brief Destroy a VdpVideoSurface. + * \param[in] surface The surface's handle. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoSurfaceDestroy( + VdpVideoSurface surface +); + +/** + * \brief Retrieve the parameters used to create a + * VdpVideoSurface. + * \param[in] surface The surface's handle. + * \param[out] chroma_type The chroma type of the surface. + * \param[out] width The width of the surface. + * \param[out] height The height of the surface. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoSurfaceGetParameters( + VdpVideoSurface surface, + /* output parameters follow */ + VdpChromaType * chroma_type, + uint32_t * width, + uint32_t * height +); + +/** + * \brief Copy image data from a VdpVideoSurface to application + * memory in a specified YCbCr format. + * \param[in] surface The surface's handle. + * \param[in] destination_ycbcr_format The format of the + * application's data buffers. + * \param[in] destination_data Pointers to the application data + * buffers into which the image data will be written. Note + * that this is an array of pointers, one per plane. The + * destination_format parameter will define how many + * planes are required. + * \param[in] destination_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * destination_format parameter will define how many + * planes are required. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoSurfaceGetBitsYCbCr( + VdpVideoSurface surface, + VdpYCbCrFormat destination_ycbcr_format, + void * const * destination_data, + uint32_t const * destination_pitches +); + +/** + * \brief Copy image data from application memory in a specific + * YCbCr format to a VdpVideoSurface. + * \param[in] surface The surface's handle. + * \param[in] source_ycbcr_format The format of the + * application's data buffers. + * \param[in] source_data Pointers to the application data + * buffers from which the image data will be copied. Note + * that this is an array of pointers, one per plane. The + * source_format parameter will define how many + * planes are required. + * \param[in] source_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * source_format parameter will define how many + * planes are required. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoSurfacePutBitsYCbCr( + VdpVideoSurface surface, + VdpYCbCrFormat source_ycbcr_format, + void const * const * source_data, + uint32_t const * source_pitches +); + +/*@}*/ + +/** + * \defgroup VdpOutputSurface VdpOutputSurface; Output Surface \ + * object + * + * A VdpOutputSurface stores RGBA data in a defined format. + * + * A VdpOutputSurface may be filled with: + * - Data provided by the CPU via the various + * VdpOutputSurfacePutBits functions. + * - Using the VdpOutputSurface \ref VdpOutputSurfaceRender + * "rendering functionality". + * - Using a \ref VdpVideoMixer "VdpVideoMixer" object. + * + * VdpOutputSurface content may be accessed by: + * - The application via the various VdpOutputSurfaceGetBits + * functions. + * - The Hardware that implements VdpOutputSurface + * \ref VdpOutputSurfaceRender "rendering functionality". + * - The Hardware the implements \ref VdpVideoMixer + * "VdpVideoMixer" functionality. + * - The Hardware that implements \ref VdpPresentationQueue + * "VdpPresentationQueue" functionality, + * + * VdpVideoSurfaces are directly displayable using a \ref + * VdpPresentationQueue "VdpPresentationQueue" object. + * + * @{ + */ + +/** + * \brief The set of all known color table formats, for use with + * \ref VdpOutputSurfacePutBitsIndexed. + */ +typedef uint32_t VdpColorTableFormat; + +/** + * \hideinitializer + * \brief 8-bit per component packed into 32-bits + * + * This format is an array of packed 32-bit RGB color values. + * Bits [31:24] are unused, bits [23:16] contain R, bits [15:8] + * contain G, and bits [7:0] contain B. Note: The format is + * physically an array of uint32_t values, and should be accessed + * as such by the application in order to avoid endianness + * issues. + */ +#define VDP_COLOR_TABLE_FORMAT_B8G8R8X8 (VdpColorTableFormat)0 + +/** + * \brief Query the implementation's VdpOutputSurface + * capabilities. + * \param[in] device The device to query. + * \param[in] surface_rgba_format The surface format for + * which information is requested. + * \param[out] is_supported Is this surface format supported? + * \param[out] max_width The maximum supported surface width for + * this chroma type. + * \param[out] max_height The maximum supported surface height + * for this chroma type. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceQueryCapabilities( + VdpDevice device, + VdpRGBAFormat surface_rgba_format, + /* output parameters follow */ + VdpBool * is_supported, + uint32_t * max_width, + uint32_t * max_height +); + +/** + * \brief Query the implementation's capability to perform a + * PutBits operation using application data matching the + * surface's format. + * \param[in] device The device to query. + * \param[in] surface_rgba_format The surface format for + * which information is requested. + * \param[out] is_supported Is this surface format supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceQueryGetPutBitsNativeCapabilities( + VdpDevice device, + VdpRGBAFormat surface_rgba_format, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief Query the implementation's capability to perform a + * PutBits operation using application data in a specific + * indexed format. + * \param[in] device The device to query. + * \param[in] surface_rgba_format The surface format for + * which information is requested. + * \param[in] bits_indexed_format The format of the application + * data buffer. + * \param[in] color_table_format The format of the color lookup + * table. + * \param[out] is_supported Is this surface format supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceQueryPutBitsIndexedCapabilities( + VdpDevice device, + VdpRGBAFormat surface_rgba_format, + VdpIndexedFormat bits_indexed_format, + VdpColorTableFormat color_table_format, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief Query the implementation's capability to perform a + * PutBits operation using application data in a specific + * YCbCr/YUB format. + * \param[in] device The device to query. + * \param[in] surface_rgba_format The surface format for which + * information is requested. + * \param[in] bits_ycbcr_format The format of the application + * data buffer. + * \param[out] is_supported Is this surface format supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceQueryPutBitsYCbCrCapabilities( + VdpDevice device, + VdpRGBAFormat surface_rgba_format, + VdpYCbCrFormat bits_ycbcr_format, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief An opaque handle representing a VdpOutputSurface + * object. + */ +typedef uint32_t VdpOutputSurface; + +/** + * \brief Create a VdpOutputSurface. + * \param[in] device The device that will contain the surface. + * \param[in] rgba_format The format of the new surface. + * \param[in] width The width of the new surface. + * \param[in] height The height of the new surface. + * \param[out] surface The new surface's handle. + * \return VdpStatus The completion status of the operation. + * + * The memory backing the surface will be initialized to 0 color + * and 0 alpha (i.e. black.) + */ +typedef VdpStatus VdpOutputSurfaceCreate( + VdpDevice device, + VdpRGBAFormat rgba_format, + uint32_t width, + uint32_t height, + /* output parameters follow */ + VdpOutputSurface * surface +); + +/** + * \brief Destroy a VdpOutputSurface. + * \param[in] surface The surface's handle. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceDestroy( + VdpOutputSurface surface +); + +/** + * \brief Retrieve the parameters used to create a + * VdpOutputSurface. + * \param[in] surface The surface's handle. + * \param[out] rgba_format The format of the surface. + * \param[out] width The width of the surface. + * \param[out] height The height of the surface. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceGetParameters( + VdpOutputSurface surface, + /* output parameters follow */ + VdpRGBAFormat * rgba_format, + uint32_t * width, + uint32_t * height +); + +/** + * \brief Copy image data from a VdpOutputSurface to application + * memory in the surface's native format. + * \param[in] surface The surface's handle. + * \param[in] source_rect The sub-rectangle of the source + * surface to copy. If NULL, the entire surface will be + * retrieved. + * \param[in] destination_data Pointers to the application data + * buffers into which the image data will be written. Note + * that this is an array of pointers, one per plane. The + * destination_format parameter will define how many + * planes are required. + * \param[in] destination_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * destination_format parameter will define how many + * planes are required. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfaceGetBitsNative( + VdpOutputSurface surface, + VdpRect const * source_rect, + void * const * destination_data, + uint32_t const * destination_pitches +); + +/** + * \brief Copy image data from application memory in the + * surface's native format to a VdpOutputSurface. + * \param[in] surface The surface's handle. + * \param[in] source_data Pointers to the application data + * buffers from which the image data will be copied. Note + * that this is an array of pointers, one per plane. The + * source_format parameter will define how many + * planes are required. + * \param[in] source_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * source_format parameter will define how many + * planes are required. + * \param[in] destination_rect The sub-rectangle of the surface + * to fill with application data. If NULL, the entire + * surface will be updated. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfacePutBitsNative( + VdpOutputSurface surface, + void const * const * source_data, + uint32_t const * source_pitches, + VdpRect const * destination_rect +); + +/** + * \brief Copy image data from application memory in a specific + * indexed format to a VdpOutputSurface. + * \param[in] surface The surface's handle. + * \param[in] source_indexed_format The format of the + * application's data buffers. + * \param[in] source_data Pointers to the application data + * buffers from which the image data will be copied. Note + * that this is an array of pointers, one per plane. The + * source_indexed_format parameter will define how many + * planes are required. + * \param[in] source_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * source_indexed_format parameter will define how many + * planes are required. + * \param[in] destination_rect The sub-rectangle of the surface + * to fill with application data. If NULL, the entire + * surface will be updated. + * \param[in] color_table_format The format of the color_table. + * \param[in] color_table A table that maps between source index + * and target color data. See \ref VdpColorTableFormat for + * details regarding the memory layout. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfacePutBitsIndexed( + VdpOutputSurface surface, + VdpIndexedFormat source_indexed_format, + void const * const * source_data, + uint32_t const * source_pitch, + VdpRect const * destination_rect, + VdpColorTableFormat color_table_format, + void const * color_table +); + +/** + * \brief Copy image data from application memory in a specific + * YCbCr format to a VdpOutputSurface. + * \param[in] surface The surface's handle. + * \param[in] source_ycbcr_format The format of the + * application's data buffers. + * \param[in] source_data Pointers to the application data + * buffers from which the image data will be copied. Note + * that this is an array of pointers, one per plane. The + * source_ycbcr_format parameter will define how many + * planes are required. + * \param[in] source_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * source_ycbcr_format parameter will define how many + * planes are required. + * \param[in] destination_rect The sub-rectangle of the surface + * to fill with application data. If NULL, the entire + * surface will be updated. + * \param[in] csc_matrix The color space conversion matrix used + * by the copy operation. If NULL, a default matrix will + * be used internally. Th default matrix is equivalent to + * ITU-R BT.601 with no procamp changes. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpOutputSurfacePutBitsYCbCr( + VdpOutputSurface surface, + VdpYCbCrFormat source_ycbcr_format, + void const * const * source_data, + uint32_t const * source_pitches, + VdpRect const * destination_rect, + VdpCSCMatrix const * csc_matrix +); + +/*@}*/ + +/** + * \defgroup VdpBitmapSurface VdpBitmapSurface; Bitmap Surface \ + * object + * + * A VdpBitmapSurface stores RGBA data in a defined format. + * + * A VdpBitmapSurface may be filled with: + * - Data provided by the CPU via the \ref + * VdpBitmapSurfacePutBitsNative function. + * + * VdpBitmapSurface content may be accessed by: + * - The Hardware that implements \ref VdpOutputSurface + * "VdpOutputSurface" \ref VdpOutputSurfaceRender + * "rendering functionality" + * + * VdpBitmapSurface objects are intended to store static read-only data, such + * as font glyphs, and the bitmaps used to compose an applications' + * user-interface. + * + * The primary differences between VdpBitmapSurfaces and + * \ref VdpOutputSurface "VdpOutputSurface"s are: + * + * - You cannot render to a VdpBitmapSurface, just upload native data via + * the PutBits API. + * + * - The read-only nature of a VdpBitmapSurface gives the implementation more + * flexibility in its choice of data storage location for the bitmap data. + * For example, some implementations may choose to store some/all + * VdpBitmapSurface objects in system memory to relieve GPU memory pressure. + * + * - VdpBitmapSurface and VdpOutputSurface may support different subsets of all + * known RGBA formats. + * + * @{ + */ + +/** + * \brief Query the implementation's VdpBitmapSurface + * capabilities. + * \param[in] device The device to query. + * \param[in] surface_rgba_format The surface format for + * which information is requested. + * \param[out] is_supported Is this surface format supported? + * \param[out] max_width The maximum supported surface width for + * this chroma type. + * \param[out] max_height The maximum supported surface height + * for this chroma type. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpBitmapSurfaceQueryCapabilities( + VdpDevice device, + VdpRGBAFormat surface_rgba_format, + /* output parameters follow */ + VdpBool * is_supported, + uint32_t * max_width, + uint32_t * max_height +); + +/** + * \brief An opaque handle representing a VdpBitmapSurface + * object. + */ +typedef uint32_t VdpBitmapSurface; + +/** + * \brief Create a VdpBitmapSurface. + * \param[in] device The device that will contain the surface. + * \param[in] rgba_format The format of the new surface. + * \param[in] width The width of the new surface. + * \param[in] height The height of the new surface. + * \param[in] frequently_accessed Is this bitmap used + * frequently, or infrequently, by compositing options? + * Implementations may use this as a hint to determine how + * to allocate the underlying storage for the surface. + * \param[out] surface The new surface's handle. + * \return VdpStatus The completion status of the operation. + * + * The memory backing the surface may not be initialized + * during creation. Applications are expected initialize any + * region that they use, via \ref VdpBitmapSurfacePutBitsNative. + */ +typedef VdpStatus VdpBitmapSurfaceCreate( + VdpDevice device, + VdpRGBAFormat rgba_format, + uint32_t width, + uint32_t height, + VdpBool frequently_accessed, + /* output parameters follow */ + VdpBitmapSurface * surface +); + +/** + * \brief Destroy a VdpBitmapSurface. + * \param[in] surface The surface's handle. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpBitmapSurfaceDestroy( + VdpBitmapSurface surface +); + +/** + * \brief Retrieve the parameters used to create a + * VdpBitmapSurface. + * \param[in] surface The surface's handle. + * \param[out] rgba_format The format of the surface. + * \param[out] width The width of the surface. + * \param[out] height The height of the surface. + * \param[out] frequently_accessed The frequently_accessed state + * of the surface. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpBitmapSurfaceGetParameters( + VdpBitmapSurface surface, + /* output parameters follow */ + VdpRGBAFormat * rgba_format, + uint32_t * width, + uint32_t * height, + VdpBool * frequently_accessed +); + +/** + * \brief Copy image data from application memory in the + * surface's native format to a VdpBitmapSurface. + * \param[in] surface The surface's handle. + * \param[in] source_data Pointers to the application data + * buffers from which the image data will be copied. Note + * that this is an array of pointers, one per plane. The + * source_format parameter will define how many + * planes are required. + * \param[in] source_pitches Pointers to the pitch values + * for the application data buffers. Note that this is an + * array of pointers, one per plane. The + * source_format parameter will define how many + * planes are required. + * \param[in] destination_rect The sub-rectangle of the surface + * to fill with application data. If NULL, the entire + * surface will be updated. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpBitmapSurfacePutBitsNative( + VdpBitmapSurface surface, + void const * const * source_data, + uint32_t const * source_pitches, + VdpRect const * destination_rect +); + +/*@}*/ + +/** + * \defgroup VdpOutputSurfaceRender VdpOutputSurface Rendering \ + * Functionality + * + * \ref VdpOutputSurface "VdpOutputSurface" objects + * directly provide some rendering/compositing operations. These + * are described below. + * + * @{ + */ + +/** + * \hideinitializer + * \brief The blending equation factors. + */ +typedef enum { + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ZERO = 0, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE = 1, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_COLOR = 2, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_ALPHA = 4, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 5, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_DST_ALPHA = 6, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 7, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_DST_COLOR = 8, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 9, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_SRC_ALPHA_SATURATE = 10, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_CONSTANT_COLOR = 11, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 12, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_CONSTANT_ALPHA = 13, + VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 14, +} VdpOutputSurfaceRenderBlendFactor; + +/** + * \hideinitializer + * \brief The blending equations. + */ +typedef enum { + VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_SUBTRACT = 0, + VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_REVERSE_SUBTRACT = 1, + VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD = 2, + VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_MIN = 3, + VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_MAX = 4, +} VdpOutputSurfaceRenderBlendEquation; + +#define VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION 0 + +/** + * \brief Complete blending operation definition. + */ +typedef struct { + /** + * This field must be filled with VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSIION + */ + uint32_t struct_version; + VdpOutputSurfaceRenderBlendFactor blend_factor_source_color; + VdpOutputSurfaceRenderBlendFactor blend_factor_destination_color; + VdpOutputSurfaceRenderBlendFactor blend_factor_source_alpha; + VdpOutputSurfaceRenderBlendFactor blend_factor_destination_alpha; + VdpOutputSurfaceRenderBlendEquation blend_equation_color; + VdpOutputSurfaceRenderBlendEquation blend_equation_alpha; + VdpColor blend_constant; +} VdpOutputSurfaceRenderBlendState; + +/** + * \hideinitializer + * \brief Do not rotate source_surface prior to compositing. + */ +#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_0 0 + +/** + * \hideinitializer + * \brief Rotate source_surface 90 degrees clockwise prior to + * compositing. + */ +#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_90 1 + +/** + * \hideinitializer + * \brief Rotate source_surface 180 degrees prior to + * compositing. + */ +#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_180 2 + +/** + * \hideinitializer + * \brief Rotate source_surface 270 degrees clockwise prior to + * compositing. + */ +#define VDP_OUTPUT_SURFACE_RENDER_ROTATE_270 3 + +/** + * \hideinitializer + * \brief A separate color is used for each vertex of the + * smooth-shaded quad. Hence, colors array contains 4 + * elements rather than 1. See description of colors + * array. + */ +#define VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX (1 << 2) + +/** + * \brief Composite a sub-rectangle of a \ref VdpOutputSurface + * "VdpOutputSurface" into a sub-rectangle of another + * \ref VdpOutputSurface VdpOutputSurface. + * \param[in] destination_surface The destination surface of the + * compositing operation. + * \param[in] destination_rect The sub-rectangle of the + * destination surface to update. If NULL, the entire + * destination surface will be updated. + * \param[in] source_surface The source surface for the + * compositing operation. The surface is treated as having + * four components: red, green, blue and alpha. Any + * missing components are treated as 1.0. For example, for + * an A8 VdpOutputSurface, alpha will come from the surface + * but red, green and blue will be treated as 1.0. If + * source_surface is NULL, all components will be treated + * as 1.0. Note that destination_surface and + * source_surface must have been allocated via the same + * \ref VdpDevice "VdpDevice". + * \param[in] source_rect The sub-rectangle of the source + * surface to read from. If NULL, the entire + * source_surface will be read. Left/right ot top/bottom + * co-ordinates may be swapped to flip the source. Any + * flip occurs prior to any requested rotation. Values + * from outside the source surface are valid and samples + * at those locations will be taken from the nearest edge. + * \param[in] colors A pointer to an array of \ref VdpColor + * "VdpColor" objects. If the flag + * VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is set, + * VDPAU will four entries from the array, and treat them + * as the colors corresponding to the upper-left, + * upper-right, lower-right and lower-left corners of the + * post-rotation source (i.e. indices 0, 1, 2 and 3 run + * clockwise from the upper left corner). If the flag + * VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is not + * set, VDPAU will use the single VdpColor for all four + * corners. If colors is NULL then red, green, blue and + * alpha values of 1.0 will be used. + * \param[in] blend_state If a blend state is provided, the + * blend state will be used for the composite operation. If + * NULL, blending is effectively disabled, which is + * equivalent to a blend equation of ADD, source blend + * factors of ONE and destination blend factors of ZERO. The + * blend math is the familiar OpenGL blend math: + * \f[ + * dst.a = equation(blendFactorDstAlpha*dst.a, + * blendFactorSrcAlpha*src.a); + * \f] + * \f[ + * dst.rgb = equation(blendFactorDstColor*dst.rgb, + * blendFactorSrcColor*src.rgb); + * \f] + * \param[in] flags A set of flags influencing how the + * compositing operation works. + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_0 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_90 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_180 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_270 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX + * \return VdpStatus The completion status of the operation. + * + * The general compositing pipeline is as follows. + * + * -# Extract source_rect from source_surface. + * + * -# The extracted source is rotated 0, 90, 180 or 270 degrees + * according to the flags. + * + * -# The rotated source is component-wise multiplied by a + * smooth-shaded quad with a (potentially) different color at + * each vertex. + * + * -# The resulting rotated, smooth-shaded quad is scaled to the + * size of destination_rect and composited with + * destination_surface using the provided blend state. + * + */ +typedef VdpStatus VdpOutputSurfaceRenderOutputSurface( + VdpOutputSurface destination_surface, + VdpRect const * destination_rect, + VdpOutputSurface source_surface, + VdpRect const * source_rect, + VdpColor const * colors, + VdpOutputSurfaceRenderBlendState const * blend_state, + uint32_t flags +); + +/** + * \brief Composite a sub-rectangle of a \ref VdpBitmapSurface + * "VdpBitmapSurface" into a sub-rectangle of a + * \ref VdpOutputSurface VdpOutputSurface. + * \param[in] destination_surface The destination surface of the + * compositing operation. + * \param[in] destination_rect The sub-rectangle of the + * destination surface to update. If NULL, the entire + * destination surface will be updated. + * \param[in] source_surface The source surface for the + * compositing operation. The surface is treated as having + * four components: red, green, blue and alpha. Any + * missing components are treated as 1.0. For example, for + * an A8 VdpBitmapSurface, alpha will come from the surface + * but red, green and blue will be treated as 1.0. If + * source_surface is NULL, all components will be treated + * as 1.0. Note that destination_surface and + * source_surface must have been allocated via the same + * \ref VdpDevice "VdpDevice". + * \param[in] source_rect The sub-rectangle of the source + * surface to read from. If NULL, the entire + * source_surface will be read. Left/right ot top/bottom + * co-ordinates may be swapped to flip the source. Any + * flip occurs prior to any requested rotation. Values + * from outside the source surface are valid and samples + * at those locations will be taken from the nearest edge. + * \param[in] colors A pointer to an array of \ref VdpColor + * "VdpColor" objects. If the flag + * VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is set, + * VDPAU will four entries from the array, and treat them + * as the colors corresponding to the upper-left, + * upper-right, lower-right and lower-left corners of the + * post-rotation source (i.e. indices 0, 1, 2 and 3 run + * clockwise from the upper left corner). If the flag + * VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX is not + * set, VDPAU will use the single VdpColor for all four + * corners. If colors is NULL then red, green, blue and + * alpha values of 1.0 will be used. + * \param[in] blend_state If a blend state is provided, the + * blend state will be used for the composite operation. If + * NULL, blending is effectively disabled, which is + * equivalent to a blend equation of ADD, source blend + * factors of ONE and destination blend factors of ZERO. The + * blend math is the familiar OpenGL blend math: + * \f[ + * dst.a = equation(blendFactorDstAlpha*dst.a, + * blendFactorSrcAlpha*src.a); + * \f] + * \f[ + * dst.rgb = equation(blendFactorDstColor*dst.rgb, + * blendFactorSrcColor*src.rgb); + * \f] + * \param[in] flags A set of flags influencing how the + * compositing operation works. + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_0 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_90 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_180 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_ROTATE_270 + * \arg \ref VDP_OUTPUT_SURFACE_RENDER_COLOR_PER_VERTEX + * \return VdpStatus The completion status of the operation. + * + * The general compositing pipeline is as follows. + * + * -# Extract source_rect from source_surface. + * + * -# The extracted source is rotated 0, 90, 180 or 270 degrees + * according to the flags. + * + * -# The rotated source is component-wise multiplied by a + * smooth-shaded quad with a (potentially) different color at + * each vertex. + * + * -# The resulting rotated, smooth-shaded quad is scaled to the + * size of destination_rect and composited with + * destination_surface using the provided blend state. + * + */ +typedef VdpStatus VdpOutputSurfaceRenderBitmapSurface( + VdpOutputSurface destination_surface, + VdpRect const * destination_rect, + VdpBitmapSurface source_surface, + VdpRect const * source_rect, + VdpColor const * colors, + VdpOutputSurfaceRenderBlendState const * blend_state, + uint32_t flags +); + +/*@}*/ + +/** + * \defgroup VdpDecoder VdpDecoder; Video Decoding object + * + * The VdpDecoder object decodes compressed video data, writing + * the results to a \ref VdpVideoSurface "VdpVideoSurface". + * + * A specific VDPAU implementation may support decoding multiple + * types of compressed video data. However, VdpDecoder objects + * are able to decode a specific type of compressed video data. + * This type must be specified during creation. + * + * @{ + */ + +/** + * \brief The set of all known compressed video formats, and + * associated profiles, that may be decoded. + */ +typedef uint32_t VdpDecoderProfile; + +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_MPEG1 (VdpDecoderProfile)0 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_MPEG2_SIMPLE (VdpDecoderProfile)1 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_MPEG2_MAIN (VdpDecoderProfile)2 +/** \hideinitializer */ +/** \brief MPEG 4 part 10 == H.264 == AVC */ +#define VDP_DECODER_PROFILE_H264_BASELINE (VdpDecoderProfile)6 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_H264_MAIN (VdpDecoderProfile)7 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_H264_HIGH (VdpDecoderProfile)8 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_VC1_SIMPLE (VdpDecoderProfile)9 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_VC1_MAIN (VdpDecoderProfile)10 +/** \hideinitializer */ +#define VDP_DECODER_PROFILE_VC1_ADVANCED (VdpDecoderProfile)11 + +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_MPEG1_NA 0 + +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_MPEG2_LL 0 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_MPEG2_ML 1 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_MPEG2_HL14 2 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_MPEG2_HL 3 + +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_1 10 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_1b 9 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_1_1 11 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_1_2 12 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_1_3 13 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_2 20 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_2_1 21 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_2_2 22 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_3 30 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_3_1 31 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_3_2 32 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_4 40 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_4_1 41 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_4_2 42 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_5 50 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_H264_5_1 51 + +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_SIMPLE_LOW 0 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_SIMPLE_MEDIUM 1 + +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_MAIN_LOW 0 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_MAIN_MEDIUM 1 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_MAIN_HIGH 2 + +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_ADVANCED_L0 0 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_ADVANCED_L1 1 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_ADVANCED_L2 2 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_ADVANCED_L3 3 +/** \hideinitializer */ +#define VDP_DECODER_LEVEL_VC1_ADVANCED_L4 4 + +/** + * \brief Query the implementation's VdpDecoder capabilities. + * \param[in] device The device to query. + * \param[in] profile The decoder profile for which information is requested. + * \param[out] is_supported Is this profile supported? + * \param[out] max_level The maximum specification level supported for this + * profile. + * \param[out] max_macroblocks The maximum supported surface size in + * macroblocks. Note that this could be greater than that dictated by + * the maximum level. + * \param[out] max_width The maximum supported surface width for this profile. + * Note that this could be greater than that dictated by the maximum + * level. + * \param[out] max_height The maximum supported surface height for this + * profile. Note that this could be greater than that dictated by the + * maximum level. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpDecoderQueryCapabilities( + VdpDevice device, + VdpDecoderProfile profile, + /* output parameters follow */ + VdpBool * is_supported, + uint32_t * max_level, + uint32_t * max_macroblocks, + uint32_t * max_width, + uint32_t * max_height +); + +/** + * \brief An opaque handle representing a VdpDecoder object. + */ +typedef uint32_t VdpDecoder; + +/** + * \brief Create a VdpDecoder. + * \param[in] device The device that will contain the surface. + * \param[in] profile The video format the decoder will decode. + * \param[in] width The width of the new surface. + * \param[in] height The height of the new surface. + * \param[in] max_references The maximum number of references that may be + * used by a single frame in the stream to be decoded. This parameter + * exists mainly for formats such as H.264, where different streams + * may use a different number of references. Requesting too many + * references may waste memory, but decoding should still operate + * correctly. Requesting too few references will cause decoding to + * fail. + * \param[out] decoder The new decoder's handle. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpDecoderCreate( + VdpDevice device, + VdpDecoderProfile profile, + uint32_t width, + uint32_t height, + uint32_t max_references, + /* output parameters follow */ + VdpDecoder * decoder +); + +/** + * \brief Destroy a VdpDecoder. + * \param[in] surface The decoder's handle. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpDecoderDestroy( + VdpDecoder decoder +); + +/** + * \brief Retrieve the parameters used to create a + * VdpDecoder. + * \param[in] surface The surface's handle. + * \param[out] profile The video format used to create the + * decoder. + * \param[out] width The width of surfaces decode by the + * decoder. + * \param[out] height The height of surfaces decode by the + * decoder + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpDecoderGetParameters( + VdpDecoder decoder, + /* output parameters follow */ + VdpDecoderProfile * profile, + uint32_t * width, + uint32_t * height +); + +#define VDP_BITSTREAM_BUFFER_VERSION 0 + +/** + * \brief Application data buffer containing compressed video + * data. + */ +typedef struct { + /** + * This field must be filled with VDP_BITSTREAM_BUFFER_VERSION + */ + uint32_t struct_version; + /** A pointer to the bitstream data bytes */ + void const * bitstream; + /** The number of data bytes */ + uint32_t bitstream_bytes; +} VdpBitstreamBuffer; + +/** + * \brief A generic "picture information" pointer type. + * + * This type serves solely to document the expected usage of a + * generic (void *) function parameter. In actual usage, the + * application is expected to physically provide a pointer to an + * instance of one of the "real" VdpPictureInfo* structures, + * picking the type appropriate for the decoder object in + * question. + */ +typedef void * VdpPictureInfo; + +/** + * \brief Picture parameter information for an MPEG 1 or MPEG 2 + * picture. + * + * Note: References to "copy of bitstream field" in the field descriptions + * may refer to data literally parsed from the bitstream, or derived from + * the bitstream using a mechanism described in the specification. + */ +typedef struct { + /** + * Reference used by B and P frames. + * Set to VDP_INVALID_HANDLE when not used. + */ + VdpVideoSurface forward_reference; + /** + * Reference used by B frames. + * Set to VDP_INVALID_HANDLE when not used. + */ + VdpVideoSurface backward_reference; + /** Number of slices in the bitstream provided. */ + uint32_t slice_count; + + /** Copy of the MPEG bitstream field. */ + uint8_t picture_structure; + /** Copy of the MPEG bitstream field. */ + uint8_t picture_coding_type; + /** Copy of the MPEG bitstream field. */ + uint8_t intra_dc_precision; + /** Copy of the MPEG bitstream field. */ + uint8_t frame_pred_frame_dct; + /** Copy of the MPEG bitstream field. */ + uint8_t concealment_motion_vectors; + /** Copy of the MPEG bitstream field. */ + uint8_t intra_vlc_format; + /** Copy of the MPEG bitstream field. */ + uint8_t alternate_scan; + /** Copy of the MPEG bitstream field. */ + uint8_t q_scale_type; + /** Copy of the MPEG bitstream field. */ + uint8_t top_field_first; + /** Copy of the MPEG-1 bitstream field. For MPEG-2, set to 0. */ + uint8_t full_pel_forward_vector; + /** Copy of the MPEG-1 bitstream field. For MPEG-2, set to 0. */ + uint8_t full_pel_backward_vector; + /** + * Copy of the MPEG bitstream field. + * For MPEG-1, fill both horizontal and vertical entries. + */ + uint8_t f_code[2][2]; + /** Copy of the MPEG bitstream field, converted to raster order. */ + uint8_t intra_quantizer_matrix[64]; + /** Copy of the MPEG bitstream field, converted to raster order. */ + uint8_t non_intra_quantizer_matrix[64]; +} VdpPictureInfoMPEG1Or2; + +/** + * \brief Information about an H.264 reference frame + * + * Note: References to "copy of bitstream field" in the field descriptions + * may refer to data literally parsed from the bitstream, or derived from + * the bitstream using a mechanism described in the specification. + */ +typedef struct { + /** + * The surface that contains the reference image. + * Set to VDP_INVALID_HANDLE for unused entries. + */ + VdpVideoSurface surface; + /** Is this a long term reference (else short term). */ + VdpBool is_long_term; + /** + * Is the top field used as a reference. + * Set to VDP_FALSE for unused entries. + */ + VdpBool top_is_reference; + /** + * Is the bottom field used as a reference. + * Set to VDP_FALSE for unused entries. + */ + VdpBool bottom_is_reference; + /** [0]: top, [1]: bottom */ + int32_t field_order_cnt[2]; + /** + * Copy of the H.264 bitstream field: + * frame_num from slice_header for short-term references, + * LongTermPicNum from decoding algorithm for long-term references. + */ + uint16_t frame_idx; +} VdpReferenceFrameH264; + +/** + * \brief Picture parameter information for an H.264 picture. + * + * Note: The \ref referenceFrames array must contain the "DPB" as + * defined by the H.264 specification. In particular, once a + * reference frame has been decoded to a surface, that surface must + * continue to appear in the DPB until no longer required to predict + * any future frame. Once a surface is removed from the DPB, it can + * no longer be used as a reference, unless decoded again. + * + * Also note that only surfaces previously generated using \ref + * VdpDecoderRender may be used as reference frames. In particular, + * surfaces filled using any "put bits" API will not work. + * + * Note: References to "copy of bitstream field" in the field descriptions + * may refer to data literally parsed from the bitstream, or derived from + * the bitstream using a mechanism described in the specification. + */ +typedef struct { + /** Number of slices in the bitstream provided. */ + uint32_t slice_count; + /** [0]: top, [1]: bottom */ + int32_t field_order_cnt[2]; + /** Will the decoded frame be used as a reference later. */ + VdpBool is_reference; + + /** Copy of the H.264 bitstream field. */ + uint16_t frame_num; + /** Copy of the H.264 bitstream field. */ + uint8_t field_pic_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t bottom_field_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t num_ref_frames; + /** Copy of the H.264 bitstream field. */ + uint8_t mb_adaptive_frame_field_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t constrained_intra_pred_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t weighted_pred_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t weighted_bipred_idc; + /** Copy of the H.264 bitstream field. */ + uint8_t frame_mbs_only_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t transform_8x8_mode_flag; + /** Copy of the H.264 bitstream field. */ + int8_t chroma_qp_index_offset; + /** Copy of the H.264 bitstream field. */ + int8_t second_chroma_qp_index_offset; + /** Copy of the H.264 bitstream field. */ + int8_t pic_init_qp_minus26; + /** Copy of the H.264 bitstream field. */ + uint8_t num_ref_idx_l0_active_minus1; + /** Copy of the H.264 bitstream field. */ + uint8_t num_ref_idx_l1_active_minus1; + /** Copy of the H.264 bitstream field. */ + uint8_t log2_max_frame_num_minus4; + /** Copy of the H.264 bitstream field. */ + uint8_t pic_order_cnt_type; + /** Copy of the H.264 bitstream field. */ + uint8_t log2_max_pic_order_cnt_lsb_minus4; + /** Copy of the H.264 bitstream field. */ + uint8_t delta_pic_order_always_zero_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t direct_8x8_inference_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t entropy_coding_mode_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t pic_order_present_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t deblocking_filter_control_present_flag; + /** Copy of the H.264 bitstream field. */ + uint8_t redundant_pic_cnt_present_flag; + + /** Copy of the H.264 bitstream field, converted to raster order. */ + uint8_t scaling_lists_4x4[6][16]; + /** Copy of the H.264 bitstream field, converted to raster order. */ + uint8_t scaling_lists_8x8[2][64]; + + /** See \ref VdpPictureInfoH264 for instructions regarding this field. */ + VdpReferenceFrameH264 referenceFrames[16]; +} VdpPictureInfoH264; + +/** + * \brief Picture parameter information for a VC1 picture. + * + * Note: References to "copy of bitstream field" in the field descriptions + * may refer to data literally parsed from the bitstream, or derived from + * the bitstream using a mechanism described in the specification. + */ +typedef struct { + /** + * Reference used by B and P frames. + * Set to VDP_INVALID_HANDLE when not used. + */ + VdpVideoSurface forward_reference; + /** + * Reference used by B frames. + * Set to VDP_INVALID_HANDLE when not used. + */ + VdpVideoSurface backward_reference; + + /** Number of slices in the bitstream provided. */ + uint32_t slice_count; + /** I=0, P=1, B=3, BI=4 from 7.1.1.4. */ + uint8_t picture_type; + /** Progressive=0, Frame-interlace=2, Field-interlace=3; see VC-1 7.1.1.15. */ + uint8_t frame_coding_mode; + + /** Copy of the VC-1 bitstream field. See VC-1 6.1.5. */ + uint8_t postprocflag; + /** Copy of the VC-1 bitstream field. See VC-1 6.1.8. */ + uint8_t pulldown; + /** Copy of the VC-1 bitstream field. See VC-1 6.1.9. */ + uint8_t interlace; + /** Copy of the VC-1 bitstream field. See VC-1 6.1.10. */ + uint8_t tfcntrflag; + /** Copy of the VC-1 bitstream field. See VC-1 6.1.11. */ + uint8_t finterpflag; + /** Copy of the VC-1 bitstream field. See VC-1 6.1.3. */ + uint8_t psf; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.8. */ + uint8_t dquant; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.3. */ + uint8_t panscan_flag; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.4. */ + uint8_t refdist_flag; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.11. */ + uint8_t quantizer; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.7. */ + uint8_t extended_mv; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.14. */ + uint8_t extended_dmv; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.10. */ + uint8_t overlap; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.9. */ + uint8_t vstransform; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.5. */ + uint8_t loopfilter; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.6. */ + uint8_t fastuvmc; + /** Copy of the VC-1 bitstream field. See VC-1 6.12.15. */ + uint8_t range_mapy_flag; + /** Copy of the VC-1 bitstream field. */ + uint8_t range_mapy; + /** Copy of the VC-1 bitstream field. See VC-1 6.2.16. */ + uint8_t range_mapuv_flag; + /** Copy of the VC-1 bitstream field. */ + uint8_t range_mapuv; + + /** + * Copy of the VC-1 bitstream field. See VC-1 J.1.10. + * Only used by simple and main profiles. + */ + uint8_t multires; + /** + * Copy of the VC-1 bitstream field. See VC-1 J.1.16. + * Only used by simple and main profiles. + */ + uint8_t syncmarker; + /** + * VC-1 SP/MP range reduction control. + * Only used by simple and main profiles. + * Bit 0: Copy of rangered VC-1 bitstream field; See VC-1 J.1.17. + * Bit 1: Copy of rangeredfrm VC-1 bitstream fiels; See VC-1 7.1.13. + */ + uint8_t rangered; + /** + * Copy of the VC-1 bitstream field. See VC-1 J.1.17. + * Only used by simple and main profiles. + */ + uint8_t maxbframes; + + /** + * Out-of-loop deblocking enable. + * Bit 0 of POSTPROC from VC-1 7.1.1.27 + * Note that bit 1 of POSTPROC (dering enable) should not be included. + */ + uint8_t deblockEnable; + /** + * Parameter used by VC-1 Annex H deblocking algorithm. Note that VDPAU + * implementations may choose which deblocking algorithm to use. + * See VC-1 7.1.1.6 + */ + uint8_t pquant; +} VdpPictureInfoVC1; + +/** + * \brief Decode a compressed field/frame and render the result + * into a \ref VdpVideoSurface "VdpVideoSurface". + * \param[in] decoder The decoder object that will perform the + * decode operation. + * \param[in] target The video surface to render to. + * \param[in] picture_info A (pointer to a) structure containing + * information about the picture to be decoded. Note that + * the appropriate type of VdpPictureInfo* structure must + * be provided to match to profile that the decoder was + * created for. + * \param[in] bitstream_buffer_count The number of bitstream + * buffers containing compressed data for this picture. + * \param[in] bitstream_buffers An array of bitstream buffers. + * \return VdpStatus The completion status of the operation. + * + * See \ref video_mixer_usage for additional information. + */ +typedef VdpStatus VdpDecoderRender( + VdpDecoder decoder, + VdpVideoSurface target, + VdpPictureInfo const * picture_info, + uint32_t bitstream_buffer_count, + VdpBitstreamBuffer const * bitstream_buffers +); + +/*@}*/ + +/** + * \defgroup VdpVideoMixer VdpVideoMixer; Video Post-processing \ + * and Compositing object + * + * VdpVideoMixer can perform some subset of the following + * post-processing steps on video: + * - De-interlacing + * - Various types, with or without inverse telecine + * - Noise-reduction + * - Sharpness adjustment + * - Color space conversion to RGB + * - Chroma format upscaling to 4:4:4 + * + * A VdpVideoMixer takes a source \ref VdpVideoSurface + * "VdpVideoSurface" VdpVideoSurface and performs various video + * processing steps on it (potentially using information from + * past or future video surfaces). It scales the video and + * converts it to RGB, then optionally composites it with + * multiple auxiliary \ref VdpOutputSurface "VdpOutputSurface"s + * before writing the result to the destination \ref + * VdpOutputSurface "VdpOutputSurface". + * + * The video mixer compositing model is as follows: + * + * - A rectangle will be rendered on an output surface. No + * pixels will be rendered outside of this output rectangle. + * The contents of this rectangle will be a composite of many + * layers. + * + * - The first layer is the background color. The background + * color will fill the entire rectangle. + * + * - The second layer is the processed video which has been + * converted to RGB. These pixels will overwrite the + * background color of the first layer except where the second + * layer's rectangle does not completely cover the output + * rectangle. In those regions the background color will + * continue to show. If any portion of the second layer's + * output rectangle is outside of the output rectangle, those + * portions will be clipped. + * + * - The third layer contains some number of auxiliary layers + * (in the form of \ref VdpOutputSurface "VdpOutputSurface"s) + * which will be composited using the alpha value from the + * those surfaces. The compositing operations are equivalent + * to rendering with \ref VdpOutputSurfaceRenderOutputSurface + * using a source blend factor of SOURCE_ALPHA, a destination + * blend factor of ONE_MINUS_SOURCE_ALPHA and an equation of + * ADD. + * + * @{ + */ + +/** + * \brief A VdpVideoMixer feature that must be requested at + * creation time to be used. + * + * Certain advanced VdpVideoMixer features are optional, and the + * ability to use those features at all must be requested when + * the VdpVideoMixer object is created. Each feature is named via + * a specific VdpVideoMixerFeature value. + * + * Once requested, these features are permanently available + * within that specific VdpVideoMixer object. All features that + * are not explicitly requested at creation time default to + * being permanently unavailable. + * + * Even when requested, all features default to being initially + * disabled. However, applications can subsequently enable and + * disable features at any time. See \ref + * VdpVideoMixerSetFeatureEnables. + * + * Some features allow configuration of their operation. Each + * configurable item is an \ref VdpVideoMixerAttribute. These + * attributes may be manipulated at any time using \ref + * VdpVideoMixerSetAttributeValues. + */ +typedef uint32_t VdpVideoMixerFeature; + +/** + * \hideinitializer + * \brief A VdpVideoMixerFeature. + * + * When requested and enabled, motion adaptive temporal + * deinterlacing will be used on interlaced content. + * + * When multiple de-interlacing options are requested and + * enabled, the back-end implementation chooses the best + * algorithm to apply. + */ +#define VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL (VdpVideoMixerFeature)0 +/** + * \hideinitializer + * \brief A VdpVideoMixerFeature. + * + * When requested and enabled, this enables a more advanced + * version of temporal de-interlacing, that additionally uses + * edge-guided spatial interpolation. + * + * When multiple de-interlacing options are requested and + * enabled, the back-end implementation chooses the best + * algorithm to apply. + */ +#define VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL (VdpVideoMixerFeature)1 +/** + * \hideinitializer + * \brief A VdpVideoMixerFeature. + * + * When requested and enabled, cadence detection will be enabled + * on interlaced content and the video mixer will try to extract + * progressive frames from pull-down material. + */ +#define VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE (VdpVideoMixerFeature)2 +/** + * \hideinitializer + * \brief A VdpVideoMixerFeature. + * + * When requested and enabled, a noise reduction algorithm will + * be applied to the video. + */ +#define VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION (VdpVideoMixerFeature)3 +/** + * \hideinitializer + * \brief A VdpVideoMixerFeature. + * + * When requested and enabled, a sharpening algorithm will be + * applied to the video. + */ +#define VDP_VIDEO_MIXER_FEATURE_SHARPNESS (VdpVideoMixerFeature)4 +/** + * \hideinitializer + * \brief A VdpVideoMixerFeature. + * + * When requested and enabled, the alpha of the rendered + * surface, which is normally set to the alpha of the background + * color, will be forced to 0.0 on pixels corresponding to + * source video surface luminance values in the range specified + * by attributes \ref VDP_VIDEO_MIXER_ATTRIBUTE_LUMA_KEY_MIN_LUMA + * to \ref VDP_VIDEO_MIXER_ATTRIBUTE_LUMA_KEY_MAX_LUMA. This + * keying is performed after scaling and de-interlacing. + */ +#define VDP_VIDEO_MIXER_FEATURE_LUMA_KEY (VdpVideoMixerFeature)5 + +/** + * \brief A VdpVideoMixer creation parameter. + * + * When a VdpVideoMixer is created, certain parameters may be + * supplied. Each parameter is named via a specific + * VdpVideoMixerParameter value. + * + * Each parameter has a specific type, and specific default + * value if not specified at VdpVideoMixer creation time. The + * application may query the legal supported range for some + * parameters. + */ +typedef uint32_t VdpVideoMixerParameter; + +/** + * \hideinitializer + * \brief The exact width of input video surfaces. + * + * This parameter's type is uint32_t. + * + * This parameter defaults to 0 if not specified, which entails + * that it must be specified. + * + * The application may query this parameter's supported + * range. + */ +#define VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH (VdpVideoMixerParameter)0 +/** + * \hideinitializer + * \brief The exact height of input video surfaces. + * + * This parameter's type is uint32_t. + * + * This parameter defaults to 0 if not specified, which entails + * that it must be specified. + * + * The application may query this parameter's supported + * range. + */ +#define VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT (VdpVideoMixerParameter)1 +/** + * \hideinitializer + * \brief The chroma type of the input video surfaces the will + * process. + * + * This parameter's type is VdpChromaType. + * + * If not specified, this parameter defaults to + * VDP_CHROMA_TYPE_420. + * + * The application may not query this application's supported + * range, since it is a potentially disjoint enumeration. + */ +#define VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE (VdpVideoMixerParameter)2 +/** + * \hideinitializer + * \brief The number of auxiliary layers in the mixer's + * compositing model. + * + * Note that this indicates the maximum number of layers that + * may be processed by a given \ref VdpVideoMixer "VdpVideoMixer" + * object. Each individual \ref VdpVideoMixerRender invocation + * may choose to use a different number of actual layers, from 0 + * up to this limit. + * + * This attribute's type is uint32_t. + * + * If not specified, this parameter defaults to 0. + * + * The application may query this parameter's supported + * range. + */ +#define VDP_VIDEO_MIXER_PARAMETER_LAYERS (VdpVideoMixerParameter)3 + +/** + * \brief An adjustable attribute of VdpVideoMixer operation. + * + * Various attributes of VdpVideoMixer operation may be adjusted + * at any time. Each attribute is named via a specific + * VdpVideoMixerAttribute value. + * + * Each attribute has a specific type, and specific default + * value if not specified at VdpVideoMixer creation time. The + * application may query the legal supported range for some + * attributes. + */ +typedef uint32_t VdpVideoMixerAttribute; + +/** + * \hideinitializer + * \brief The background color in the VdpVideoMixer's compositing + * model. + * + * This attribute's type is VdpColor. + * + * This parameter defaults to black (all color components 0.0 + * and alpha 1.0). + * + * The application may not query this parameter's supported + * range, since the type is not scalar. + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_BACKGROUND_COLOR (VdpVideoMixerAttribute)0 +/** + * \hideinitializer + * \brief The color-space conversion matrix used by the + * VdpVideoMixer. + * + * This attribute's type is \ref VdpCSCMatrix. + * + * Note: When using \ref VdpVideoMixerGetAttributeValues to retrieve the + * current CSC matrix, the attribute_values array must contain a pointer to + * a pointer a VdpCSCMatrix (VdpCSCMatrix** as a void *). The get function will + * either initialize the referenced CSC matrix to the current value, *or* + * clear the supplied pointer to NULL, if the previous set call supplied a + * value of NULL in parameter_values, to request the default matrix. + * + * \code + * VdpCSCMatrix matrix; + * VdpCSCMatrix * matrix_ptr; + * void * attribute_values[] = {&matrix_ptr}; + * VdpStatus st = vdp_video_mixer_get_attribute_values(..., attribute_values, ...); + * \endcode + * + * This parameter defaults to a matrix suitable for ITU-R BT.601 + * input surfaces, with no procamp adjustments. + * + * The application may not query this parameter's supported + * range, since the type is not scalar. + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX (VdpVideoMixerAttribute)1 +/** + * \hideinitializer + * \brief The amount of noise reduction algorithm to apply. + * + * This attribute's type is float. + * + * This parameter defaults to 0.0, which equates to no noise + * reduction. + * + * The application may query this parameter's supported range. + * However, the range is fixed as 0.0...1.0. + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_NOISE_REDUCTION_LEVEL (VdpVideoMixerAttribute)2 +/** + * \hideinitializer + * \brief The amount of sharpening, or blurring, to apply. + * + * This attribute's type is float. + * + * This parameter defaults to 0.0, which equates to no + * sharpening. + * + * Positive values request sharpening. Negative values request + * blurring. + * + * The application may query this parameter's supported range. + * However, the range is fixed as -1.0...1.0. + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_SHARPNESS_LEVEL (VdpVideoMixerAttribute)3 +/** + * \hideinitializer + * \brief The minimum luma value for the luma key algorithm. + * + * This attribute's type is float. + * + * This parameter defaults to 0.0. + * + * The application may query this parameter's supported range. + * However, the range is fixed as 0.0...1.0. + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_LUMA_KEY_MIN_LUMA (VdpVideoMixerAttribute)4 +/** + * \hideinitializer + * \brief The maximum luma value for the luma key algorithm. + * + * This attribute's type is float. + * + * This parameter defaults to 1.0. + * + * The application may query this parameter's supported range. + * However, the range is fixed as 0.0...1.0. + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_LUMA_KEY_MAX_LUMA (VdpVideoMixerAttribute)5 +/** + * \hideinitializer + * \brief Whether de-interlacers should operate solely on luma, and bob chroma. + * + * Note: This attribute only affects advanced de-interlacing algorithms, not + * bob or weave. + * + * This attribute's type is uint8_t. + * + * This parameter defaults to 0. + * + * The application may query this parameter's supported range. + * However, the range is fixed as 0 (no/off) ... 1 (yes/on). + */ +#define VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE (VdpVideoMixerAttribute)6 + +/** + * \brief Query the implementation's support for a specific + * feature. + * \param[in] device The device to query. + * \param[in] feature The feature for which support is to be + * queried. + * \param[out] is_supported Is the specified feature supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerQueryFeatureSupport( + VdpDevice device, + VdpVideoMixerFeature feature, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief Query the implementation's support for a specific + * parameter. + * \param[in] device The device to query. + * \param[in] parameter The parameter for which support is to be + * queried. + * \param[out] is_supported Is the specified parameter + * supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerQueryParameterSupport( + VdpDevice device, + VdpVideoMixerParameter parameter, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief Query the implementation's support for a specific + * attribute. + * \param[in] device The device to query. + * \param[in] feature The feature for which support is to be + * queried. + * \param[out] is_supported Is the specified feature supported? + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerQueryAttributeSupport( + VdpDevice device, + VdpVideoMixerAttribute attribute, + /* output parameters follow */ + VdpBool * is_supported +); + +/** + * \brief Query the implementation's supported for a specific + * parameter. + * \param[in] device The device to query. + * \param[in] parameter The parameter for which support is to be + * queried. + * \param[out] min_value The minimum supported value. + * \param[out] max_value The maximum supported value. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerQueryParameterValueRange( + VdpDevice device, + VdpVideoMixerParameter parameter, + /* output parameters follow */ + void * min_value, + void * max_value +); + +/** + * \brief Query the implementation's supported for a specific + * attribute. + * \param[in] device The device to query. + * \param[in] attribute The attribute for which support is to be + * queried. + * \param[out] min_value The minimum supported value. + * \param[out] max_value The maximum supported value. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerQueryAttributeValueRange( + VdpDevice device, + VdpVideoMixerAttribute attribute, + /* output parameters follow */ + void * min_value, + void * max_value +); + +/** + * \brief An opaque handle representing a VdpVideoMixer object. + */ +typedef uint32_t VdpVideoMixer; + +/** + * \brief Create a VdpVideoMixer. + * \param[in] device The device that will contain the mixer. + * \param[in] feature_count The number of features to request. + * \param[in] features The list of features to request. + * \param[in] parameter_count The number of parameters to set. + * \param[in] parameters The list of parameters to set. + * \param[in] parameter_values The values for the parameters. Note that each + * entry in the value array is a pointer to the actual value. In other + * words, the values themselves are not cast to "void *" and passed + * "inside" the array. + * \param[out] mixer The new mixer's handle. + * \return VdpStatus The completion status of the operation. + * + * Initially, all requested features will be disabled. They can + * be enabled using \ref VdpVideoMixerSetFeatureEnables. + * + * Initially, all attributes will have default values. Values + * can be changed using \ref VdpVideoMixerSetAttributeValues. + */ +typedef VdpStatus VdpVideoMixerCreate( + VdpDevice device, + // The set of features to request + uint32_t feature_count, + VdpVideoMixerFeature const * features, + // The parameters used during creation + uint32_t parameter_count, + VdpVideoMixerParameter const * parameters, + void const * const * parameter_values, + /* output parameters follow */ + VdpVideoMixer * mixer +); + +/** + * \brief Enable or disable features. + * \param[in] mixer The mixer to manipulate. + * \param[in] feature_count The number of features to + * enable/disable. + * \param[in] features The list of features to enable/disable. + * \param[in] feature_enables The list of new feature enable + * values. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerSetFeatureEnables( + VdpVideoMixer mixer, + uint32_t feature_count, + VdpVideoMixerFeature const * features, + VdpBool const * feature_enables +); + +/** + * \brief Set attribute values + * \param[in] mixer The mixer to manipulate. + * \param[in] attribute_count The number of attributes to set. + * \param[in] attributes The list of attributes to set. + * \param[in] attribute_values The values for the attributes. Note that each + * entry in the value array is a pointer to the actual value. In other + * words, the values themselves are not cast to "void *" and passed + * "inside" the array. A NULL pointer requests that the default value be + * set for that attribute. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerSetAttributeValues( + VdpVideoMixer mixer, + uint32_t attribute_count, + VdpVideoMixerAttribute const * attributes, + void const * const * attribute_values +); + +/** + * \brief Retrieve whether features were requested at creation + * time. + * \param[in] mixer The mixer to query. + * \param[in] feature_count The number of features to query. + * \param[in] features The list of features to query. + * \param[out] feature_supported A list of values indicating + * whether the feature was requested, and hence is + * available. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerGetFeatureSupport( + VdpVideoMixer mixer, + uint32_t feature_count, + VdpVideoMixerFeature const * features, + /* output parameters follow */ + VdpBool * feature_supports +); + +/** + * \brief Retrieve whether features are enabled. + * \param[in] mixer The mixer to manipulate. + * \param[in] feature_count The number of features to query. + * \param[in] features The list of features to query. + * \param[out] feature_enabled A list of values indicating + * whether the feature is enabled. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerGetFeatureEnables( + VdpVideoMixer mixer, + uint32_t feature_count, + VdpVideoMixerFeature const * features, + /* output parameters follow */ + VdpBool * feature_enables +); + +/** + * \brief Retrieve parameter values given at creation time. + * \param[in] mixer The mixer to manipulate. + * \param[in] parameter_count The number of parameters to query. + * \param[in] parameters The list of parameters to query. + * \param[out] parameter_values The list of current values for + * the parameters. Note that each entry in the value array is a pointer to + * storage that will receive the actual value. If the attribute's type is + * a pointer itself, please closely read the documentation for that + * attribute type for any other data passing requirements. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerGetParameterValues( + VdpVideoMixer mixer, + uint32_t parameter_count, + VdpVideoMixerParameter const * parameters, + /* output parameters follow */ + void * const * parameter_values +); + +/** + * \brief Retrieve current attribute values. + * \param[in] mixer The mixer to manipulate. + * \param[in] attribute_count The number of attributes to query. + * \param[in] attributes The list of attributes to query. + * \param[out] attribute_values The list of current values for + * the attributes. Note that each entry in the value array is a pointer to + * storage that will receive the actual value. If the attribute's type is + * a pointer itself, please closely read the documentation for that + * attribute type for any other data passing requirements. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerGetAttributeValues( + VdpVideoMixer mixer, + uint32_t attribute_count, + VdpVideoMixerAttribute const * attributes, + /* output parameters follow */ + void * const * attribute_values +); + +/** + * \brief Destroy a VdpVideoMixer. + * \param[in] device The device to destroy. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpVideoMixerDestroy( + VdpVideoMixer mixer +); + +/** + * \hideinitializer + * \brief The structure of the picture present in a \ref + * VdpVideoSurface "VdpVideoSurface". + */ +typedef enum { + /** + * The picture is a field, and is the top field of the surface. + */ + VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD, + /** + * The picture is a field, and is the bottom field of the + * surface. + */ + VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD, + /** + * The picture is a frame, and hence is the entire surface. + */ + VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME, +} VdpVideoMixerPictureStructure; + +#define VDP_LAYER_VERSION 0 + +/** + * \brief Definition of an additional \ref VdpOutputSurface + * "VdpOutputSurface" layer in the composting model. + */ +typedef struct { + /** + * This field must be filled with VDP_LAYER_VERSION + */ + uint32_t struct_version; + /** + * The surface to composite from. + */ + VdpOutputSurface source_surface; + /** + * The sub-rectangle of the source surface to use. If NULL, the + * entire source surface will be used. + */ + VdpRect const * source_rect; + /** + * The sub-rectangle of the destination surface to map + * this layer into. This rectangle is relative to the entire + * destination surface. This rectangle will be clipped by \ref + * VdpVideoMixerRender's \b destination_rect. If NULL, the + * destination rectangle will be sized to match the source + * rectangle, and will be located at the origin. + */ + VdpRect const * destination_rect; +} VdpLayer; + +/** + * \brief Perform a video post-processing and compositing + * operation. + * \param[in] mixer The mixer object that will perform the + * mixing/rendering operation. + * \param[in] background_surface A background image. If set to any value other + * than VDP_INVALID_HANDLE, the specific surface will be used instead of + * the background color as the first layer in the mixer's compositing + * process. + * \param[in] background_source_rect When background_surface is specified, + * this parameter indicates the portion of background_surface that will + * be used as the background layer. The specified region will be + * extracted and scaled to match the size of destination_rect. If NULL, + * the entire background_surface will be used. + * \param[in] current_picture_structure The picture structure of + * the field/frame to be processed. This field/frame is + * presented in the \b video_surface_current parameter. If + * frame, then all \b video_surface_* parameters are + * assumed to be frames. If field, then all + * video_surface_* parameters are assumed to be fields, + * with alternating top/bottom-ness derived from + * video_surface_current. + * \param[in] video_surfaces_past_count The number of provided + * fields/frames prior to the current picture. + * \param[in] video_surfaces_past The fields/frames prior to the + * current field/frame. Note that array index 0 is the + * field/frame temporally nearest to the current + * field/frame, with increasing array indices used for + * older frames. Unavailable entries may be set to + * \ref VDP_INVALID_HANDLE. + * \param[in] video_surface_current The field/frame to be + * processed. + * \param[in] video_surfaces_future_count The number of provided + * fields/frames following the current picture. + * \param[in] video_surfaces_future The fields/frames that + * follow the current field/frame. Note that array index 0 + * is the field/frame temporally nearest to the current + * field/frame, with increasing array indices used for + * newer frames. Unavailable entries may be set to \ref + * VDP_INVALID_HANDLE. + * \param[in] video_source_rect The sub-rectangle of the source + * video surface to extract and process. If NULL, the + * entire surface will be used. + * \param[in] destination_surface + * \param[in] destination_rect The sub-rectangle of the + * destination surface to modify. Note that rectangle clips + * all other actions. + * \param[in] destination_video_rect The sub-rectangle of the + * destination surface that will contain the processed + * video. This rectangle is relative to the entire + * destination surface. This rectangle is clipped by \b + * destination_rect. If NULL, the destination rectangle + * will be sized to match the source rectangle, and will + * be located at the origin. + * \param[in] layer_count The number of additional layers to + * composite above the video. + * \param[in] layers The array of additional layers to composite + * above the video. + * \return VdpStatus The completion status of the operation. + * + * For a complete discussion of how to use this API, please see + * \ref video_mixer_usage. + */ +typedef VdpStatus VdpVideoMixerRender( + VdpVideoMixer mixer, + VdpOutputSurface background_surface, + VdpRect const * background_source_rect, + VdpVideoMixerPictureStructure current_picture_structure, + uint32_t video_surface_past_count, + VdpVideoSurface const * video_surface_past, + VdpVideoSurface video_surface_current, + uint32_t video_surface_future_count, + VdpVideoSurface const * video_surface_future, + VdpRect const * video_source_rect, + VdpOutputSurface destination_surface, + VdpRect const * destination_rect, + VdpRect const * destination_video_rect, + uint32_t layer_count, + VdpLayer const * layers +); + +/*@}*/ + +/** + * \defgroup VdpPresentationQueue VdpPresentationQueue; Video \ + * presentation (display) object + * + * The VdpPresentationQueue manages a queue of surfaces and + * associated timestamps. For each surface in the queue, once + * the associated timestamp is reached, the surface is displayed + * to the user. This timestamp-based approach yields high + * quality video delivery. + * + * The exact location of the displayed content is Window System + * specific. For this reason, the \ref api_winsys provides an + * API to create a \ref VdpPresentationQueueTarget object (e.g. + * via \ref VdpPresentationQueueTargetCreateX11) which + * encapsulates this information. + * + * Note that the presentation queue performs no scaling of + * surfaces to match the display target's size, aspect ratio, + * etc. + * + * Surfaces that are too large to fit into the display target + * will be clipped. Surfaces that are too small to fill the + * display target will be aligned to the top-left corner of the + * display target, with the balance of the display target being + * filled with a constant configurable "background" color. + * + * Note that the presentation queue operates in a manner that is + * semantically equivalent to an overlay surface, with any + * required color key painting hidden internally. However, + * implementations are free to use whatever semantically + * equivalent technique they wish. Note that implementations + * that actually use color-keyed overlays will typically use + * the "background" color as the overlay color key value, so + * this color should be chosen with care. + * + * @{ + */ + +/** + * \brief The representation of a point in time. + * + * VdpTime timestamps are intended to be a high-precision timing + * system, potentially independent from any other time domain in + * the system. + * + * Time is represented in units of nanoseconds. The origin + * (i.e. the time represented by a value of 0) is implementation + * dependent. + */ +typedef uint64_t VdpTime; + +/** + * \brief An opaque handle representing the location where + * video will be presented. + * + * VdpPresentationQueueTarget are created using a \ref api_winsys + * specific API, such as \ref + * VdpPresentationQueueTargetCreateX11. + */ +typedef uint32_t VdpPresentationQueueTarget; + +/** + * \brief Destroy a VdpPresentationQueueTarget. + * \param[in] presentation_queue_target The target to destroy. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpPresentationQueueTargetDestroy( + VdpPresentationQueueTarget presentation_queue_target +); + +/** + * \brief An opaque handle representing a presentation queue + * object. + */ +typedef uint32_t VdpPresentationQueue; + +/** + * \brief Create a VdpPresentationQueue. + * \param[in] device The device that will contain the queue. + * \param[in] presentation_queue_target The location to display + * the content. + * \param[out] presentation_queue The new queue's handle. + * \return VdpStatus The completion status of the operation. + * + * Note: The initial value for the background color will be set to + * an implementation-defined value. + */ +typedef VdpStatus VdpPresentationQueueCreate( + VdpDevice device, + VdpPresentationQueueTarget presentation_queue_target, + /* output parameters follow */ + VdpPresentationQueue * presentation_queue +); + +/** + * \brief Destroy a VdpPresentationQueue. + * \param[in] presentation_queue The queue to destroy. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpPresentationQueueDestroy( + VdpPresentationQueue presentation_queue +); + +/** + * \brief Configure the background color setting. + * \param[in] presentation_queue The queue to manipulate. + * \param[in] background_color The new background color. + * + * Note: Implementations may choose whether to apply the + * new background color value immediately, or defer it until + * the next surface is presented. + */ +typedef VdpStatus VdpPresentationQueueSetBackgroundColor( + VdpPresentationQueue presentation_queue, + VdpColor * const background_color +); + +/** + * \brief Retrieve the current background color setting. + * \param[in] presentation_queue The queue to query. + * \param[out] background_color The current background color. + */ +typedef VdpStatus VdpPresentationQueueGetBackgroundColor( + VdpPresentationQueue presentation_queue, + VdpColor * background_color +); + +/** + * \brief Retrieve the presentation queue's "current" time. + * \param[in] presentation_queue The queue to query. + * \param[out] current_time The current time, which may + * represent a point between display VSYNC events. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpPresentationQueueGetTime( + VdpPresentationQueue presentation_queue, + /* output parameters follow */ + VdpTime * current_time +); + +/** + * \brief Enter a surface into the presentation queue. + * \param[in] presentation_queue The queue to query. + * \param[in] surface The surface to enter into the queue. + * \param[in] clip_width If set to a non-zero value, the presentation queue + * will display only clip_width pixels of the surface (anchored to the + * top-left corner of the surface. + * \param[in] clip_height If set to a non-zero value, the presentation queue + * will display only clip_height lines of the surface (anchored to the + * top-left corner of the surface. + * \param[in] earliest_presentation_time The timestamp + * associated with the surface. The presentation queue + * will not display the surface until the presentation + * queue's current time is at least this value. + * \return VdpStatus The completion status of the operation. + * + * Applications may choose to allow resizing of the presentation queue target + * (which may be e.g. a regular Window when using an X11-based + * implementation). + * + * \b clip_width and \b clip_height may be used to limit the size of the + * displayed region of a surface, in order to match the specific region that + * was rendered to. + * + * In turn, this allows the application to allocate over-sized (e.g. + * screen-sized) surfaces, but render to a region that matches the current + * size of the video window. + * + * Using this technique, an application's response to window resizing may + * simply be to render to, and display, a different region of the surface, + * rather than de-/re-allocation of surfaces to match the updated window size. + */ +typedef VdpStatus VdpPresentationQueueDisplay( + VdpPresentationQueue presentation_queue, + VdpOutputSurface surface, + uint32_t clip_width, + uint32_t clip_height, + VdpTime earliest_presentation_time +); + +/** + * \brief Wait for a surface to finish being displayed. + * \param[in] presentation_queue The queue to query. + * \param[in] surface The surface to wait for. + * \param[out] first_presentation_time The timestamp of the + * VSYNC at which this surface was first displayed. Note + * that 0 means the surface was never displayed. + * \return VdpStatus The completion status of the operation. + * + * Note that this API will block indefinitely if queried about + * the surface most recently added to a presentation queue, + * since there is no other surface that could possibly replace + * the queried surface. + */ +typedef VdpStatus VdpPresentationQueueBlockUntilSurfaceIdle( + VdpPresentationQueue presentation_queue, + VdpOutputSurface surface, + /* output parameters follow */ + VdpTime * first_presentation_time +); + +/** + * \hideinitializer + * \brief The status of a surface within a presentation queue. + */ +typedef enum { + /** The surface is no queued or currently visible. */ + VDP_PRESENTATION_QUEUE_STATUS_IDLE, + /** The surface is in the queue, and not currently visible. */ + VDP_PRESENTATION_QUEUE_STATUS_QUEUED, + /** The surface is the currently visible surface. */ + VDP_PRESENTATION_QUEUE_STATUS_VISIBLE, +} VdpPresentationQueueStatus; + +/** + * \brief Poll the current queue status of a surface. + * \param[in] presentation_queue The queue to query. + * \param[in] surface The surface to query. + * \param[out] status The current status of the surface within + * the queue. + * \param[out] first_presentation_time The timestamp of the + * VSYNC at which this surface was first displayed. Note + * that 0 means the surface was never displayed. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpPresentationQueueQuerySurfaceStatus( + VdpPresentationQueue presentation_queue, + VdpOutputSurface surface, + /* output parameters follow */ + VdpPresentationQueueStatus * status, + VdpTime * first_presentation_time +); + +/*@}*/ + +/** + * \defgroup display_preemption Display Preemption + * + * The Window System may operate within a frame-work (such as + * Linux's VT switching) where the display is shared between the + * Window System (e.g. X) and some other output mechanism (e.g. + * the VT.) Given this scenario, the Window System's control of + * the display could be preempted, and restored, at any time. + * + * VDPAU does not mandate that implementations hide such + * preemptions from VDPAU client applications; doing so may + * impose extreme burdens upon VDPAU implementations. Equally, + * however, implementations are free to hide such preemptions + * from client applications. + * + * VDPAU allows implementations to inform the client application + * when such a preemption has occurred, and then refuse to + * continue further operation. + * + * Similarly, some form of fatal hardware error could prevent further + * operation of the VDPAU implementation, without a complete + * re-initialization. + * + * The following discusses the behavior of implementations that + * choose not to hide preemption from client applications. + * + * When preemption occurs, VDPAU internally destroys all + * objects; the client application need not do this. However, if + * the client application wishes to continue operation, it must + * recreate all objects that it uses. It is probable that this + * recreation will not succeed until the display ownership is + * restored to the Window System. + * + * Once preemption has occurred, all VDPAU entry points will + * return the specific error code \ref + * VDP_STATUS_DISPLAY_PREEMPTED. + * + * VDPAU client applications may also be notified of such + * preemptions and fatal errors via a callback. See \ref + * VdpPreemptionCallbackRegister for more details. + * + * @{ + */ + +/** + * \brief A callback to notify the client application that a + * device's display has been preempted. + * \param[in] device The device that had its display preempted. + * \param[in] context The client-supplied callback context + * information. + * \return void No return value + */ +typedef void VdpPreemptionCallback( + VdpDevice device, + void * context +); + +/** + * \brief Configure the display preemption callback. + * \param[in] device The device to be monitored for preemption. + * \param[in] callback The client application's callback + * function. If NULL, the callback is unregistered. + * \param[in] context The client-supplied callback context + * information. This information will be passed to the + * callback function if/when invoked. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpPreemptionCallbackRegister( + VdpDevice device, + VdpPreemptionCallback callback, + void * context +); + +/*@}*/ + +/** + * \defgroup get_proc_address Entry Point Retrieval + * + * In order to facilitate multiple implementations of VDPAU + * co-existing within a single process, all functionality is + * available via function pointers. The mechanism to retrieve + * those function pointers is described below. + * + * @{ + */ + +/** + * \brief A type suitable for \ref VdpGetProcAddress + * "VdpGetProcAddress"'s \b function_id parameter. + */ +typedef uint32_t VdpFuncId; + +/** \hideinitializer */ +#define VDP_FUNC_ID_GET_ERROR_STRING (VdpFuncId)0 +/** \hideinitializer */ +#define VDP_FUNC_ID_GET_PROC_ADDRESS (VdpFuncId)1 +/** \hideinitializer */ +#define VDP_FUNC_ID_GET_API_VERSION (VdpFuncId)2 +/** \hideinitializer */ +#define VDP_FUNC_ID_GET_INFORMATION_STRING (VdpFuncId)4 +/** \hideinitializer */ +#define VDP_FUNC_ID_DEVICE_DESTROY (VdpFuncId)5 +/** \hideinitializer */ +#define VDP_FUNC_ID_GENERATE_CSC_MATRIX (VdpFuncId)6 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES (VdpFuncId)7 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES (VdpFuncId)8 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_CREATE (VdpFuncId)9 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_DESTROY (VdpFuncId)10 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS (VdpFuncId)11 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR (VdpFuncId)12 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR (VdpFuncId)13 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES (VdpFuncId)14 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES (VdpFuncId)15 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES (VdpFuncId)16 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES (VdpFuncId)17 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_CREATE (VdpFuncId)18 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY (VdpFuncId)19 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS (VdpFuncId)20 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE (VdpFuncId)21 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE (VdpFuncId)22 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED (VdpFuncId)23 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR (VdpFuncId)24 +/** \hideinitializer */ +#define VDP_FUNC_ID_BITMAP_SURFACE_QUERY_CAPABILITIES (VdpFuncId)25 +/** \hideinitializer */ +#define VDP_FUNC_ID_BITMAP_SURFACE_CREATE (VdpFuncId)26 +/** \hideinitializer */ +#define VDP_FUNC_ID_BITMAP_SURFACE_DESTROY (VdpFuncId)27 +/** \hideinitializer */ +#define VDP_FUNC_ID_BITMAP_SURFACE_GET_PARAMETERS (VdpFuncId)28 +/** \hideinitializer */ +#define VDP_FUNC_ID_BITMAP_SURFACE_PUT_BITS_NATIVE (VdpFuncId)29 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE (VdpFuncId)33 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE (VdpFuncId)34 +/** \hideinitializer */ +#define VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA (VdpFuncId)35 +/** \hideinitializer */ +#define VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES (VdpFuncId)36 +/** \hideinitializer */ +#define VDP_FUNC_ID_DECODER_CREATE (VdpFuncId)37 +/** \hideinitializer */ +#define VDP_FUNC_ID_DECODER_DESTROY (VdpFuncId)38 +/** \hideinitializer */ +#define VDP_FUNC_ID_DECODER_GET_PARAMETERS (VdpFuncId)39 +/** \hideinitializer */ +#define VDP_FUNC_ID_DECODER_RENDER (VdpFuncId)40 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT (VdpFuncId)41 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT (VdpFuncId)42 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT (VdpFuncId)43 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE (VdpFuncId)44 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE (VdpFuncId)45 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_CREATE (VdpFuncId)46 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES (VdpFuncId)47 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES (VdpFuncId)48 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT (VdpFuncId)49 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES (VdpFuncId)50 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES (VdpFuncId)51 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES (VdpFuncId)52 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_DESTROY (VdpFuncId)53 +/** \hideinitializer */ +#define VDP_FUNC_ID_VIDEO_MIXER_RENDER (VdpFuncId)54 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY (VdpFuncId)55 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE (VdpFuncId)56 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY (VdpFuncId)57 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR (VdpFuncId)58 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR (VdpFuncId)59 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME (VdpFuncId)62 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY (VdpFuncId)63 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE (VdpFuncId)64 +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS (VdpFuncId)65 +/** \hideinitializer */ +#define VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER (VdpFuncId)66 + +#define VDP_FUNC_ID_BASE_WINSYS 0x1000 + +/** + * \brief Retrieve a VDPAU function pointer. + * \param[in] device The device that the function will operate + * against. + * \param[in] function_id The specific function to retrieve. + * \param[out] function_pointer The actual pointer for the + * application to call. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpGetProcAddress( + VdpDevice device, + VdpFuncId function_id, + /* output parameters follow */ + void * * function_pointer +); + +/*@}*/ +/*@}*/ + +/** + * \defgroup api_winsys Window System Integration Layer + * + * The set of VDPAU functionality specific to an individual + * Windowing System. + */ + +#ifdef __cplusplus +} +#endif + +#endif + diff -Nru ffmpeg-0.5.2/debian/include/vdpau/vdpau_x11.h ffmpeg-0.5+svn20090706/debian/include/vdpau/vdpau_x11.h --- ffmpeg-0.5.2/debian/include/vdpau/vdpau_x11.h 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/include/vdpau/vdpau_x11.h 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,174 @@ +/* + * This source file is documented using Doxygen markup. + * See http://www.stack.nl/~dimitri/doxygen/ + */ + +/* + * This copyright notice applies to this header file: + * + * Copyright (c) 2008 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file vdpau_x11.h + * \brief X11 Window System Integration Layer + * + * This file contains the \ref api_winsys_x11 "X11 Window System + * Integration Layer". + */ + +#ifndef _VDPAU_X11_H +#define _VDPAU_X11_H + +#include +#include "vdpau.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup api_winsys + * @{ + */ + +/** + * \defgroup api_winsys_x11 X11 Window System Integration Layer + * + * The set of VDPAU functionality specific to usage with the X + * Window System. + * + * \section Driver Library Layout + * + * An X11-oriented VDPAU installation consists of the following + * components: + * + * - Header files. These files are located in the standard + * system header file path. + * - \c vdpau/vdpau.h + * - \c vdpau/vdpau_x11.h + * - The VDPAU wrapper library. These files are located in the + * standard system (possibly X11-specific) library path. + * - \c libvdpau.so.1 (runtime) + * - \c libvdpau.so (development) + * - Back-end driver files. These files are located in the + * standard system (possibly X11-specific) library path. + * - \c libvdpau_\%s.so + * For example: + * - \c libvdpau_nvidia.so + * - \c libvdpau_intel.so + * - \c libvdpau_ati.so + * + * The VDPAU wrapper library implements just one function; \ref + * vdp_device_create_x11. The wrapper will implement this function + * by dynamically loading the appropriate back-end driver file + * mentioned above. Long-term, the wrapper will use a + * VDPAU-specific X extension to determine which back-end driver + * to load. Currently, the wrapper library hard-codes the driver + * name as "nvidia", although this can be overridden using the + * environment variable VDPAU_DRIVER. + * + * The back-end driver is expected to implement a function named + * \b vdp_imp_device_create_x11. The wrapper will call this function to + * actually implement the \ref vdp_device_create_x11 application call. + * + * Note that it is theoretically possible for an application to + * create multiple \ref VdpDevice "VdpDevice" objects. In this + * case, the wrapper library may load multiple back-end drivers + * into the same application, and/or invoke a specific back-end + * driver's \b VdpImpDeviceCreateX11 multiple times. The wrapper + * libray imposes no policy regarding whether the application + * may instantiate multiple \ref VdpDevice "VdpDevice" objects for + * the same display and/or screen. However, back-end drivers are + * free to limit the number of \ref VdpDevice "VdpDevice" objects + * as required by their implementation. + * + * @{ + */ + +/** + * \brief Create a VdpDevice object for use with X11. + * \param[in] display The X Display that the VdpDevice VdpDevice + * will operate against. + * \param[in] screen The X screen that the VdpDevice will operate + * against. + * \param[out] device The new device's handle. + * \param[out] get_proc_address The get_proc_address entry point + * to use with this device. + * \return VdpStatus The completion status of the operation. + */ +typedef VdpStatus VdpDeviceCreateX11( + Display * display, + int screen, + /* output parameters follow */ + VdpDevice * device, + VdpGetProcAddress * * get_proc_address +); + +/** + * \brief Create a VdpDevice object for use with X11. + * This is an actual symbol of type \ref VdpDeviceCreateX11 + * + */ +VdpDeviceCreateX11 vdp_device_create_x11; + +/** + * \brief Create a VdpPresentationQueueTarget for use with X11. + * \param[in] device The device that will contain the queue + * target. + * \param[in] drawable The X11 Drawable that the presentation + * queue will present into. + * \param[out] target The new queue target's handle. + * \return VdpStatus The completion status of the operation. + * + * Note: VDPAU expects to own the entire drawable for the duration of time + * that the presentation queue target exists. In particular, + * implementations may choose to manipulate client-visible X11 window state + * as required. As such, it is recommended that applications create a + * dedicated window for the presentation queue target, as a child + * (grand-child, ...) of their top-level application window. + * + * Applications may also create child-windows of the presentation queue + * target, which will cover any presented video in the normal fashion. VDPAU + * implementations will not manipulate such child windows in any fashion. + */ +typedef VdpStatus VdpPresentationQueueTargetCreateX11( + VdpDevice device, + Drawable drawable, + /* output parameters follow */ + VdpPresentationQueueTarget * target +); + +/** \hideinitializer */ +#define VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 (VdpFuncId)(VDP_FUNC_ID_BASE_WINSYS + 0) + +/*@}*/ +/*@}*/ + +#ifdef __cplusplus +} +#endif + +#endif + diff -Nru ffmpeg-0.5.2/debian/libavcodec52.lintian-overrides ffmpeg-0.5+svn20090706/debian/libavcodec52.lintian-overrides --- ffmpeg-0.5.2/debian/libavcodec52.lintian-overrides 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/libavcodec52.lintian-overrides 2010-08-17 20:14:38.000000000 -0500 @@ -1,3 +1,3 @@ # Overriding these fpic lintian errors. Please see bug #528080. -libavcodec52: shlib-with-non-pic-code usr/lib/i686/cmov/libavcodec.so.52.20.1 -libavcodec52: shlib-with-non-pic-code usr/lib/libavcodec.so.52.20.1 +libavcodec52: shlib-with-non-pic-code usr/lib/i686/cmov/libavcodec.so.52.20.0 +libavcodec52: shlib-with-non-pic-code usr/lib/libavcodec.so.52.20.0 diff -Nru ffmpeg-0.5.2/debian/patches/100_kfreebsd ffmpeg-0.5+svn20090706/debian/patches/100_kfreebsd --- ffmpeg-0.5.2/debian/patches/100_kfreebsd 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/100_kfreebsd 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,16 @@ +From: Aurelien Jarno +Subject: [PATCH] Fix FTBFS for kfreebsd +X-Upstream-Discussion: + +========================================================================== +--- a/configure ++++ b/configure +@@ -1649,6 +1649,8 @@ case $target_os in + interix) + disable vhook + ;; ++ gnu/kfreebsd) ++ ;; + + *) + die "Unknown OS '$target_os'." diff -Nru ffmpeg-0.5.2/debian/patches/900_doxyfile ffmpeg-0.5+svn20090706/debian/patches/900_doxyfile --- ffmpeg-0.5.2/debian/patches/900_doxyfile 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/patches/900_doxyfile 2010-08-17 20:14:38.000000000 -0500 @@ -1,7 +1,4 @@ -Author: Reinhard Tartler - Exclude some directories we use for packaging. - ========================================================================== --- a/Doxyfile +++ b/Doxyfile diff -Nru ffmpeg-0.5.2/debian/patches/901-fix-misc-typos.patch ffmpeg-0.5+svn20090706/debian/patches/901-fix-misc-typos.patch --- ffmpeg-0.5.2/debian/patches/901-fix-misc-typos.patch 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/patches/901-fix-misc-typos.patch 1969-12-31 18:00:00.000000000 -0600 @@ -1,45 +0,0 @@ -From: stefano -Date: Wed, 27 Jan 2010 00:31:52 +0000 (+0000) -Subject: Fix misc typos, patch by -X-Git-Url: http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff_plain;h=ba4f92903641af2f11d47d1ee845a62abfd5dd38 - -Fix misc typos, patch by -Fabian Greffrath base64_decode(PGZhYmlhbkBncmVmZnJhdGguY29tPg==). - - -git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21473 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b ---- - ---- ffmpeg.orig/libavcodec/mjpegdec.c -+++ ffmpeg/libavcodec/mjpegdec.c -@@ -967,7 +967,7 @@ - } - - if(s->avctx->debug & FF_DEBUG_PICT_INFO) -- av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d ilv:%d bits:%d %s\n", s->lossless ? "lossless" : "sequencial DCT", s->rgb ? "RGB" : "", -+ av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d ilv:%d bits:%d %s\n", s->lossless ? "lossless" : "sequential DCT", s->rgb ? "RGB" : "", - predictor, point_transform, ilv, s->bits, - s->pegasus_rct ? "PRCT" : (s->rct ? "RCT" : "")); - ---- ffmpeg.orig/libavcodec/opt.c -+++ ffmpeg/libavcodec/opt.c -@@ -424,7 +424,7 @@ - break; - case FF_OPT_TYPE_INT64: - if((double)(opt->default_val+0.6) == opt->default_val) -- av_log(s, AV_LOG_DEBUG, "loss of precission in default of %s\n", opt->name); -+ av_log(s, AV_LOG_DEBUG, "loss of precision in default of %s\n", opt->name); - av_set_int(s, opt->name, opt->default_val); - break; - case FF_OPT_TYPE_FLOAT: { ---- ffmpeg.orig/libavcodec/options.c -+++ ffmpeg/libavcodec/options.c -@@ -156,7 +156,7 @@ - {"very", "strictly conform to a older more strict version of the spec or reference software", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_VERY_STRICT, INT_MIN, INT_MAX, V|D|E, "strict"}, - {"strict", "strictly conform to all the things in the spec no matter what consequences", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_STRICT, INT_MIN, INT_MAX, V|D|E, "strict"}, - {"normal", NULL, 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_NORMAL, INT_MIN, INT_MAX, V|D|E, "strict"}, --{"inofficial", "allow inofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_INOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"}, -+{"inofficial", "allow unofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_INOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"}, - {"experimental", "allow non standardized experimental things", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_EXPERIMENTAL, INT_MIN, INT_MAX, V|D|E, "strict"}, - {"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E}, - {"er", "set error detection aggressivity", OFFSET(error_recognition), FF_OPT_TYPE_INT, FF_ER_CAREFUL, INT_MIN, INT_MAX, A|V|D, "er"}, diff -Nru ffmpeg-0.5.2/debian/patches/aac-regression.patch ffmpeg-0.5+svn20090706/debian/patches/aac-regression.patch --- ffmpeg-0.5.2/debian/patches/aac-regression.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/aac-regression.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,220 @@ +fix aac playback regression + +patch taken from upstream svn: + +------------------------------------------------------------------------ +r17856 | alexc | 2009-03-06 20:47:01 +0100 (Fr, 06. Mär 2009) | 3 lines + +Fix the channel allocation bug/assumption (issue 800). +Approved by Rob on IRC. + +------------------------------------------------------------------------ +r17860 | alexc | 2009-03-06 23:36:24 +0100 (Fr, 06. Mär 2009) | 2 lines + +If we get an error from ff_aac_parse_header() we should not trust the +header info that it provides. + +------------------------------------------------------------------------ +r17861 | alexc | 2009-03-06 23:37:21 +0100 (Fr, 06. Mär 2009) | 2 lines + +Re-indent after last commit. + +------------------------------------------------------------------------ + +diff --git a/libavcodec/aac.c b/libavcodec/aac.c +index 80195c0..b6759dd 100644 +--- a/libavcodec/aac.c ++++ b/libavcodec/aac.c +@@ -97,6 +97,56 @@ static VLC vlc_scalefactors; + static VLC vlc_spectral[11]; + + ++static ChannelElement* get_che(AACContext *ac, int type, int elem_id) { ++ static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0 }; ++ if (ac->tag_che_map[type][elem_id]) { ++ return ac->tag_che_map[type][elem_id]; ++ } ++ if (ac->tags_mapped >= tags_per_config[ac->m4ac.chan_config]) { ++ return NULL; ++ } ++ switch (ac->m4ac.chan_config) { ++ case 7: ++ if (ac->tags_mapped == 3 && type == TYPE_CPE) { ++ ac->tags_mapped++; ++ return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2]; ++ } ++ case 6: ++ /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1] ++ instead of SCE[0] CPE[0] CPE[0] LFE[0]. If we seem to have ++ encountered such a stream, transfer the LFE[0] element to SCE[1] */ ++ if (ac->tags_mapped == tags_per_config[ac->m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { ++ ac->tags_mapped++; ++ return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0]; ++ } ++ case 5: ++ if (ac->tags_mapped == 2 && type == TYPE_CPE) { ++ ac->tags_mapped++; ++ return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1]; ++ } ++ case 4: ++ if (ac->tags_mapped == 2 && ac->m4ac.chan_config == 4 && type == TYPE_SCE) { ++ ac->tags_mapped++; ++ return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1]; ++ } ++ case 3: ++ case 2: ++ if (ac->tags_mapped == (ac->m4ac.chan_config != 2) && type == TYPE_CPE) { ++ ac->tags_mapped++; ++ return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0]; ++ } else if (ac->m4ac.chan_config == 2) { ++ return NULL; ++ } ++ case 1: ++ if (!ac->tags_mapped && type == TYPE_SCE) { ++ ac->tags_mapped++; ++ return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0]; ++ } ++ default: ++ return NULL; ++ } ++} ++ + /** + * Configure output channel order based on the current program configuration element. + * +@@ -106,7 +156,7 @@ static VLC vlc_spectral[11]; + * @return Returns error status. 0 - OK, !0 - error + */ + static int output_configure(AACContext *ac, enum ChannelPosition che_pos[4][MAX_ELEM_ID], +- enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]) { ++ enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], int channel_config) { + AVCodecContext *avctx = ac->avccontext; + int i, type, channels = 0; + +@@ -140,7 +190,16 @@ static int output_configure(AACContext *ac, enum ChannelPosition che_pos[4][MAX_ + } + } + ++ if (channel_config) { ++ memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); ++ ac->tags_mapped = 0; ++ } else { ++ memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); ++ ac->tags_mapped = 4*MAX_ELEM_ID; ++ } ++ + avctx->channels = channels; ++ + return 0; + } + +@@ -286,7 +345,7 @@ static int decode_ga_specific_config(AACContext * ac, GetBitContext * gb, int ch + if((ret = set_default_channel_config(ac, new_che_pos, channel_config))) + return ret; + } +- if((ret = output_configure(ac, ac->che_pos, new_che_pos))) ++ if((ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config))) + return ret; + + if (extension_flag) { +@@ -394,7 +453,7 @@ static av_cold int aac_decode_init(AVCodecContext * avccontext) { + memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); + if(set_default_channel_config(ac, new_che_pos, avccontext->channels - (avccontext->channels == 8))) + return -1; +- if(output_configure(ac, ac->che_pos, new_che_pos)) ++ if(output_configure(ac, ac->che_pos, new_che_pos, 1)) + return -1; + ac->m4ac.sample_rate = avccontext->sample_rate; + } else { +@@ -1538,19 +1597,20 @@ static int parse_adts_frame_header(AACContext * ac, GetBitContext * gb) { + ac->m4ac.sample_rate = hdr_info.sample_rate; + ac->m4ac.sampling_index = hdr_info.sampling_index; + ac->m4ac.object_type = hdr_info.object_type; +- } +- if (hdr_info.num_aac_frames == 1) { +- if (!hdr_info.crc_absent) +- skip_bits(gb, 16); +- } else { +- ff_log_missing_feature(ac->avccontext, "More than one AAC RDB per ADTS frame is", 0); +- return -1; ++ if (hdr_info.num_aac_frames == 1) { ++ if (!hdr_info.crc_absent) ++ skip_bits(gb, 16); ++ } else { ++ ff_log_missing_feature(ac->avccontext, "More than one AAC RDB per ADTS frame is", 0); ++ return -1; ++ } + } + return size; + } + + static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, const uint8_t * buf, int buf_size) { + AACContext * ac = avccontext->priv_data; ++ ChannelElement * che = NULL; + GetBitContext gb; + enum RawDataBlockType elem_type; + int err, elem_id, data_size_tmp; +@@ -1573,15 +1633,7 @@ static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data + elem_id = get_bits(&gb, 4); + err = -1; + +- if(elem_type == TYPE_SCE && elem_id == 1 && +- !ac->che[TYPE_SCE][elem_id] && ac->che[TYPE_LFE][0]) { +- /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1] +- instead of SCE[0] CPE[0] CPE[0] LFE[0]. If we seem to have +- encountered such a stream, transfer the LFE[0] element to SCE[1] */ +- ac->che[TYPE_SCE][elem_id] = ac->che[TYPE_LFE][0]; +- ac->che[TYPE_LFE][0] = NULL; +- } +- if(elem_type < TYPE_DSE && !ac->che[elem_type][elem_id]) { ++ if(elem_type < TYPE_DSE && !(che=get_che(ac, elem_type, elem_id))) { + av_log(ac->avccontext, AV_LOG_ERROR, "channel element %d.%d is not allocated\n", elem_type, elem_id); + return -1; + } +@@ -1589,19 +1641,19 @@ static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data + switch (elem_type) { + + case TYPE_SCE: +- err = decode_ics(ac, &ac->che[TYPE_SCE][elem_id]->ch[0], &gb, 0, 0); ++ err = decode_ics(ac, &che->ch[0], &gb, 0, 0); + break; + + case TYPE_CPE: +- err = decode_cpe(ac, &gb, ac->che[TYPE_CPE][elem_id]); ++ err = decode_cpe(ac, &gb, che); + break; + + case TYPE_CCE: +- err = decode_cce(ac, &gb, ac->che[TYPE_CCE][elem_id]); ++ err = decode_cce(ac, &gb, che); + break; + + case TYPE_LFE: +- err = decode_ics(ac, &ac->che[TYPE_LFE][elem_id]->ch[0], &gb, 0, 0); ++ err = decode_ics(ac, &che->ch[0], &gb, 0, 0); + break; + + case TYPE_DSE: +@@ -1615,7 +1667,7 @@ static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data + memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); + if((err = decode_pce(ac, new_che_pos, &gb))) + break; +- err = output_configure(ac, ac->che_pos, new_che_pos); ++ err = output_configure(ac, ac->che_pos, new_che_pos, 0); + break; + } + + Modified libavcodec/aac.h +diff --git a/libavcodec/aac.h b/libavcodec/aac.h +index 66b2e22..32e7224 100644 +--- a/libavcodec/aac.h ++++ b/libavcodec/aac.h +@@ -260,6 +260,8 @@ typedef struct { + * first index as the first 4 raw data block types + */ + ChannelElement * che[4][MAX_ELEM_ID]; ++ ChannelElement * tag_che_map[4][MAX_ELEM_ID]; ++ int tags_mapped; + /** @} */ + + /** diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue03.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue03.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue03.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue03.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,295 @@ +Description: check stream existence before assignment +Origin: upstream, ffmpeg 0.5: r21709 +Origin: upstream, ffmpeg 0.5: r21710 + +diff -Nur ffmpeg-0.5+svn20090706/libavformat/mov.c ffmpeg-0.5+svn20090706.new/libavformat/mov.c +--- ffmpeg-0.5+svn20090706/libavformat/mov.c 2009-03-01 11:06:26.000000000 -0500 ++++ ffmpeg-0.5+svn20090706.new/libavformat/mov.c 2010-04-07 10:15:36.000000000 -0400 +@@ -238,10 +238,15 @@ + + static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + int entries, i, j; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_be32(pb); // version + flags + entries = get_be32(pb); + if (entries >= UINT_MAX / sizeof(*sc->drefs)) +@@ -381,9 +386,13 @@ + + static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; + int tag, len; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ + get_be32(pb); /* version + flags */ + len = mp4_read_descr(c, pb, &tag); + if (tag == MP4ESDescrTag) { +@@ -440,7 +449,12 @@ + { + const int num = get_be32(pb); + const int den = get_be32(pb); +- AVStream * const st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ + if (den != 0) { + if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default + (den != st->sample_aspect_ratio.den || num != st->sample_aspect_ratio.num)) +@@ -494,12 +508,18 @@ + + static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; +- int version = get_byte(pb); ++ AVStream *st; ++ MOVStreamContext *sc; ++ int version; + char language[4] = {0}; + unsigned lang; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ ++ version = get_byte(pb); + if (version > 1) + return -1; /* unsupported */ + +@@ -561,7 +581,11 @@ + + static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; + + if((uint64_t)atom.size > (1<<30)) + return -1; +@@ -581,9 +605,14 @@ + + static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- int little_endian = get_be16(pb); ++ AVStream *st; ++ int little_endian; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ ++ little_endian = get_be16(pb); + dprintf(c->fc, "enda %d\n", little_endian); + if (little_endian == 1) { + switch (st->codec->codec_id) { +@@ -633,7 +662,11 @@ + + static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; + + if((uint64_t)atom.size > (1<<30)) + return -1; +@@ -660,7 +693,11 @@ + */ + static int mov_read_glbl(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; + + if((uint64_t)atom.size > (1<<30)) + return -1; +@@ -676,10 +713,15 @@ + + static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + +@@ -742,10 +784,15 @@ + + static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + int j, entries, pseudo_stream_id; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + +@@ -1064,10 +1111,15 @@ + + static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + +@@ -1092,10 +1144,15 @@ + + static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + +@@ -1119,10 +1176,15 @@ + + static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries, sample_size; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + +@@ -1150,12 +1212,17 @@ + + static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + int64_t duration=0; + int64_t total_sample_count=0; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + entries = get_be32(pb); +@@ -1194,10 +1261,15 @@ + + static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + entries = get_be32(pb); +@@ -1504,10 +1576,16 @@ + int height; + int64_t disp_transform[2]; + int display_matrix[3][2]; +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = st->priv_data; +- int version = get_byte(pb); ++ AVStream *st; ++ MOVStreamContext *sc; ++ int version; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = st->priv_data; ++ ++ version = get_byte(pb); + get_be24(pb); /* flags */ + /* + MOV_TRACK_ENABLED 0x0001 +@@ -1776,9 +1854,13 @@ + /* edit list atom */ + static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom) + { +- MOVStreamContext *sc = c->fc->streams[c->fc->nb_streams-1]->priv_data; ++ MOVStreamContext *sc; + int i, edit_count; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ sc = c->fc->streams[c->fc->nb_streams-1]->priv_data; ++ + get_byte(pb); /* version */ + get_be24(pb); /* flags */ + edit_count = get_be32(pb); /* entries */ diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue04.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue04.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue04.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue04.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,29 @@ +Description: check submap indexes +Origin: upstream, ffmpeg 0.5.1: r21730 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2009-01-31 21:00:19.000000000 -0500 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:15:52.000000000 -0400 +@@ -723,9 +723,20 @@ + } + + for(j=0;jsubmaps;++j) { ++ int bits; + skip_bits(gb, 8); // FIXME check? +- mapping_setup->submap_floor[j]=get_bits(gb, 8); +- mapping_setup->submap_residue[j]=get_bits(gb, 8); ++ bits=get_bits(gb, 8); ++ if (bits>=vc->floor_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "submap floor value %d out of range. \n", bits); ++ return -1; ++ } ++ mapping_setup->submap_floor[j]=bits; ++ bits=get_bits(gb, 8); ++ if (bits>=vc->residue_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "submap residue value %d out of range. \n", bits); ++ return -1; ++ } ++ mapping_setup->submap_residue[j]=bits; + + AV_DEBUG(" %d mapping %d submap : floor %d, residue %d \n", i, j, mapping_setup->submap_floor[j], mapping_setup->submap_residue[j]); + } diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue05.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue05.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue05.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue05.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,17 @@ +Description: check classbook value +Origin: upstream, ffmpeg 0.5.1: r21725 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:16:01.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:16:05.000000000 -0400 +@@ -636,6 +636,10 @@ + res_setup->partition_size=get_bits(gb, 24)+1; + res_setup->classifications=get_bits(gb, 6)+1; + res_setup->classbook=get_bits(gb, 8); ++ if (res_setup->classbook>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "classbook value %d out of range. \n", res_setup->classbook); ++ return 1; ++ } + + AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size, + res_setup->classifications, res_setup->classbook); diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue06.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue06.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue06.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue06.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,31 @@ +Description: Add checks for per-packet mode indexes and per-header mode + mapping indexes. +Origin: upstream, ffmpeg 0.5.1: r21726 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:16:13.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:16:17.000000000 -0400 +@@ -803,7 +803,11 @@ + mode_setup->blockflag=get_bits1(gb); + mode_setup->windowtype=get_bits(gb, 16); //FIXME check + mode_setup->transformtype=get_bits(gb, 16); //FIXME check +- mode_setup->mapping=get_bits(gb, 8); //FIXME check ++ mode_setup->mapping=get_bits(gb, 8); ++ if (mode_setup->mapping>=vc->mapping_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "mode mapping value %d out of range. \n", mode_setup->mapping); ++ return 1; ++ } + + AV_DEBUG(" %d mode: blockflag %d, windowtype %d, transformtype %d, mapping %d \n", i, mode_setup->blockflag, mode_setup->windowtype, mode_setup->transformtype, mode_setup->mapping); + } +@@ -1463,6 +1467,10 @@ + } else { + mode_number=get_bits(gb, ilog(vc->mode_count-1)); + } ++ if (mode_number>=vc->mode_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "mode number %d out of range.\n", mode_number); ++ return -1; ++ } + vc->mode_number=mode_number; + mapping=&vc->mappings[vc->modes[mode_number].mapping]; + diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue07.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue07.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue07.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue07.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,32 @@ +Description: Check masterbook index and subclass book index. +Origin: upstream, ffmpeg 0.5.1: r21727 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:16:40.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:16:46.000000000 -0400 +@@ -492,13 +492,23 @@ + AV_DEBUG(" %d floor %d class dim: %d subclasses %d \n", i, j, floor_setup->data.t1.class_dimensions[j], floor_setup->data.t1.class_subclasses[j]); + + if (floor_setup->data.t1.class_subclasses[j]) { +- floor_setup->data.t1.class_masterbook[j]=get_bits(gb, 8); ++ int bits=get_bits(gb, 8); ++ if (bits>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "Masterbook index %d is out of range.\n", bits); ++ return 1; ++ } ++ floor_setup->data.t1.class_masterbook[j]=bits; + + AV_DEBUG(" masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]); + } + + for(k=0;k<(1<data.t1.class_subclasses[j]);++k) { +- floor_setup->data.t1.subclass_books[j][k]=(int16_t)get_bits(gb, 8)-1; ++ int16_t bits=get_bits(gb, 8)-1; ++ if (bits!=-1 && bits>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "Subclass book index %d is out of range.\n", bits); ++ return 1; ++ } ++ floor_setup->data.t1.subclass_books[j][k]=bits; + + AV_DEBUG(" book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]); + } diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue08.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue08.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue08.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue08.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,20 @@ +Description: Check res_setup->books. +Origin: upstream, ffmpeg 0.5.1: r21728 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:17:14.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:17:22.000000000 -0400 +@@ -669,7 +669,12 @@ + for(j=0;jclassifications;++j) { + for(k=0;k<8;++k) { + if (cascade[j]&(1<books[j][k]=get_bits(gb, 8); ++ int bits=get_bits(gb, 8); ++ if (bits>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "book value %d out of range. \n", bits); ++ return 1; ++ } ++ res_setup->books[j][k]=bits; + + AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]); + diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue09.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue09.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue09.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue09.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,29 @@ +Description: Check begin/end/partition_size. +Origin: upstream, ffmpeg 0.5.1: r21729 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:17:34.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:17:39.000000000 -0400 +@@ -37,6 +37,7 @@ + #define V_NB_BITS 8 + #define V_NB_BITS2 11 + #define V_MAX_VLCS (1<<16) ++#define V_MAX_PARTITIONS (1<<20) + + #ifndef V_DEBUG + #define AV_DEBUG(...) +@@ -644,6 +645,14 @@ + res_setup->begin=get_bits(gb, 24); + res_setup->end=get_bits(gb, 24); + res_setup->partition_size=get_bits(gb, 24)+1; ++ /* Validations to prevent a buffer overflow later. */ ++ if (res_setup->begin>res_setup->end ++ || res_setup->end>vc->blocksize[1]/(res_setup->type==2?1:2) ++ || (res_setup->end-res_setup->begin)/res_setup->partition_size>V_MAX_PARTITIONS) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %d, %d, %d, %d, %d\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1]/2); ++ return 1; ++ } ++ + res_setup->classifications=get_bits(gb, 6)+1; + res_setup->classbook=get_bits(gb, 8); + if (res_setup->classbook>=vc->codebook_count) { diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue10.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue10.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue10.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue10.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,25 @@ +Description: Check validity of channels & samplerate. +Origin: upstream, ffmpeg 0.5.1: r22658 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:18:18.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:18:28.000000000 -0400 +@@ -896,8 +896,16 @@ + } + + vc->version=get_bits_long(gb, 32); //FIXME check 0 +- vc->audio_channels=get_bits(gb, 8); //FIXME check >0 +- vc->audio_samplerate=get_bits_long(gb, 32); //FIXME check >0 ++ vc->audio_channels=get_bits(gb, 8); ++ if(vc->audio_channels <= 0){ ++ av_log(vc->avccontext, AV_LOG_ERROR, "Invalid number of channels\n"); ++ return -1; ++ } ++ vc->audio_samplerate=get_bits_long(gb, 32); ++ if(vc->audio_samplerate <= 0){ ++ av_log(vc->avccontext, AV_LOG_ERROR, "Invalid samplerate\n"); ++ return -1; ++ } + vc->bitrate_maximum=get_bits_long(gb, 32); + vc->bitrate_nominal=get_bits_long(gb, 32); + vc->bitrate_minimum=get_bits_long(gb, 32); diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue11.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue11.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue11.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue11.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,21 @@ +Description: Fix book_idx check. +Origin: upstream, ffmpeg 0.5.1: r21724 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:18:42.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:18:47.000000000 -0400 +@@ -569,12 +569,11 @@ + uint_fast8_t book_idx; + for (idx=0;idxdata.t0.num_books;++idx) { + book_idx=get_bits(gb, 8); ++ if (book_idx>=vc->codebook_count) ++ return 1; + floor_setup->data.t0.book_list[idx]=book_idx; + if (vc->codebooks[book_idx].dimensions > max_codebook_dim) + max_codebook_dim=vc->codebooks[book_idx].dimensions; +- +- if (floor_setup->data.t0.book_list[idx]>vc->codebook_count) +- return 1; + } + } + diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue12.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue12.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue12.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue12.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,22 @@ +Description: Sanity checks for magnitude and angle. +Origin: upstream, ffmpeg 0.5.1: r21723 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:19:02.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:19:07.000000000 -0400 +@@ -729,7 +729,14 @@ + for(j=0;jcoupling_steps;++j) { + mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1)); + mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1)); +- // FIXME: sanity checks ++ if (mapping_setup->magnitude[j]>=vc->audio_channels) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "magnitude channel %d out of range. \n", mapping_setup->magnitude[j]); ++ return 1; ++ } ++ if (mapping_setup->angle[j]>=vc->audio_channels) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "angle channel %d out of range. \n", mapping_setup->angle[j]); ++ return 1; ++ } + } + } else { + mapping_setup->coupling_steps=0; diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue13.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue13.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue13.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue13.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,15 @@ +Description: fix = -> == typo. +Origin: upstream, ffmpeg 0.5.1: r21722 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:19:25.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:19:29.000000000 -0400 +@@ -1553,7 +1553,7 @@ + uint_fast8_t ch=0; + + for(j=0;jaudio_channels;++j) { +- if ((mapping->submaps==1) || (i=mapping->mux[j])) { ++ if ((mapping->submaps==1) || (i==mapping->mux[j])) { + res_chan[j]=res_num; + if (no_residue[j]) { + do_not_decode[ch]=1; diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue14.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue14.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue14.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue14.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,17 @@ +Description: Check dimensions against 0 too. +Origin: upstream, ffmpeg 0.5.1: r21721 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c +--- ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2010-04-07 10:19:40.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vorbis_dec.c 2010-04-07 10:19:44.000000000 -0400 +@@ -250,8 +250,8 @@ + } + + codebook_setup->dimensions=get_bits(gb, 16); +- if (codebook_setup->dimensions>16) { +- av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is too large (%d). \n", cb, codebook_setup->dimensions); ++ if (codebook_setup->dimensions>16||codebook_setup->dimensions==0) { ++ av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is invalid (%d). \n", cb, codebook_setup->dimensions); + goto error; + } + entries=get_bits(gb, 24); diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue15.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue15.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue15.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue15.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,15 @@ +Description: Fix init_get_bits() buffer size. +Origin: upstream, ffmpeg 0.5.1: r21719 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vp3.c ffmpeg-0.5+svn20090706.new/libavcodec/vp3.c +--- ffmpeg-0.5+svn20090706/libavcodec/vp3.c 2009-02-22 08:48:55.000000000 -0500 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vp3.c 2010-04-07 10:20:02.000000000 -0400 +@@ -2231,7 +2231,7 @@ + } + + for(i=0;i<3;i++) { +- init_get_bits(&gb, header_start[i], header_len[i]); ++ init_get_bits(&gb, header_start[i], header_len[i] * 8); + + ptype = get_bits(&gb, 8); + diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue17.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue17.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue17.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue17.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,39 @@ +Description: Make sure that all memory allocations succeed. +Origin: upstream, ffmpeg 0.5.1: r21720 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/vp3.c ffmpeg-0.5+svn20090706.new/libavcodec/vp3.c +--- ffmpeg-0.5+svn20090706/libavcodec/vp3.c 2010-04-07 10:20:41.000000000 -0400 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/vp3.c 2010-04-07 10:20:45.000000000 -0400 +@@ -43,6 +43,8 @@ + + #define FRAGMENT_PIXELS 8 + ++static av_cold int vp3_decode_end(AVCodecContext *avctx); ++ + typedef struct Coeff { + struct Coeff *next; + DCTELEM coeff; +@@ -1684,6 +1686,11 @@ + s->coeffs = av_malloc(s->fragment_count * sizeof(Coeff) * 65); + s->coded_fragment_list = av_malloc(s->fragment_count * sizeof(int)); + s->pixel_addresses_initialized = 0; ++ if (!s->superblock_coding || !s->all_fragments || !s->coeff_counts || ++ !s->coeffs || !s->coded_fragment_list) { ++ vp3_decode_end(avctx); ++ return -1; ++ } + + if (!s->theora_tables) + { +@@ -1784,6 +1791,11 @@ + s->superblock_macroblocks = av_malloc(s->superblock_count * 4 * sizeof(int)); + s->macroblock_fragments = av_malloc(s->macroblock_count * 6 * sizeof(int)); + s->macroblock_coding = av_malloc(s->macroblock_count + 1); ++ if (!s->superblock_fragments || !s->superblock_macroblocks || ++ !s->macroblock_fragments || !s->macroblock_coding) { ++ vp3_decode_end(avctx); ++ return -1; ++ } + init_block_mapping(s); + + for (i = 0; i < 3; i++) { diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue18.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue18.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue18.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue18.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,39 @@ +Description: Fix possible buffer over-read in vorbis_comment +Origin: upstream, ffmpeg 0.5.1: r21711 + +diff -Nur ffmpeg-0.5+svn20090706/libavformat/oggparsevorbis.c ffmpeg-0.5+svn20090706.new/libavformat/oggparsevorbis.c +--- ffmpeg-0.5+svn20090706/libavformat/oggparsevorbis.c 2009-02-12 16:39:37.000000000 -0500 ++++ ffmpeg-0.5+svn20090706.new/libavformat/oggparsevorbis.c 2010-04-07 10:21:15.000000000 -0400 +@@ -35,27 +35,28 @@ + { + const uint8_t *p = buf; + const uint8_t *end = buf + size; +- unsigned s, n, j; ++ unsigned n, j; ++ int s; + + if (size < 8) /* must have vendor_length and user_comment_list_length */ + return -1; + + s = bytestream_get_le32(&p); + +- if (end - p < s) ++ if (end - p - 4 < s || s < 0) + return -1; + + p += s; + + n = bytestream_get_le32(&p); + +- while (p < end && n > 0) { ++ while (end - p >= 4 && n > 0) { + const char *t, *v; + int tl, vl; + + s = bytestream_get_le32(&p); + +- if (end - p < s) ++ if (end - p < s || s < 0) + break; + + t = p; diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue19.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue19.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue19.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue19.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,15 @@ +Description: Set data_size to 0 to avoid having it uninitialized. +Origin: upstream, ffmpeg 0.5.1: r21718 + +diff -Nur ffmpeg-0.5+svn20090706/libavcodec/mpegaudiodec.c ffmpeg-0.5+svn20090706.new/libavcodec/mpegaudiodec.c +--- ffmpeg-0.5+svn20090706/libavcodec/mpegaudiodec.c 2009-02-22 08:48:55.000000000 -0500 ++++ ffmpeg-0.5+svn20090706.new/libavcodec/mpegaudiodec.c 2010-04-07 10:24:46.000000000 -0400 +@@ -2287,6 +2287,8 @@ + avctx->bit_rate = s->bit_rate; + avctx->sub_id = s->layer; + ++ *data_size = 0; ++ + if(s->frame_size<=0 || s->frame_size > buf_size){ + av_log(avctx, AV_LOG_ERROR, "incomplete frame\n"); + return -1; diff -Nru ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue20.patch ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue20.patch --- ffmpeg-0.5.2/debian/patches/CVE-2009-46XX/security-issue20.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/CVE-2009-46XX/security-issue20.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,24 @@ +Description: Disable parsing for ogg streams where no ogg header was found +Origin: upstream, ffmpeg 0.5.1: r21708 + +diff -Nur ffmpeg-0.5+svn20090706/libavformat/oggdec.c ffmpeg-0.5+svn20090706.new/libavformat/oggdec.c +--- ffmpeg-0.5+svn20090706/libavformat/oggdec.c 2009-02-14 08:44:21.000000000 -0500 ++++ ffmpeg-0.5+svn20090706.new/libavformat/oggdec.c 2010-04-07 10:27:37.000000000 -0400 +@@ -477,12 +477,17 @@ + ogg_read_header (AVFormatContext * s, AVFormatParameters * ap) + { + struct ogg *ogg = s->priv_data; ++ int i; + ogg->curidx = -1; + //linear headers seek from start + if (ogg_get_headers (s) < 0){ + return -1; + } + ++ for (i = 0; i < ogg->nstreams; i++) ++ if (ogg->streams[i].header < 0) ++ ogg->streams[i].codec = NULL; ++ + //linear granulepos seek from end + ogg_get_length (s); + diff -Nru ffmpeg-0.5.2/debian/patches/ffmpeg-debian_hurd.patch ffmpeg-0.5+svn20090706/debian/patches/ffmpeg-debian_hurd.patch --- ffmpeg-0.5.2/debian/patches/ffmpeg-debian_hurd.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/ffmpeg-debian_hurd.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,14 @@ +Fix build failures for the GNU Hurd OS +=================================================================== +--- a/configure ++++ b/configure +@@ -1651,6 +1651,9 @@ case $target_os in + ;; + gnu/kfreebsd) + ;; ++ gnu) ++ disable dv1394 ++ ;; + + *) + die "Unknown OS '$target_os'." diff -Nru ffmpeg-0.5.2/debian/patches/fix-dv-seeking.patch ffmpeg-0.5+svn20090706/debian/patches/fix-dv-seeking.patch --- ffmpeg-0.5.2/debian/patches/fix-dv-seeking.patch 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/patches/fix-dv-seeking.patch 2010-08-17 20:14:38.000000000 -0500 @@ -1,5 +1,3 @@ -Author: Reinhard Tartler - fix seeking in DIF (DV) movies, closes Bug: #540424 Thanks to Dan Dennedy for identifying the patch! diff -Nru ffmpeg-0.5.2/debian/patches/fpic-ftbfs-fix.patch ffmpeg-0.5+svn20090706/debian/patches/fpic-ftbfs-fix.patch --- ffmpeg-0.5.2/debian/patches/fpic-ftbfs-fix.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/fpic-ftbfs-fix.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,262 @@ +This patch fixes FTBFS issue when using -fPIC. +For inquiries about this patch, please see bug #528080. +========================================================================== +--- a/libavcodec/x86/dsputil_mmx.c ++++ b/libavcodec/x86/dsputil_mmx.c +@@ -695,14 +695,14 @@ + "punpckhdq %%mm1, %%mm1 \n\t" + "movd %%mm1, %3 \n\t" + +- : "=m" (*(uint32_t*)(dst + 0*dst_stride)), +- "=m" (*(uint32_t*)(dst + 1*dst_stride)), +- "=m" (*(uint32_t*)(dst + 2*dst_stride)), +- "=m" (*(uint32_t*)(dst + 3*dst_stride)) +- : "m" (*(uint32_t*)(src + 0*src_stride)), +- "m" (*(uint32_t*)(src + 1*src_stride)), +- "m" (*(uint32_t*)(src + 2*src_stride)), +- "m" (*(uint32_t*)(src + 3*src_stride)) ++ : "=r" (*(uint32_t*)(dst + 0*dst_stride)), ++ "=r" (*(uint32_t*)(dst + 1*dst_stride)), ++ "=r" (*(uint32_t*)(dst + 2*dst_stride)), ++ "=r" (*(uint32_t*)(dst + 3*dst_stride)) ++ : "r" (*(uint32_t*)(src + 0*src_stride)), ++ "r" (*(uint32_t*)(src + 1*src_stride)), ++ "r" (*(uint32_t*)(src + 2*src_stride)), ++ "r" (*(uint32_t*)(src + 3*src_stride)) + ); + } + +--- a/libavcodec/x86/h264dsp_mmx.c ++++ b/libavcodec/x86/h264dsp_mmx.c +@@ -943,8 +943,8 @@ + \ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ +- "movq %5, %%mm4 \n\t"\ +- "movq %6, %%mm5 \n\t"\ ++ "movq ff_pw_5, %%mm4 \n\t"\ ++ "movq ff_pw_16, %%mm5 \n\t"\ + "1: \n\t"\ + "movd -1(%0), %%mm1 \n\t"\ + "movd (%0), %%mm2 \n\t"\ +@@ -974,17 +974,15 @@ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(src), "+c"(dst), "+g"(h)\ +- : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\ +- : "memory"\ ++ : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\ + );\ + }\ + static av_noinline void OPNAME ## h264_qpel4_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=4;\ + __asm__ volatile(\ +- "pxor %%mm7, %%mm7 \n\t"\ +- "movq %0, %%mm4 \n\t"\ +- "movq %1, %%mm5 \n\t"\ +- :: "m"(ff_pw_5), "m"(ff_pw_16)\ ++ "pxor %mm7, %mm7 \n\t"\ ++ "movq ff_pw_5, %mm4 \n\t"\ ++ "movq ff_pw_16, %mm5 \n\t"\ + );\ + do{\ + __asm__ volatile(\ +@@ -1117,7 +1115,7 @@ + int h=8;\ + __asm__ volatile(\ + "pxor %%mm7, %%mm7 \n\t"\ +- "movq %5, %%mm6 \n\t"\ ++ "movq ff_pw_5, %%mm6 \n\t"\ + "1: \n\t"\ + "movq (%0), %%mm0 \n\t"\ + "movq 1(%0), %%mm2 \n\t"\ +@@ -1151,7 +1149,7 @@ + "punpcklbw %%mm7, %%mm5 \n\t"\ + "paddw %%mm3, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ +- "movq %6, %%mm5 \n\t"\ ++ "movq ff_pw_16, %%mm5 \n\t"\ + "paddw %%mm5, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ +@@ -1165,17 +1163,15 @@ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(src), "+c"(dst), "+g"(h)\ +- : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\ +- : "memory"\ ++ : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\ + );\ + }\ + \ + static av_noinline void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=8;\ + __asm__ volatile(\ +- "pxor %%mm7, %%mm7 \n\t"\ +- "movq %0, %%mm6 \n\t"\ +- :: "m"(ff_pw_5)\ ++ "pxor %mm7, %mm7 \n\t"\ ++ "movq ff_pw_5, %mm6 \n\t"\ + );\ + do{\ + __asm__ volatile(\ +@@ -1211,7 +1207,7 @@ + "punpcklbw %%mm7, %%mm5 \n\t"\ + "paddw %%mm3, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ +- "movq %5, %%mm5 \n\t"\ ++ "movq ff_pw_16, %%mm5 \n\t"\ + "paddw %%mm5, %%mm2 \n\t"\ + "paddw %%mm5, %%mm4 \n\t"\ + "paddw %%mm2, %%mm0 \n\t"\ +@@ -1226,9 +1222,7 @@ + "add %4, %1 \n\t"\ + "add %3, %2 \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2)\ +- : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\ +- "m"(ff_pw_16)\ +- : "memory"\ ++ : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\ + );\ + }while(--h);\ + }\ +@@ -1494,8 +1488,8 @@ + int h=16;\ + __asm__ volatile(\ + "pxor %%xmm15, %%xmm15 \n\t"\ +- "movdqa %6, %%xmm14 \n\t"\ +- "movdqa %7, %%xmm13 \n\t"\ ++ "movdqa ff_pw_5, %%xmm14 \n\t"\ ++ "movdqa ff_pw_16, %%xmm13 \n\t"\ + "1: \n\t"\ + "lddqu 3(%0), %%xmm1 \n\t"\ + "lddqu -5(%0), %%xmm7 \n\t"\ +@@ -1549,9 +1543,7 @@ + "decl %3 \n\t"\ + "jg 1b \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2), "+g"(h)\ +- : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\ +- "m"(ff_pw_5), "m"(ff_pw_16)\ +- : "memory"\ ++ : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\ + );\ + } + #else // ARCH_X86_64 +@@ -1571,9 +1563,8 @@ + static av_noinline void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\ + int h=8;\ + __asm__ volatile(\ +- "pxor %%xmm7, %%xmm7 \n\t"\ +- "movdqa %0, %%xmm6 \n\t"\ +- :: "m"(ff_pw_5)\ ++ "pxor %xmm7, %xmm7 \n\t"\ ++ "movdqa ff_pw_5, %xmm6 \n\t"\ + );\ + do{\ + __asm__ volatile(\ +@@ -1596,7 +1587,7 @@ + "psllw $2, %%xmm2 \n\t"\ + "movq (%2), %%xmm3 \n\t"\ + "psubw %%xmm1, %%xmm2 \n\t"\ +- "paddw %5, %%xmm5 \n\t"\ ++ "paddw ff_pw_16,%%xmm5 \n\t"\ + "pmullw %%xmm6, %%xmm2 \n\t"\ + "paddw %%xmm5, %%xmm2 \n\t"\ + "psraw $5, %%xmm2 \n\t"\ +@@ -1607,9 +1598,7 @@ + "add %4, %1 \n\t"\ + "add %3, %2 \n\t"\ + : "+a"(src), "+c"(dst), "+d"(src2)\ +- : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\ +- "m"(ff_pw_16)\ +- : "memory"\ ++ : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\ + );\ + }while(--h);\ + }\ +@@ -1619,7 +1608,7 @@ + int h=8;\ + __asm__ volatile(\ + "pxor %%xmm7, %%xmm7 \n\t"\ +- "movdqa %5, %%xmm6 \n\t"\ ++ "movdqa ff_pw_5, %%xmm6 \n\t"\ + "1: \n\t"\ + "lddqu -5(%0), %%xmm1 \n\t"\ + "movdqa %%xmm1, %%xmm0 \n\t"\ +@@ -1639,7 +1628,7 @@ + "paddw %%xmm4, %%xmm1 \n\t"\ + "psllw $2, %%xmm2 \n\t"\ + "psubw %%xmm1, %%xmm2 \n\t"\ +- "paddw %6, %%xmm5 \n\t"\ ++ "paddw ff_pw_16, %%xmm5 \n\t"\ + "pmullw %%xmm6, %%xmm2 \n\t"\ + "paddw %%xmm5, %%xmm2 \n\t"\ + "psraw $5, %%xmm2 \n\t"\ +@@ -1650,9 +1639,7 @@ + "decl %2 \n\t"\ + " jnz 1b \n\t"\ + : "+a"(src), "+c"(dst), "+g"(h)\ +- : "D"((x86_reg)srcStride), "S"((x86_reg)dstStride),\ +- "m"(ff_pw_5), "m"(ff_pw_16)\ +- : "memory"\ ++ : "D"((x86_reg)srcStride), "S"((x86_reg)dstStride)\ + );\ + }\ + static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ +--- a/libavcodec/x86/flacdsp_mmx.c ++++ b/libavcodec/x86/flacdsp_mmx.c +@@ -89,12 +89,12 @@ + "movsd "MANGLE(ff_pd_1)", %%xmm1 \n\t" + "movsd "MANGLE(ff_pd_1)", %%xmm2 \n\t" + "1: \n\t" +- "movapd (%4,%0), %%xmm3 \n\t" +- "movupd -8(%5,%0), %%xmm4 \n\t" +- "movapd (%5,%0), %%xmm5 \n\t" ++ "movapd (%2,%0), %%xmm3 \n\t" ++ "movupd -8(%3,%0), %%xmm4 \n\t" ++ "movapd (%3,%0), %%xmm5 \n\t" + "mulpd %%xmm3, %%xmm4 \n\t" + "mulpd %%xmm3, %%xmm5 \n\t" +- "mulpd -16(%5,%0), %%xmm3 \n\t" ++ "mulpd -16(%3,%0), %%xmm3 \n\t" + "addpd %%xmm4, %%xmm1 \n\t" + "addpd %%xmm5, %%xmm0 \n\t" + "addpd %%xmm3, %%xmm2 \n\t" +@@ -107,9 +107,9 @@ + "addsd %%xmm4, %%xmm1 \n\t" + "addsd %%xmm5, %%xmm2 \n\t" + "movsd %%xmm0, %1 \n\t" +- "movsd %%xmm1, %2 \n\t" +- "movsd %%xmm2, %3 \n\t" +- :"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1]), "=m"(autoc[j+2]) ++ "movsd %%xmm1, 8%1 \n\t" ++ "movsd %%xmm2, 16%1 \n\t" ++ :"+&r"(i), "=m"(autoc[j]) + :"r"(data1+len), "r"(data1+len-j) + ); + } else { +@@ -117,10 +117,10 @@ + "movsd "MANGLE(ff_pd_1)", %%xmm0 \n\t" + "movsd "MANGLE(ff_pd_1)", %%xmm1 \n\t" + "1: \n\t" +- "movapd (%3,%0), %%xmm3 \n\t" +- "movupd -8(%4,%0), %%xmm4 \n\t" ++ "movapd (%2,%0), %%xmm3 \n\t" ++ "movupd -8(%3,%0), %%xmm4 \n\t" + "mulpd %%xmm3, %%xmm4 \n\t" +- "mulpd (%4,%0), %%xmm3 \n\t" ++ "mulpd (%3,%0), %%xmm3 \n\t" + "addpd %%xmm4, %%xmm1 \n\t" + "addpd %%xmm3, %%xmm0 \n\t" + "add $16, %0 \n\t" +@@ -130,8 +130,8 @@ + "addsd %%xmm3, %%xmm0 \n\t" + "addsd %%xmm4, %%xmm1 \n\t" + "movsd %%xmm0, %1 \n\t" +- "movsd %%xmm1, %2 \n\t" +- :"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1]) ++ "movsd %%xmm1, 8%1 \n\t" ++ :"+&r"(i), "=m"(autoc[j]) + :"r"(data1+len), "r"(data1+len-j) + ); + } diff -Nru ffmpeg-0.5.2/debian/patches/fpic-libpostproc-fix.patch ffmpeg-0.5+svn20090706/debian/patches/fpic-libpostproc-fix.patch --- ffmpeg-0.5.2/debian/patches/fpic-libpostproc-fix.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/fpic-libpostproc-fix.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,315 @@ +This patch resolves all non-PIC issues from the libpostproc library. +For inquiries about this patch, please see bug #528080. +========================================================================== +--- a/libpostproc/postprocess_template.c ++++ b/libpostproc/postprocess_template.c +@@ -369,16 +369,16 @@ + // FIXME rounding + __asm__ volatile( + "pxor %%mm7, %%mm7 \n\t" // 0 +- "movq "MANGLE(b80)", %%mm6 \n\t" // MIN_SIGNED_BYTE ++ "movq %2, %%mm6 \n\t" // MIN_SIGNED_BYTE + "leal (%0, %1), %%"REG_a" \n\t" + "leal (%%"REG_a", %1, 4), %%"REG_c" \n\t" + // 0 1 2 3 4 5 6 7 8 9 + // %0 eax eax+%1 eax+2%1 %0+4%1 ecx ecx+%1 ecx+2%1 %0+8%1 ecx+4%1 +- "movq "MANGLE(pQPb)", %%mm0 \n\t" // QP,..., QP ++ "movq %3, %%mm0 \n\t" // QP,..., QP + "movq %%mm0, %%mm1 \n\t" // QP,..., QP +- "paddusb "MANGLE(b02)", %%mm0 \n\t" ++ "paddusb %4, %%mm0 \n\t" + "psrlw $2, %%mm0 \n\t" +- "pand "MANGLE(b3F)", %%mm0 \n\t" // QP/4,..., QP/4 ++ "pand %5, %%mm0 \n\t" // QP/4,..., QP/4 + "paddusb %%mm1, %%mm0 \n\t" // QP*1.25 ... + "movq (%0, %1, 4), %%mm2 \n\t" // line 4 + "movq (%%"REG_c"), %%mm3 \n\t" // line 5 +@@ -407,8 +407,8 @@ + + "paddb %%mm6, %%mm5 \n\t" + "psrlw $2, %%mm5 \n\t" +- "pand "MANGLE(b3F)", %%mm5 \n\t" +- "psubb "MANGLE(b20)", %%mm5 \n\t" // (l5-l4)/8 ++ "pand %5, %%mm5 \n\t" ++ "psubb %6, %%mm5 \n\t" // (l5-l4)/8 + + "movq (%%"REG_a", %1, 2), %%mm2 \n\t" + "paddb %%mm6, %%mm2 \n\t" // line 3 + 0x80 +@@ -423,7 +423,8 @@ + "movq %%mm2, (%%"REG_c", %1) \n\t" + + : +- : "r" (src), "r" ((x86_reg)stride) ++ : "r" (src), "r" ((x86_reg)stride), "m"(b80), "m"(pQPb), "m"(b02), ++ "m"(b3f), "m"(b20) + : "%"REG_a, "%"REG_c + ); + #else //HAVE_MMX2 || HAVE_AMD3DNOW +@@ -496,7 +497,7 @@ + "paddusb %%mm0, %%mm0 \n\t" + "psubusb %%mm0, %%mm4 \n\t" + "pcmpeqb %%mm7, %%mm4 \n\t" // d <= QP ? -1 : 0 +- "psubusb "MANGLE(b01)", %%mm3 \n\t" ++ "psubusb %3, %%mm3 \n\t" + "pand %%mm4, %%mm3 \n\t" // d <= QP ? d : 0 + + PAVGB(%%mm7, %%mm3) // d/2 +@@ -545,7 +546,7 @@ + "movq %%mm0, (%%"REG_c", %1, 2) \n\t" // line 7 + + : +- : "r" (src), "r" ((x86_reg)stride), "m" (co->pQPb) ++ : "r" (src), "r" ((x86_reg)stride), "m" (co->pQPb), "m"(b01) + : "%"REG_a, "%"REG_c + ); + #else //HAVE_MMX2 || HAVE_AMD3DNOW +@@ -675,17 +676,17 @@ + + PMINUB(%%mm2, %%mm1, %%mm4) // MIN(|lenergy|,|renergy|)/8 + "movq %2, %%mm4 \n\t" // QP //FIXME QP+1 ? +- "paddusb "MANGLE(b01)", %%mm4 \n\t" ++ "paddusb %5, %%mm4 \n\t" + "pcmpgtb %%mm3, %%mm4 \n\t" // |menergy|/8 < QP + "psubusb %%mm1, %%mm3 \n\t" // d=|menergy|/8-MIN(|lenergy|,|renergy|)/8 + "pand %%mm4, %%mm3 \n\t" + + "movq %%mm3, %%mm1 \n\t" +-// "psubusb "MANGLE(b01)", %%mm3 \n\t" ++// "psubusb %5, %%mm3 \n\t" + PAVGB(%%mm7, %%mm3) + PAVGB(%%mm7, %%mm3) + "paddusb %%mm1, %%mm3 \n\t" +-// "paddusb "MANGLE(b01)", %%mm3 \n\t" ++// "paddusb %5, %%mm3 \n\t" + + "movq (%%"REG_a", %1, 2), %%mm6 \n\t" //l3 + "movq (%0, %1, 4), %%mm5 \n\t" //l4 +@@ -698,7 +699,7 @@ + "pand %%mm0, %%mm3 \n\t" + PMINUB(%%mm5, %%mm3, %%mm0) + +- "psubusb "MANGLE(b01)", %%mm3 \n\t" ++ "psubusb %5, %%mm3 \n\t" + PAVGB(%%mm7, %%mm3) + + "movq (%%"REG_a", %1, 2), %%mm0 \n\t" +@@ -730,7 +731,7 @@ + "movq (%%"REG_a", %1), %%mm3 \n\t" // l2 + "pxor %%mm6, %%mm2 \n\t" // -l5-1 + "movq %%mm2, %%mm5 \n\t" // -l5-1 +- "movq "MANGLE(b80)", %%mm4 \n\t" // 128 ++ "movq %3, %%mm4 \n\t" // 128 + "lea (%%"REG_a", %1, 4), %%"REG_c" \n\t" + PAVGB(%%mm3, %%mm2) // (l2-l5+256)/2 + PAVGB(%%mm0, %%mm4) // ~(l4-l3)/4 + 128 +@@ -742,7 +743,7 @@ + "pxor %%mm6, %%mm2 \n\t" // -l1-1 + PAVGB(%%mm3, %%mm2) // (l2-l1+256)/2 + PAVGB((%0), %%mm1) // (l0-l3+256)/2 +- "movq "MANGLE(b80)", %%mm3 \n\t" // 128 ++ "movq %3, %%mm3 \n\t" // 128 + PAVGB(%%mm2, %%mm3) // ~(l2-l1)/4 + 128 + PAVGB(%%mm1, %%mm3) // ~(l0-l3)/4 +(l2-l1)/8 + 128 + PAVGB(%%mm2, %%mm3) // ~(l0-l3)/8 +5(l2-l1)/16 + 128 +@@ -752,14 +753,14 @@ + "movq (%%"REG_c", %1, 2), %%mm1 \n\t" // l7 + "pxor %%mm6, %%mm1 \n\t" // -l7-1 + PAVGB((%0, %1, 4), %%mm1) // (l4-l7+256)/2 +- "movq "MANGLE(b80)", %%mm2 \n\t" // 128 ++ "movq %3, %%mm2 \n\t" // 128 + PAVGB(%%mm5, %%mm2) // ~(l6-l5)/4 + 128 + PAVGB(%%mm1, %%mm2) // ~(l4-l7)/4 +(l6-l5)/8 + 128 + PAVGB(%%mm5, %%mm2) // ~(l4-l7)/8 +5(l6-l5)/16 + 128 + // mm0=128-q, mm2=renergy/16 + 128, mm3=lenergy/16 + 128, mm4= menergy/16 + 128 + +- "movq "MANGLE(b00)", %%mm1 \n\t" // 0 +- "movq "MANGLE(b00)", %%mm5 \n\t" // 0 ++ "movq %4, %%mm1 \n\t" // 0 ++ "movq %4, %%mm5 \n\t" // 0 + "psubb %%mm2, %%mm1 \n\t" // 128 - renergy/16 + "psubb %%mm3, %%mm5 \n\t" // 128 - lenergy/16 + PMAXUB(%%mm1, %%mm2) // 128 + |renergy/16| +@@ -768,7 +769,7 @@ + + // mm0=128-q, mm3=128 + MIN(|lenergy|,|renergy|)/16, mm4= menergy/16 + 128 + +- "movq "MANGLE(b00)", %%mm7 \n\t" // 0 ++ "movq %4, %%mm7 \n\t" // 0 + "movq %2, %%mm2 \n\t" // QP + PAVGB(%%mm6, %%mm2) // 128 + QP/2 + "psubb %%mm6, %%mm2 \n\t" +@@ -782,13 +783,13 @@ + // mm0=128-q, mm1= SIGN(menergy), mm2= |menergy|/16 < QP/2, mm4= d/16 + + "movq %%mm4, %%mm3 \n\t" // d +- "psubusb "MANGLE(b01)", %%mm4 \n\t" ++ "psubusb %5, %%mm4 \n\t" + PAVGB(%%mm7, %%mm4) // d/32 + PAVGB(%%mm7, %%mm4) // (d + 32)/64 + "paddb %%mm3, %%mm4 \n\t" // 5d/64 + "pand %%mm2, %%mm4 \n\t" + +- "movq "MANGLE(b80)", %%mm5 \n\t" // 128 ++ "movq %3, %%mm5 \n\t" // 128 + "psubb %%mm0, %%mm5 \n\t" // q + "paddsb %%mm6, %%mm5 \n\t" // fix bad rounding + "pcmpgtb %%mm5, %%mm7 \n\t" // SIGN(q) +@@ -810,7 +811,8 @@ + "movq %%mm2, (%0, %1, 4) \n\t" + + : +- : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb) ++ : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(b80), ++ "m"(b00), "m"(b01) + : "%"REG_a, "%"REG_c + ); + +@@ -1045,10 +1047,10 @@ + "psubusw %%mm1, %%mm5 \n\t" // ld + + +- "movq "MANGLE(w05)", %%mm2 \n\t" // 5 ++ "movq %3, %%mm2 \n\t" // 5 + "pmullw %%mm2, %%mm4 \n\t" + "pmullw %%mm2, %%mm5 \n\t" +- "movq "MANGLE(w20)", %%mm2 \n\t" // 32 ++ "movq %4, %%mm2 \n\t" // 32 + "paddw %%mm2, %%mm4 \n\t" + "paddw %%mm2, %%mm5 \n\t" + "psrlw $6, %%mm4 \n\t" +@@ -1098,7 +1100,7 @@ + "movq %%mm0, (%0, %1) \n\t" + + : "+r" (src) +- : "r" ((x86_reg)stride), "m" (c->pQPb) ++ : "r" ((x86_reg)stride), "m" (c->pQPb), "m"(w05), "m"(w20) + : "%"REG_a, "%"REG_c + ); + #else //HAVE_MMX2 || HAVE_AMD3DNOW +@@ -1237,7 +1239,7 @@ + "movq %%mm6, %%mm0 \n\t" // max + "psubb %%mm7, %%mm6 \n\t" // max - min + "movd %%mm6, %%ecx \n\t" +- "cmpb "MANGLE(deringThreshold)", %%cl \n\t" ++ "cmpb %4, %%cl \n\t" + " jb 1f \n\t" + "lea -24(%%"REG_SP"), %%"REG_c" \n\t" + "and "ALIGN_MASK", %%"REG_c" \n\t" +@@ -1264,9 +1266,9 @@ + "psubusb %%mm7, %%mm0 \n\t" + "psubusb %%mm7, %%mm2 \n\t" + "psubusb %%mm7, %%mm3 \n\t" +- "pcmpeqb "MANGLE(b00)", %%mm0 \n\t" // L10 > a ? 0 : -1 +- "pcmpeqb "MANGLE(b00)", %%mm2 \n\t" // L20 > a ? 0 : -1 +- "pcmpeqb "MANGLE(b00)", %%mm3 \n\t" // L00 > a ? 0 : -1 ++ "pcmpeqb %5, %%mm0 \n\t" // L10 > a ? 0 : -1 ++ "pcmpeqb %5, %%mm2 \n\t" // L20 > a ? 0 : -1 ++ "pcmpeqb %5, %%mm3 \n\t" // L00 > a ? 0 : -1 + "paddb %%mm2, %%mm0 \n\t" + "paddb %%mm3, %%mm0 \n\t" + +@@ -1287,9 +1289,9 @@ + "psubusb %%mm7, %%mm2 \n\t" + "psubusb %%mm7, %%mm4 \n\t" + "psubusb %%mm7, %%mm5 \n\t" +- "pcmpeqb "MANGLE(b00)", %%mm2 \n\t" // L11 > a ? 0 : -1 +- "pcmpeqb "MANGLE(b00)", %%mm4 \n\t" // L21 > a ? 0 : -1 +- "pcmpeqb "MANGLE(b00)", %%mm5 \n\t" // L01 > a ? 0 : -1 ++ "pcmpeqb %5, %%mm2 \n\t" // L11 > a ? 0 : -1 ++ "pcmpeqb %5, %%mm4 \n\t" // L21 > a ? 0 : -1 ++ "pcmpeqb %5, %%mm5 \n\t" // L01 > a ? 0 : -1 + "paddb %%mm4, %%mm2 \n\t" + "paddb %%mm5, %%mm2 \n\t" + // 0, 2, 3, 1 +@@ -1314,7 +1316,7 @@ + "psubusb " #lx ", " #t1 " \n\t"\ + "psubusb " #lx ", " #t0 " \n\t"\ + "psubusb " #lx ", " #sx " \n\t"\ +- "movq "MANGLE(b00)", " #lx " \n\t"\ ++ "movq %5, " #lx " \n\t"\ + "pcmpeqb " #lx ", " #t1 " \n\t" /* src[-1] > a ? 0 : -1*/\ + "pcmpeqb " #lx ", " #t0 " \n\t" /* src[+1] > a ? 0 : -1*/\ + "pcmpeqb " #lx ", " #sx " \n\t" /* src[0] > a ? 0 : -1*/\ +@@ -1330,8 +1332,8 @@ + PMINUB(t1, pplx, t0)\ + "paddb " #sx ", " #ppsx " \n\t"\ + "paddb " #psx ", " #ppsx " \n\t"\ +- "#paddb "MANGLE(b02)", " #ppsx " \n\t"\ +- "pand "MANGLE(b08)", " #ppsx " \n\t"\ ++ "#paddb %6, " #ppsx " \n\t"\ ++ "pand %7, " #ppsx " \n\t"\ + "pcmpeqb " #lx ", " #ppsx " \n\t"\ + "pand " #ppsx ", " #pplx " \n\t"\ + "pandn " #dst ", " #ppsx " \n\t"\ +@@ -1367,7 +1369,8 @@ + DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,%%mm6,%%mm7) + + "1: \n\t" +- : : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2) ++ : : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), ++ "m"(deringThreshold), "m"(b00), "m"(b02), "m"(b08) + : "%"REG_a, "%"REG_d, "%"REG_c + ); + #else //HAVE_MMX2 || HAVE_AMD3DNOW +@@ -2227,7 +2230,7 @@ + #else //L1_DIFF + #if defined (FAST_L2_DIFF) + "pcmpeqb %%mm7, %%mm7 \n\t" +- "movq "MANGLE(b80)", %%mm6 \n\t" ++ "movq %4, %%mm6 \n\t" + "pxor %%mm0, %%mm0 \n\t" + #define REAL_L2_DIFF_CORE(a, b)\ + "movq " #a ", %%mm5 \n\t"\ +@@ -2476,7 +2479,8 @@ + + "4: \n\t" + +- :: "r" (src), "r" (tempBlurred), "r"((x86_reg)stride), "m" (tempBlurredPast) ++ :: "r" (src), "r" (tempBlurred), "r"((x86_reg)stride), ++ "m" (tempBlurredPast), "m"(b80) + : "%"REG_a, "%"REG_d, "%"REG_c, "memory" + ); + #else //HAVE_MMX2 || HAVE_AMD3DNOW +@@ -2730,8 +2734,8 @@ + "movq %%mm6, %%mm1 \n\t" + "psllw $2, %%mm0 \n\t" + "psllw $2, %%mm1 \n\t" +- "paddw "MANGLE(w04)", %%mm0 \n\t" +- "paddw "MANGLE(w04)", %%mm1 \n\t" ++ "paddw %5, %%mm0 \n\t" ++ "paddw %5, %%mm1 \n\t" + + #define NEXT\ + "movq (%0), %%mm2 \n\t"\ +@@ -2820,7 +2824,7 @@ + "mov %4, %0 \n\t" //FIXME + + : "+&r"(src) +- : "r" ((x86_reg)step), "m" (c->pQPb), "r"(sums), "g"(src) ++ : "r" ((x86_reg)step), "m" (c->pQPb), "r"(sums), "g"(src), "m"(w04) + ); + + src+= step; // src points to begin of the 8x8 Block +@@ -3037,10 +3041,10 @@ + "psubusw %%mm1, %%mm5 \n\t" // ld + + +- "movq "MANGLE(w05)", %%mm2 \n\t" // 5 ++ "movq %4, %%mm2 \n\t" // 5 + "pmullw %%mm2, %%mm4 \n\t" + "pmullw %%mm2, %%mm5 \n\t" +- "movq "MANGLE(w20)", %%mm2 \n\t" // 32 ++ "movq %5, %%mm2 \n\t" // 32 + "paddw %%mm2, %%mm4 \n\t" + "paddw %%mm2, %%mm5 \n\t" + "psrlw $6, %%mm4 \n\t" +@@ -3092,7 +3096,8 @@ + "movq %%mm0, (%0, %1) \n\t" + + : "+r" (temp_src) +- : "r" ((x86_reg)step), "m" (c->pQPb), "m"(eq_mask) ++ : "r" ((x86_reg)step), "m" (c->pQPb), "m"(eq_mask), "m"(w05), ++ "m"(w20) + : "%"REG_a, "%"REG_c + ); + } diff -Nru ffmpeg-0.5.2/debian/patches/fpic-libswscale-fix.patch ffmpeg-0.5+svn20090706/debian/patches/fpic-libswscale-fix.patch --- ffmpeg-0.5.2/debian/patches/fpic-libswscale-fix.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/fpic-libswscale-fix.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,578 @@ +This patch is currently being worked on to resolve all non-PIC issues with +the libswscale library. +For inquiries about this patch, please see bug #528080. +========================================================================== +--- a/libswscale/rgb2rgb_template.c ++++ b/libswscale/rgb2rgb_template.c +@@ -1424,9 +1424,12 @@ + __asm__ volatile ( + "test %%"REG_a", %%"REG_a" \n\t" + "jns 2f \n\t" +- "movq "MANGLE(mask24r)", %%mm5 \n\t" +- "movq "MANGLE(mask24g)", %%mm6 \n\t" +- "movq "MANGLE(mask24b)", %%mm7 \n\t" ++ "movq %0, %%mm5 \n\t" ++ "movq %1, %%mm6 \n\t" ++ "movq %2, %%mm7 \n\t" ++ : : "m"(mask24r), "m"(mask24g), "m"(mask24b) ++ ); ++ __asm__ volatile ( + ASMALIGN(4) + "1: \n\t" + PREFETCH" 32(%1, %%"REG_a") \n\t" +@@ -2147,8 +2150,8 @@ + { + __asm__ volatile( + "mov %2, %%"REG_a" \n\t" +- "movq "MANGLE(ff_bgr2YCoeff)", %%mm6 \n\t" +- "movq "MANGLE(ff_w1111)", %%mm5 \n\t" ++ "movq %3, %%mm6 \n\t" ++ "movq %4, %%mm5 \n\t" + "pxor %%mm7, %%mm7 \n\t" + "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t" + ASMALIGN(4) +@@ -2206,12 +2209,13 @@ + "psraw $7, %%mm4 \n\t" + + "packuswb %%mm4, %%mm0 \n\t" +- "paddusb "MANGLE(ff_bgr2YOffset)", %%mm0 \n\t" ++ "paddusb %5, %%mm0 \n\t" + + MOVNTQ" %%mm0, (%1, %%"REG_a") \n\t" + "add $8, %%"REG_a" \n\t" + " js 1b \n\t" +- : : "r" (src+width*3), "r" (ydst+width), "g" (-width) ++ : : "r" (src+width*3), "r" (ydst+width), "g" (-width), ++ "m"(ff_bgr2YCoeff), "m"(ff_w1111), "m"(ff_bgr2YOffset) + : "%"REG_a, "%"REG_d + ); + ydst += lumStride; +@@ -2220,8 +2224,8 @@ + src -= srcStride*2; + __asm__ volatile( + "mov %4, %%"REG_a" \n\t" +- "movq "MANGLE(ff_w1111)", %%mm5 \n\t" +- "movq "MANGLE(ff_bgr2UCoeff)", %%mm6 \n\t" ++ "movq %5, %%mm5 \n\t" ++ "movq %6, %%mm6 \n\t" + "pxor %%mm7, %%mm7 \n\t" + "lea (%%"REG_a", %%"REG_a", 2), %%"REG_d" \n\t" + "add %%"REG_d", %%"REG_d" \n\t" +@@ -2270,8 +2274,8 @@ + "psrlw $2, %%mm0 \n\t" + "psrlw $2, %%mm2 \n\t" + #endif +- "movq "MANGLE(ff_bgr2VCoeff)", %%mm1 \n\t" +- "movq "MANGLE(ff_bgr2VCoeff)", %%mm3 \n\t" ++ "movq %7, %%mm1 \n\t" ++ "movq %7, %%mm3 \n\t" + + "pmaddwd %%mm0, %%mm1 \n\t" + "pmaddwd %%mm2, %%mm3 \n\t" +@@ -2328,12 +2332,12 @@ + "paddw %%mm1, %%mm5 \n\t" + "paddw %%mm3, %%mm2 \n\t" + "paddw %%mm5, %%mm2 \n\t" +- "movq "MANGLE(ff_w1111)", %%mm5 \n\t" ++ "movq %5, %%mm5 \n\t" + "psrlw $2, %%mm4 \n\t" + "psrlw $2, %%mm2 \n\t" + #endif +- "movq "MANGLE(ff_bgr2VCoeff)", %%mm1 \n\t" +- "movq "MANGLE(ff_bgr2VCoeff)", %%mm3 \n\t" ++ "movq %7, %%mm1 \n\t" ++ "movq %7, %%mm3 \n\t" + + "pmaddwd %%mm4, %%mm1 \n\t" + "pmaddwd %%mm2, %%mm3 \n\t" +@@ -2357,13 +2361,16 @@ + "punpckldq %%mm4, %%mm0 \n\t" + "punpckhdq %%mm4, %%mm1 \n\t" + "packsswb %%mm1, %%mm0 \n\t" +- "paddb "MANGLE(ff_bgr2UVOffset)", %%mm0 \n\t" ++ "paddb %8, %%mm0 \n\t" + "movd %%mm0, (%2, %%"REG_a") \n\t" + "punpckhdq %%mm0, %%mm0 \n\t" + "movd %%mm0, (%3, %%"REG_a") \n\t" + "add $4, %%"REG_a" \n\t" + " js 1b \n\t" +- : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth) ++ : : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), ++ "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth), ++ "m"(ff_w1111), "m"(ff_bgr2UCoeff), "m"(ff_bgr2VCoeff), ++ "m"(ff_bgr2UVOffset) + : "%"REG_a, "%"REG_d + ); + +--- a/libswscale/rgb2rgb.c ++++ b/libswscale/rgb2rgb.c +@@ -123,6 +123,18 @@ + DECLARE_ASM_CONST(8, uint64_t, red_15mask) = 0x00007c0000007c00ULL; + DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL; + DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; ++ ++// Some constants from swscale.c that are used here ++extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2YCoeff; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2UCoeff; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2VCoeff; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2YOffset; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_bgr2UVOffset; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_w1111; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_M24A; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_M24B; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_M24C; ++ + #endif /* ARCH_X86 */ + + #define RGB2YUV_SHIFT 8 +--- a/libswscale/swscale_template.c ++++ b/libswscale/swscale_template.c +@@ -669,9 +669,9 @@ + #define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) + + #define REAL_WRITERGB16(dst, dstw, index) \ +- "pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\ +- "pand "MANGLE(bFC)", %%mm4 \n\t" /* G */\ +- "pand "MANGLE(bF8)", %%mm5 \n\t" /* R */\ ++ "pand %6, %%mm2 \n\t" /* B */\ ++ "pand %7, %%mm4 \n\t" /* G */\ ++ "pand %6, %%mm5 \n\t" /* R */\ + "psrlq $3, %%mm2 \n\t"\ + \ + "movq %%mm2, %%mm1 \n\t"\ +@@ -695,11 +695,18 @@ + "cmp "#dstw", "#index" \n\t"\ + " jb 1b \n\t" + #define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index) ++#define WRITERGB16_END \ ++ :: "r" (&c->redDither), \ ++ "m" (dummy), "m" (dummy), "m" (dummy),\ ++ "r" (dest), "m" (dstW), "m" (bF8), \ ++ "m" (bFC) \ ++ : "%"REG_a, "%"REG_d, "%"REG_S \ ++ ); + + #define REAL_WRITERGB15(dst, dstw, index) \ +- "pand "MANGLE(bF8)", %%mm2 \n\t" /* B */\ +- "pand "MANGLE(bF8)", %%mm4 \n\t" /* G */\ +- "pand "MANGLE(bF8)", %%mm5 \n\t" /* R */\ ++ "pand %6, %%mm2 \n\t" /* B */\ ++ "pand %6, %%mm4 \n\t" /* G */\ ++ "pand %6, %%mm5 \n\t" /* R */\ + "psrlq $3, %%mm2 \n\t"\ + "psrlq $1, %%mm5 \n\t"\ + \ +@@ -724,6 +731,12 @@ + "cmp "#dstw", "#index" \n\t"\ + " jb 1b \n\t" + #define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index) ++#define WRITERGB15_END \ ++ :: "r" (&c->redDither), \ ++ "m" (dummy), "m" (dummy), "m" (dummy),\ ++ "r" (dest), "m" (dstW), "m" (bF8) \ ++ : "%"REG_a, "%"REG_d, "%"REG_S \ ++ ); + + #define WRITEBGR24OLD(dst, dstw, index) \ + /* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */\ +@@ -1063,7 +1076,7 @@ + #endif + + WRITERGB15(%4, %5, %%REGa) +- YSCALEYUV2PACKEDX_END ++ WRITERGB15_END + return; + case PIX_FMT_RGB565: + YSCALEYUV2PACKEDX_ACCURATE +@@ -1077,7 +1090,7 @@ + #endif + + WRITERGB16(%4, %5, %%REGa) +- YSCALEYUV2PACKEDX_END ++ WRITERGB16_END + return; + case PIX_FMT_YUYV422: + YSCALEYUV2PACKEDX_ACCURATE +@@ -1127,7 +1140,7 @@ + #endif + + WRITERGB15(%4, %5, %%REGa) +- YSCALEYUV2PACKEDX_END ++ WRITERGB15_END + return; + case PIX_FMT_RGB565: + YSCALEYUV2PACKEDX +@@ -1141,7 +1154,7 @@ + #endif + + WRITERGB16(%4, %5, %%REGa) +- YSCALEYUV2PACKEDX_END ++ WRITERGB16_END + return; + case PIX_FMT_YUYV422: + YSCALEYUV2PACKEDX +@@ -1238,7 +1251,7 @@ + "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" + + :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), +- "a" (&c->redDither) ++ "a" (&c->redDither), "m" (bF8) + ); + return; + case PIX_FMT_RGB565: +@@ -1259,7 +1272,7 @@ + "pop %%"REG_BP" \n\t" + "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" + :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), +- "a" (&c->redDither) ++ "a" (&c->redDither), "m" (bF8), "m" (bFC) + ); + return; + case PIX_FMT_YUYV422: +@@ -1354,7 +1367,7 @@ + "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" + + :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), +- "a" (&c->redDither) ++ "a" (&c->redDither), "m" (bF8) + ); + return; + case PIX_FMT_RGB565: +@@ -1376,7 +1389,7 @@ + "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" + + :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), +- "a" (&c->redDither) ++ "a" (&c->redDither), "m" (bF8), "m" (bFC) + ); + return; + case PIX_FMT_YUYV422: +@@ -1447,7 +1460,7 @@ + "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" + + :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), +- "a" (&c->redDither) ++ "a" (&c->redDither), "m" (bF8) + ); + return; + case PIX_FMT_RGB565: +@@ -1469,7 +1482,7 @@ + "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" + + :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), +- "a" (&c->redDither) ++ "a" (&c->redDither), "m" (bF8), "m" (bFC) + ); + return; + case PIX_FMT_YUYV422: +@@ -1504,7 +1517,7 @@ + { + #if HAVE_MMX + __asm__ volatile( +- "movq "MANGLE(bm01010101)", %%mm2 \n\t" ++ "movq %3, %%mm2 \n\t" + "mov %0, %%"REG_a" \n\t" + "1: \n\t" + "movq (%1, %%"REG_a",2), %%mm0 \n\t" +@@ -1515,7 +1528,7 @@ + "movq %%mm0, (%2, %%"REG_a") \n\t" + "add $8, %%"REG_a" \n\t" + " js 1b \n\t" +- : : "g" (-width), "r" (src+width*2), "r" (dst+width) ++ : : "g" (-width), "r" (src+width*2), "r" (dst+width), "m"(bm01010101) + : "%"REG_a + ); + #else +@@ -1529,7 +1542,7 @@ + { + #if HAVE_MMX + __asm__ volatile( +- "movq "MANGLE(bm01010101)", %%mm4 \n\t" ++ "movq %4, %%mm4 \n\t" + "mov %0, %%"REG_a" \n\t" + "1: \n\t" + "movq (%1, %%"REG_a",4), %%mm0 \n\t" +@@ -1546,7 +1559,8 @@ + "movd %%mm1, (%2, %%"REG_a") \n\t" + "add $4, %%"REG_a" \n\t" + " js 1b \n\t" +- : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width) ++ : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width), ++ "m"(bm01010101) + : "%"REG_a + ); + #else +@@ -1590,7 +1604,7 @@ + { + #if HAVE_MMX + __asm__ volatile( +- "movq "MANGLE(bm01010101)", %%mm4 \n\t" ++ "movq %4, %%mm4 \n\t" + "mov %0, %%"REG_a" \n\t" + "1: \n\t" + "movq (%1, %%"REG_a",4), %%mm0 \n\t" +@@ -1607,7 +1621,8 @@ + "movd %%mm1, (%2, %%"REG_a") \n\t" + "add $4, %%"REG_a" \n\t" + " js 1b \n\t" +- : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width) ++ : : "g" (-width), "r" (src1+width*4), "r" (dstU+width), "r" (dstV+width), ++ "m"(bm01010101) + : "%"REG_a + ); + #else +@@ -1688,20 +1703,20 @@ + + if(srcFormat == PIX_FMT_BGR24){ + __asm__ volatile( +- "movq "MANGLE(ff_bgr24toY1Coeff)", %%mm5 \n\t" +- "movq "MANGLE(ff_bgr24toY2Coeff)", %%mm6 \n\t" +- : ++ "movq %0, %%mm5 \n\t" ++ "movq %1, %%mm6 \n\t" ++ : : "m"(ff_bgr24toY1Coeff), "m"(ff_bgr24toY2Coeff) + ); + }else{ + __asm__ volatile( +- "movq "MANGLE(ff_rgb24toY1Coeff)", %%mm5 \n\t" +- "movq "MANGLE(ff_rgb24toY2Coeff)", %%mm6 \n\t" +- : ++ "movq %0, %%mm5 \n\t" ++ "movq %1, %%mm6 \n\t" ++ : : "m"(ff_rgb24toY1Coeff), "m"(ff_rgb24toY2Coeff) + ); + } + + __asm__ volatile( +- "movq "MANGLE(ff_bgr24toYOffset)", %%mm4 \n\t" ++ "movq %3, %%mm4 \n\t" + "mov %2, %%"REG_a" \n\t" + "pxor %%mm7, %%mm7 \n\t" + "1: \n\t" +@@ -1731,7 +1746,7 @@ + "add $4, %%"REG_a" \n\t" + " js 1b \n\t" + : "+r" (src) +- : "r" (dst+width), "g" (-width) ++ : "r" (dst+width), "g" (-width), "m"(ff_bgr24toYOffset) + : "%"REG_a + ); + } +@@ -1771,7 +1786,7 @@ + "paddd %%mm3, %%mm1 \n\t" + "paddd %%mm5, %%mm4 \n\t" + +- "movq "MANGLE(ff_bgr24toUVOffset)", %%mm3 \n\t" ++ "movq %4, %%mm3 \n\t" + "paddd %%mm3, %%mm0 \n\t" + "paddd %%mm3, %%mm2 \n\t" + "paddd %%mm3, %%mm1 \n\t" +@@ -1789,7 +1804,8 @@ + "add $4, %%"REG_a" \n\t" + " js 1b \n\t" + : "+r" (src) +- : "r" (dstU+width), "r" (dstV+width), "g" (-width), "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0]) ++ : "r" (dstU+width), "r" (dstV+width), "g" (-width), ++ "m"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24][0]), "m"(ff_bgr24toUVOffset) + : "%"REG_a + ); + } +--- a/libswscale/yuv2rgb_template.c ++++ b/libswscale/yuv2rgb_template.c +@@ -74,7 +74,7 @@ + \ + /* convert the luma part */\ + "movq %%mm6, %%mm7;" /* Copy 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */\ +- "pand "MANGLE(mmx_00ffw)", %%mm6;" /* get Y even 00 Y6 00 Y4 00 Y2 00 Y0 */\ ++ "pand %9, %%mm6;" /* get Y even 00 Y6 00 Y4 00 Y2 00 Y0 */\ + \ + "psrlw $8, %%mm7;" /* get Y odd 00 Y7 00 Y5 00 Y3 00 Y1 */\ + \ +@@ -158,21 +158,63 @@ + PREFETCH" 64(%2) \n\t" \ + */ \ + +-#define YUV2RGB_ENDLOOP(depth) \ ++#define YUV2RGB16_ENDLOOP(depth) \ + "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \ + "add $4, %0 \n\t" \ + " js 1b \n\t" \ + \ + : "+r" (index), "+r" (image) \ +- : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index) \ ++ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \ ++ "m"(mmx_redmask), "m"(mmx_grnmask), "m"(dummy), "m"(mmx_00ffw) \ + ); \ + } \ + __asm__ volatile (EMMS); \ + return srcSliceH; \ + ++#define YUV2RGB15_ENDLOOP(depth) \ ++ "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \ ++ "add $4, %0 \n\t" \ ++ " js 1b \n\t" \ ++\ ++ : "+r" (index), "+r" (image) \ ++ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \ ++ "m"(mmx_redmask), "m"(dummy), "m"(dummy), "m"(mmx_00ffw) \ ++ ); \ ++ } \ ++ __asm__ volatile (EMMS); \ ++ return srcSliceH; \ ++ ++#define YUV2RGB24_ENDLOOP(depth) \ ++ "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \ ++ "add $4, %0 \n\t" \ ++ " js 1b \n\t" \ ++\ ++ : "+r" (index), "+r" (image) \ ++ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \ ++ "m"(ff_M24A), "m"(ff_M24C), "m"(ff_M24B), "m"(mmx_00ffw) \ ++ ); \ ++ } \ ++ __asm__ volatile (EMMS); \ ++ return srcSliceH; \ ++ ++#define YUV2RGB32_ENDLOOP(depth) \ ++ "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \ ++ "add $4, %0 \n\t" \ ++ " js 1b \n\t" \ ++\ ++ : "+r" (index), "+r" (image) \ ++ : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index), \ ++ "m"(dummy), "m"(dummy), "m"(dummy), "m"(mmx_00ffw) \ ++ ); \ ++ } \ ++ __asm__ volatile (EMMS); \ ++ return srcSliceH; \ ++ ++ + static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dst[], int dstStride[]){ + int y, h_size; ++ long dummy=0; + + YUV422_UNSHIFT + YUV2RGB_LOOP(2) +@@ -190,9 +232,9 @@ + "paddusb "RED_DITHER"(%4), %%mm1;" + #endif + /* mask unneeded bits off */ +- "pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */ +- "pand "MANGLE(mmx_grnmask)", %%mm2;" /* g7g6g5g4 g3g2_0_0 g7g6g5g4 g3g2_0_0 */ +- "pand "MANGLE(mmx_redmask)", %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */ ++ "pand %6, %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */ ++ "pand %7, %%mm2;" /* g7g6g5g4 g3g2_0_0 g7g6g5g4 g3g2_0_0 */ ++ "pand %6, %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */ + + "psrlw $3, %%mm0;" /* 0_0_0_b7 b6b5b4b3 0_0_0_b7 b6b5b4b3 */ + "pxor %%mm4, %%mm4;" /* zero mm4 */ +@@ -222,12 +264,13 @@ + + MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */ + +- YUV2RGB_ENDLOOP(2) ++ YUV2RGB16_ENDLOOP(2) + } + + static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dst[], int dstStride[]){ + int y, h_size; ++ long dummy=0; + + YUV422_UNSHIFT + YUV2RGB_LOOP(2) +@@ -246,9 +289,9 @@ + #endif + + /* mask unneeded bits off */ +- "pand "MANGLE(mmx_redmask)", %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */ +- "pand "MANGLE(mmx_redmask)", %%mm2;" /* g7g6g5g4 g3_0_0_0 g7g6g5g4 g3_0_0_0 */ +- "pand "MANGLE(mmx_redmask)", %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */ ++ "pand %6, %%mm0;" /* b7b6b5b4 b3_0_0_0 b7b6b5b4 b3_0_0_0 */ ++ "pand %6, %%mm2;" /* g7g6g5g4 g3_0_0_0 g7g6g5g4 g3_0_0_0 */ ++ "pand %6, %%mm1;" /* r7r6r5r4 r3_0_0_0 r7r6r5r4 r3_0_0_0 */ + + "psrlw $3, %%mm0;" /* 0_0_0_b7 b6b5b4b3 0_0_0_b7 b6b5b4b3 */ + "psrlw $1, %%mm1;" /* 0_r7r6r5 r4r3_0_0 0_r7r6r5 r4r3_0_0 */ +@@ -279,12 +322,13 @@ + + MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */ + +- YUV2RGB_ENDLOOP(2) ++ YUV2RGB15_ENDLOOP(2) + } + + static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dst[], int dstStride[]){ + int y, h_size; ++ long dummy=0; + + YUV422_UNSHIFT + YUV2RGB_LOOP(3) +@@ -293,8 +337,8 @@ + YUV2RGB + /* mm0=B, %%mm2=G, %%mm1=R */ + #if HAVE_MMX2 +- "movq "MANGLE(ff_M24A)", %%mm4 \n\t" +- "movq "MANGLE(ff_M24C)", %%mm7 \n\t" ++ "movq %6, %%mm4 \n\t" ++ "movq %7, %%mm7 \n\t" + "pshufw $0x50, %%mm0, %%mm5 \n\t" /* B3 B2 B3 B2 B1 B0 B1 B0 */ + "pshufw $0x50, %%mm2, %%mm3 \n\t" /* G3 G2 G3 G2 G1 G0 G1 G0 */ + "pshufw $0x00, %%mm1, %%mm6 \n\t" /* R1 R0 R1 R0 R1 R0 R1 R0 */ +@@ -313,7 +357,7 @@ + "pshufw $0x55, %%mm2, %%mm3 \n\t" /* G4 G3 G4 G3 G4 G3 G4 G3 */ + "pshufw $0xA5, %%mm1, %%mm6 \n\t" /* R5 R4 R5 R4 R3 R2 R3 R2 */ + +- "pand "MANGLE(ff_M24B)", %%mm5 \n\t" /* B5 B4 B3 */ ++ "pand %8, %%mm5 \n\t" /* B5 B4 B3 */ + "pand %%mm7, %%mm3 \n\t" /* G4 G3 */ + "pand %%mm4, %%mm6 \n\t" /* R4 R3 R2 */ + +@@ -328,7 +372,7 @@ + + "pand %%mm7, %%mm5 \n\t" /* B7 B6 */ + "pand %%mm4, %%mm3 \n\t" /* G7 G6 G5 */ +- "pand "MANGLE(ff_M24B)", %%mm6 \n\t" /* R7 R6 R5 */ ++ "pand %8, %%mm6 \n\t" /* R7 R6 R5 */ + "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ + \ + "por %%mm5, %%mm3 \n\t" +@@ -393,7 +437,7 @@ + "pxor %%mm4, %%mm4 \n\t" + #endif + +- YUV2RGB_ENDLOOP(3) ++ YUV2RGB24_ENDLOOP(3) + } + + #define RGB_PLANAR2PACKED32 \ +@@ -440,6 +484,7 @@ + static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dst[], int dstStride[]){ + int y, h_size; ++ long dummy=0; + + YUV422_UNSHIFT + YUV2RGB_LOOP(4) +@@ -449,5 +494,5 @@ + "pcmpeqd %%mm3, %%mm3;" /* fill mm3 */ + RGB_PLANAR2PACKED32 + +- YUV2RGB_ENDLOOP(4) ++ YUV2RGB32_ENDLOOP(4) + } +--- a/libswscale/yuv2rgb.c ++++ b/libswscale/yuv2rgb.c +@@ -47,6 +47,10 @@ + DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL; + DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL; + ++extern const uint64_t __attribute__((visibility("hidden"))) ff_M24A; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_M24B; ++extern const uint64_t __attribute__((visibility("hidden"))) ff_M24C; ++ + //MMX versions + #undef RENAME + #undef HAVE_MMX2 diff -Nru ffmpeg-0.5.2/debian/patches/i386-fpic-workaround.patch ffmpeg-0.5+svn20090706/debian/patches/i386-fpic-workaround.patch --- ffmpeg-0.5.2/debian/patches/i386-fpic-workaround.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/i386-fpic-workaround.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,21 @@ +Workaround to get ffmpeg packages built with i386 using -fPIC. +This disables -fPIC for the problematic files. +========================================================================== +--- a/Makefile ++++ b/Makefile +@@ -83,6 +83,15 @@ + + VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS)) + ++# Disable use of -fPIC on problematic files for i386 ++ifeq (,$(findstring i386 i486 i586 i686,$(shell uname -m))) ++I386CFLAGS += $(filter-out -fPIC -DPIC,$(CFLAGS)) ++libavcodec/x86/dsputil_mmx.o: libavcodec/x86/dsputil_mmx.c ++ $(CC) $(I386CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< ++libavcodec/x86/flacdsp_mmx.o: libavcodec/x86/flacdsp_mmx.c ++ $(CC) $(I386CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< ++endif ++ + BASEHOOKS = fish null watermark + ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm + ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS))) diff -Nru ffmpeg-0.5.2/debian/patches/issue1245.patch ffmpeg-0.5+svn20090706/debian/patches/issue1245.patch --- ffmpeg-0.5.2/debian/patches/issue1245.patch 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/debian/patches/issue1245.patch 2010-08-17 20:14:38.000000000 -0500 @@ -0,0 +1,38 @@ +From: michael +Date: Wed, 1 Jul 2009 18:50:31 +0000 (+0000) +Subject: Make arguments of av_set_pts_info() unsigned. +X-Git-Url: http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff_plain;h=248dc1dd4cacbb7cb27d6bc0e66ff4f902b3bdc0 + +Make arguments of av_set_pts_info() unsigned. +Fixes issue1240/mpeg1/smclockmpeg1.avi.3.1 + + +git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19319 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b +--- + +diff --git a/libavformat/avformat.h b/libavformat/avformat.h +index 57faaed..2185edc 100644 +--- a/libavformat/avformat.h ++++ b/libavformat/avformat.h +@@ -963,7 +963,7 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, + * @param pts_den denominator to convert to seconds (MPEG: 90000) + */ + void av_set_pts_info(AVStream *s, int pts_wrap_bits, +- int pts_num, int pts_den); ++ unsigned int pts_num, unsigned int pts_den); + + #define AVSEEK_FLAG_BACKWARD 1 ///< seek backward + #define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes +diff --git a/libavformat/utils.c b/libavformat/utils.c +index 9325e3d..b1c0363 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -3304,7 +3304,7 @@ char *ff_data_to_hex(char *buff, const uint8_t *src, int s) + } + + void av_set_pts_info(AVStream *s, int pts_wrap_bits, +- int pts_num, int pts_den) ++ unsigned int pts_num, unsigned int pts_den) + { + unsigned int gcd= av_gcd(pts_num, pts_den); + s->pts_wrap_bits = pts_wrap_bits; diff -Nru ffmpeg-0.5.2/debian/patches/series ffmpeg-0.5+svn20090706/debian/patches/series --- ffmpeg-0.5.2/debian/patches/series 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/patches/series 2010-08-17 20:14:38.000000000 -0500 @@ -1,10 +1,12 @@ +100_kfreebsd +ffmpeg-debian_hurd.patch fix-qtrle-encoding-when-previous-frame-linesize.patch +aac-regression.patch fix-dv-seeking.patch fix-constant-quant-encoding.patch increase-VOFW-on-x86.patch -use-normal-check_func-test-for-math-functions.patch +issue1245.patch 900_doxyfile -901-fix-misc-typos.patch # fpic-ftbfs-fix.patch # fpic-libpostproc-fix.patch # fpic-libswscale-fix.patch @@ -31,4 +33,20 @@ neon/0019-ARM-NEON-optimised-MDCT.patch neon/0020-ARM-remove-unnecessary-.fpu-neon-directives.patch neon/0021-ARM-check-for-VFP-register-arguments.patch - +CVE-2009-46XX/security-issue03.patch +CVE-2009-46XX/security-issue04.patch +CVE-2009-46XX/security-issue05.patch +CVE-2009-46XX/security-issue06.patch +CVE-2009-46XX/security-issue07.patch +CVE-2009-46XX/security-issue08.patch +CVE-2009-46XX/security-issue09.patch +CVE-2009-46XX/security-issue10.patch +CVE-2009-46XX/security-issue11.patch +CVE-2009-46XX/security-issue12.patch +CVE-2009-46XX/security-issue13.patch +CVE-2009-46XX/security-issue14.patch +CVE-2009-46XX/security-issue15.patch +CVE-2009-46XX/security-issue17.patch +CVE-2009-46XX/security-issue18.patch +CVE-2009-46XX/security-issue19.patch +CVE-2009-46XX/security-issue20.patch diff -Nru ffmpeg-0.5.2/debian/patches/use-normal-check_func-test-for-math-functions.patch ffmpeg-0.5+svn20090706/debian/patches/use-normal-check_func-test-for-math-functions.patch --- ffmpeg-0.5.2/debian/patches/use-normal-check_func-test-for-math-functions.patch 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/patches/use-normal-check_func-test-for-math-functions.patch 1969-12-31 18:00:00.000000000 -0600 @@ -1,48 +0,0 @@ -From: mru -Date: Wed, 15 Jul 2009 08:22:06 +0000 (+0000) -Subject: Use normal check_func test for math functions -X-Git-Url: http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff_plain;h=9899a2f3353c19bebf6d1e94eaa526a2a1fece95 - -Use normal check_func test for math functions - -git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19434 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b - -This patch avoid a funny FTBFS on armel machines that do not have a FPU: -The check_exec function tries to execute the binary to check for their -functioning. On armel, llrint (and only that function) is implemented -using FPU instruction, which makes this test fail and causes HAVE_LLRINT -to be not defined. Since it is defined in math.h anyways, the build fails with: - -gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/tmp/buildd/ffmpeg-0.5+svn20090706" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -I/tmp/buildd/ffmpeg-0.5+svn20090706/debian/include -mfpu=neon -mfloat-abi=softfp -fPIC -DPIC -std=c99 -fomit-frame-pointer -march=armv7-a -pthread -I/usr/include/dirac -I/usr/include/schroedinger-1.0 -I/usr/include/liboil-0.3 -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -fno-math-errno -fno-signed-zeros -c -o libavfilter/allfilters.o /tmp/buildd/ffmpeg-0.5+svn20090706/libavfilter/allfilters.c -In file included from /tmp/buildd/ffmpeg-0.5+svn20090706/libavutil/common.h:283, - from /tmp/buildd/ffmpeg-0.5+svn20090706/libavutil/avutil.h:56, - from /tmp/buildd/ffmpeg-0.5+svn20090706/libavcodec/avcodec.h:30, - from /tmp/buildd/ffmpeg-0.5+svn20090706/libavfilter/avfilter.h:38, - from /tmp/buildd/ffmpeg-0.5+svn20090706/libavfilter/allfilters.c:22: -/tmp/buildd/ffmpeg-0.5+svn20090706/libavutil/internal.h:276: error: static declaration of 'llrint' follows non-static declaration -make[1]: *** [libavfilter/allfilters.o] Error 1 - ---- - ---- a/configure -+++ b/configure -@@ -1984,13 +1984,12 @@ done - - check_lib math.h sin -lm - --# test for C99 functions in math.h --for func in llrint lrint lrintf round roundf truncf; do -- check_exec < --int main(void) { return ($func(3.999f) > 0)?0:1; } --EOF --done -+check_func llrint -+check_func lrint -+check_func lrintf -+check_func round -+check_func roundf -+check_func truncf - - # these are off by default, so fail if requested and not available - enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32 diff -Nru ffmpeg-0.5.2/debian/README.source ffmpeg-0.5+svn20090706/debian/README.source --- ffmpeg-0.5.2/debian/README.source 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/README.source 1969-12-31 18:00:00.000000000 -0600 @@ -1,5 +0,0 @@ -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -For more information about quilt, see /usr/share/doc/quilt/README.source diff -Nru ffmpeg-0.5.2/debian/rules ffmpeg-0.5+svn20090706/debian/rules --- ffmpeg-0.5.2/debian/rules 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/debian/rules 2010-08-17 20:14:38.000000000 -0500 @@ -6,8 +6,12 @@ DEB_SOURCE := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p') DEB_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p') UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -r 's/[^:]+://; s/-[^-]+$$//') -SHLIBS_VERSION := 4:0.5.1-1 +SVN_VERSION := $(shell echo $(UPSTREAM_VERSION) | sed -nr 's/^[0-9.:-]+[+.]svn([0-9]+)$$/\1/p') +SHLIBS_VERSION := 3:0.svn20090303-1 +ifeq ($(SVN_VERSION),) +$(error UPSTREAM_VERSION: $(UPSTREAM_VERSION) - but SVN_VERSION is empty! - check debian/rules) +endif LIB_PKGS := $(shell sed -nr 's/^Package:[[:space:]]*(lib(avutil|avcodec|avdevice|avformat|avfilter|postproc|swscale)(-extra-)?[0-9]+)[[:space:]]*$$/\1/p' debian/control) @@ -33,7 +37,8 @@ configure-stamp-%: $(QUILT_STAMPFN) dh_testdir mkdir -p debian-$* - echo $(UPSTREAM_VERSION) > debian-$*/snapshot_version + [ ! -r .svnrevision ] || \ + cp .svnrevision debian-$*/snapshot_version cd debian-$* && CFLAGS="$(CFLAGS)" $(CURDIR)/configure \ $($*_build_confflags) $(extra_$*_build_confflags) touch $@ @@ -67,6 +72,10 @@ rm -rf $(addprefix debian-, $(FLAVORS)) doxy dh_clean +get-orig-source: + dh_testdir + sh debian/get-orig-source.sh -d $(SVN_VERSION) + # The trailing newline is important! define install_flavor $(MAKE) -C debian-$(1) install DESTDIR=$(CURDIR)/debian/tmp \ @@ -113,27 +122,18 @@ dh_fixperms dh_strip --dbg-package=ffmpeg-dbg -# We generate the shlibs file twice: First time for the internal -# dependencies, and then we regenerate them for inclusion in the -# packages. The point of this excercice is to have the 'internal' -# dependencies more strict than 'external' ones. We have implemented this -# so that mixing ffmpeg libraries with the unofficial ones from -# debian-multimedia.org will be harder. - # strict internal dependencies for pkg in $(LIB_PKGS); do \ upkg=$$(echo "$$pkg" | sed -r 's/([0-9]+)$$/-extra-\1/'); \ - dh_makeshlibs -p"$$pkg" -V"$$pkg (>= $(DEB_VERSION)) | $$upkg (>= $(DEB_VERSION)), $$pkg (<< $(EPOCH)$(UPSTREAM_VERSION)-99) | $$upkg (<< $(EPOCH)$(UPSTREAM_VERSION)-99)"; \ + dh_makeshlibs -p"$$pkg" -V"$$pkg (>= $(EPOCH)$(UPSTREAM_VERSION)) | $$upkg (>= $(EPOCH)$(UPSTREAM_VERSION)), $$pkg (< $(EPOCH)$(UPSTREAM_VERSION)-99) | $$upkg (< $(EPOCH)$(UPSTREAM_VERSION)-99)"; \ done env LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):$(CURDIR)/debian/tmp/usr/lib" \ - dh_shlibdeps -Nffmpeg + dh_shlibdeps # target dependencies for external packages for pkg in $(LIB_PKGS); do \ upkg=$$(echo "$$pkg" | sed -r 's/([0-9]+)$$/-extra-\1/'); \ dh_makeshlibs -p"$$pkg" -V"$$pkg (>= $(SHLIBS_VERSION)) | $$upkg (>= $(SHLIBS_VERSION))"; \ done - dh_shlibdeps -pffmpeg - dh_installdeb dh_gencontrol -- -Vlib1394-dev="$(lib1394-dev)" dh_md5sums diff -Nru ffmpeg-0.5.2/doc/APIchanges ffmpeg-0.5+svn20090706/doc/APIchanges --- ffmpeg-0.5.2/doc/APIchanges 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/doc/APIchanges 2009-03-01 12:20:26.000000000 -0600 @@ -1,11 +1,3 @@ -20090601 - r19025 - lavc 52.30.0 - av_lockmgr_register() - av_lockmgr_register() can be used to register a callback function - that lavc (and in the future, libraries that depend on lavc) can use - to implement mutexes. The application should provide a callback function - the implements the AV_LOCK_* operations described in avcodec.h. - When the lock manager is registered FFmpeg is guaranteed to behave - correct also in a multi-threaded application. - 20090301 - r17682 - lavf 52.31.0 - Generic metadata API This version introduce a new metadata API (see av_metadata_get() and friends). The old API is now deprecated and shouldn't be used anymore. This especially diff -Nru ffmpeg-0.5.2/doc/ffmpeg-doc.texi ffmpeg-0.5+svn20090706/doc/ffmpeg-doc.texi --- ffmpeg-0.5.2/doc/ffmpeg-doc.texi 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/doc/ffmpeg-doc.texi 2009-07-03 06:14:37.000000000 -0500 @@ -141,9 +141,8 @@ NOTE: To see the supported input formats, use @code{ffmpeg -formats}. -* You can extract images from a video, or create a video from many images: +* You can extract images from a video: -For extracting images from a video: @example ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg @end example @@ -152,20 +151,15 @@ output them in files named @file{foo-001.jpeg}, @file{foo-002.jpeg}, etc. Images will be rescaled to fit the new WxH values. -If you want to extract just a limited number of frames, you can use the -above command in combination with the -vframes or -t option, or in -combination with -ss to start extracting from a certain point in time. - -For creating a video from many images: -@example -ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi -@end example - The syntax @code{foo-%03d.jpeg} specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable. +If you want to extract just a limited number of frames, you can use the +above command in combination with the -vframes or -t option, or in +combination with -ss to start extracting from a certain point in time. + * You can put many streams of the same type in the output: @example @@ -282,16 +276,29 @@ Specifying a positive offset means that the corresponding streams are delayed by 'offset' seconds. +@item -title @var{string} +Set the title. + @item -timestamp @var{time} Set the timestamp. -@item -metadata @var{key}=@var{value} -Set a metadata key/value pair. +@item -author @var{string} +Set the author. -For example, for setting the title in the output file: -@example -ffmpeg -i in.avi -metadata title="my title" out.flv -@end example +@item -copyright @var{string} +Set the copyright. + +@item -comment @var{string} +Set the comment. + +@item -album @var{string} +Set the album. + +@item -track @var{number} +Set the track. + +@item -year @var{number} +Set the year. @item -v @var{number} Set the logging verbosity level. @@ -680,8 +687,6 @@ Set the audio sampling frequency (default = 44100 Hz). @item -ab @var{bitrate} Set the audio bitrate in bit/s (default = 64k). -@item -aq @var{q} -Set the audio quality (codec-specific, VBR). @item -ac @var{channels} Set the number of audio channels (default = 1). @item -an @@ -723,8 +728,6 @@ Add a new subtitle stream to the current output stream. @item -slang @var{code} Set the ISO 639 language code (3 letters) of the current subtitle stream. -@item -sn -Disable subtitle recording. @item -sbsf @var{bitstream_filter} Bitstream filters available are "mov2textsub", "text2movsub". @example diff -Nru ffmpeg-0.5.2/ffpresets/libx264-baseline.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-baseline.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-baseline.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-baseline.ffpreset 2009-01-13 13:40:35.000000000 -0600 @@ -1,4 +1,3 @@ coder=0 bf=0 -flags2=-wpred-dct8x8+mbtree -wpredp=0 +flags2=-wpred-dct8x8 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-default.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-default.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-default.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-default.ffpreset 2009-01-25 15:28:56.000000000 -0600 @@ -3,7 +3,7 @@ cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partb8x8 me_method=hex -subq=7 +subq=6 me_range=16 g=250 keyint_min=25 @@ -14,9 +14,5 @@ qmin=10 qmax=51 qdiff=4 -bf=3 -refs=3 directpred=1 -trellis=1 -flags2=+mixed_refs+wpred+dct8x8+fastpskip+mbtree -wpredp=2 +flags2=+fastpskip diff -Nru ffmpeg-0.5.2/ffpresets/libx264-fastfirstpass.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-fastfirstpass.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-fastfirstpass.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-fastfirstpass.ffpreset 2009-01-07 10:51:55.000000000 -0600 @@ -3,7 +3,7 @@ cmp=+chroma partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 me_method=dia -subq=2 +subq=1 me_range=16 g=250 keyint_min=25 @@ -14,9 +14,8 @@ qmin=10 qmax=51 qdiff=4 -bf=3 +bf=4 refs=1 directpred=3 trellis=0 -flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip+mbtree -wpredp=2 +flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip diff -Nru ffmpeg-0.5.2/ffpresets/libx264-hq.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-hq.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-hq.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-hq.ffpreset 2009-01-07 10:51:55.000000000 -0600 @@ -14,9 +14,8 @@ qmin=10 qmax=51 qdiff=4 -bf=3 +bf=4 refs=4 directpred=3 trellis=1 -flags2=+wpred+mixed_refs+dct8x8+fastpskip+mbtree -wpredp=2 +flags2=+bpyramid+wpred+mixed_refs+dct8x8+fastpskip diff -Nru ffmpeg-0.5.2/ffpresets/libx264-ipod320.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-ipod320.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-ipod320.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-ipod320.ffpreset 2009-01-15 20:20:24.000000000 -0600 @@ -1,7 +1,6 @@ coder=0 bf=0 -flags2=-wpred-dct8x8+mbtree +flags2=-wpred-dct8x8 level=13 maxrate=768000 bufsize=3000000 -wpredp=0 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-ipod640.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-ipod640.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-ipod640.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-ipod640.ffpreset 2009-01-15 20:20:24.000000000 -0600 @@ -1,8 +1,7 @@ coder=0 bf=0 refs=1 -flags2=-wpred-dct8x8+mbtree +flags2=-wpred-dct8x8 level=30 maxrate=10000000 bufsize=10000000 -wpredp=0 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-lossless_fast.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_fast.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-lossless_fast.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_fast.ffpreset 2009-01-07 11:38:29.000000000 -0600 @@ -15,6 +15,5 @@ qmax=51 qdiff=4 directpred=1 -flags2=+fastpskip+mbtree +flags2=+fastpskip cqp=0 -wpredp=0 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-lossless_max.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_max.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-lossless_max.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_max.ffpreset 2009-01-07 11:38:29.000000000 -0600 @@ -16,6 +16,5 @@ qdiff=4 refs=16 directpred=1 -flags2=+mixed_refs+dct8x8+fastpskip+mbtree +flags2=+mixed_refs+dct8x8+fastpskip cqp=0 -wpredp=2 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-lossless_medium.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_medium.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-lossless_medium.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_medium.ffpreset 2009-01-07 11:38:29.000000000 -0600 @@ -15,6 +15,5 @@ qmax=51 qdiff=4 directpred=1 -flags2=+fastpskip+mbtree +flags2=+fastpskip cqp=0 -wpredp=2 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-lossless_slower.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_slower.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-lossless_slower.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_slower.ffpreset 2009-01-07 11:38:29.000000000 -0600 @@ -16,6 +16,5 @@ qdiff=4 refs=4 directpred=1 -flags2=+mixed_refs+dct8x8+fastpskip+mbtree +flags2=+mixed_refs+dct8x8+fastpskip cqp=0 -wpredp=2 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-lossless_slow.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_slow.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-lossless_slow.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_slow.ffpreset 2009-01-07 11:38:29.000000000 -0600 @@ -16,6 +16,5 @@ qdiff=4 refs=2 directpred=1 -flags2=+dct8x8+fastpskip+mbtree +flags2=+dct8x8+fastpskip cqp=0 -wpredp=2 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-lossless_ultrafast.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_ultrafast.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-lossless_ultrafast.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-lossless_ultrafast.ffpreset 2009-01-07 11:38:29.000000000 -0600 @@ -15,5 +15,5 @@ qmax=51 qdiff=4 directpred=1 -flags2=+fastpskip+mbtree +flags2=+fastpskip cqp=0 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-main.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-main.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-main.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-main.ffpreset 2009-01-13 13:40:35.000000000 -0600 @@ -1 +1 @@ -flags2=-dct8x8+mbtree +flags2=-dct8x8 diff -Nru ffmpeg-0.5.2/ffpresets/libx264-max.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-max.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-max.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-max.ffpreset 2009-01-07 10:51:55.000000000 -0600 @@ -3,8 +3,8 @@ cmp=+chroma partitions=+parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 me_method=tesa -subq=10 -me_range=24 +subq=9 +me_range=32 g=250 keyint_min=25 sc_threshold=40 @@ -14,9 +14,8 @@ qmin=10 qmax=51 qdiff=4 -bf=3 +bf=4 refs=16 directpred=3 trellis=2 -flags2=+wpred+mixed_refs+dct8x8-fastpskip+mbtree -wpredp=2 +flags2=+bpyramid+wpred+mixed_refs+dct8x8-fastpskip diff -Nru ffmpeg-0.5.2/ffpresets/libx264-normal.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-normal.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-normal.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-normal.ffpreset 2009-01-07 10:51:55.000000000 -0600 @@ -14,9 +14,8 @@ qmin=10 qmax=51 qdiff=4 -bf=3 +bf=4 refs=2 directpred=3 trellis=0 -flags2=+wpred+dct8x8+fastpskip+mbtree -wpredp=2 +flags2=+bpyramid+wpred+dct8x8+fastpskip diff -Nru ffmpeg-0.5.2/ffpresets/libx264-slowfirstpass.ffpreset ffmpeg-0.5+svn20090706/ffpresets/libx264-slowfirstpass.ffpreset --- ffmpeg-0.5.2/ffpresets/libx264-slowfirstpass.ffpreset 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/ffpresets/libx264-slowfirstpass.ffpreset 2009-01-07 10:52:15.000000000 -0600 @@ -14,9 +14,8 @@ qmin=10 qmax=51 qdiff=4 -bf=3 +bf=4 refs=1 directpred=3 trellis=0 -flags2=+wpred+dct8x8+fastpskip+mbtree -wpredp=2 +flags2=+bpyramid+wpred+dct8x8+fastpskip diff -Nru ffmpeg-0.5.2/libavcodec/aac.c ffmpeg-0.5+svn20090706/libavcodec/aac.c --- ffmpeg-0.5.2/libavcodec/aac.c 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/aac.c 2009-02-28 18:23:05.000000000 -0600 @@ -97,56 +97,6 @@ static VLC vlc_spectral[11]; -static ChannelElement* get_che(AACContext *ac, int type, int elem_id) { - static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0 }; - if (ac->tag_che_map[type][elem_id]) { - return ac->tag_che_map[type][elem_id]; - } - if (ac->tags_mapped >= tags_per_config[ac->m4ac.chan_config]) { - return NULL; - } - switch (ac->m4ac.chan_config) { - case 7: - if (ac->tags_mapped == 3 && type == TYPE_CPE) { - ac->tags_mapped++; - return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2]; - } - case 6: - /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1] - instead of SCE[0] CPE[0] CPE[0] LFE[0]. If we seem to have - encountered such a stream, transfer the LFE[0] element to SCE[1] */ - if (ac->tags_mapped == tags_per_config[ac->m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { - ac->tags_mapped++; - return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0]; - } - case 5: - if (ac->tags_mapped == 2 && type == TYPE_CPE) { - ac->tags_mapped++; - return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1]; - } - case 4: - if (ac->tags_mapped == 2 && ac->m4ac.chan_config == 4 && type == TYPE_SCE) { - ac->tags_mapped++; - return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1]; - } - case 3: - case 2: - if (ac->tags_mapped == (ac->m4ac.chan_config != 2) && type == TYPE_CPE) { - ac->tags_mapped++; - return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0]; - } else if (ac->m4ac.chan_config == 2) { - return NULL; - } - case 1: - if (!ac->tags_mapped && type == TYPE_SCE) { - ac->tags_mapped++; - return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0]; - } - default: - return NULL; - } -} - /** * Configure output channel order based on the current program configuration element. * @@ -156,7 +106,7 @@ * @return Returns error status. 0 - OK, !0 - error */ static int output_configure(AACContext *ac, enum ChannelPosition che_pos[4][MAX_ELEM_ID], - enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], int channel_config) { + enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]) { AVCodecContext *avctx = ac->avccontext; int i, type, channels = 0; @@ -190,16 +140,7 @@ } } - if (channel_config) { - memset(ac->tag_che_map, 0, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); - ac->tags_mapped = 0; - } else { - memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0])); - ac->tags_mapped = 4*MAX_ELEM_ID; - } - avctx->channels = channels; - return 0; } @@ -345,7 +286,7 @@ if((ret = set_default_channel_config(ac, new_che_pos, channel_config))) return ret; } - if((ret = output_configure(ac, ac->che_pos, new_che_pos, channel_config))) + if((ret = output_configure(ac, ac->che_pos, new_che_pos))) return ret; if (extension_flag) { @@ -453,7 +394,7 @@ memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); if(set_default_channel_config(ac, new_che_pos, avccontext->channels - (avccontext->channels == 8))) return -1; - if(output_configure(ac, ac->che_pos, new_che_pos, 1)) + if(output_configure(ac, ac->che_pos, new_che_pos)) return -1; ac->m4ac.sample_rate = avccontext->sample_rate; } else { @@ -1597,20 +1538,19 @@ ac->m4ac.sample_rate = hdr_info.sample_rate; ac->m4ac.sampling_index = hdr_info.sampling_index; ac->m4ac.object_type = hdr_info.object_type; - if (hdr_info.num_aac_frames == 1) { - if (!hdr_info.crc_absent) - skip_bits(gb, 16); - } else { - ff_log_missing_feature(ac->avccontext, "More than one AAC RDB per ADTS frame is", 0); - return -1; - } + } + if (hdr_info.num_aac_frames == 1) { + if (!hdr_info.crc_absent) + skip_bits(gb, 16); + } else { + ff_log_missing_feature(ac->avccontext, "More than one AAC RDB per ADTS frame is", 0); + return -1; } return size; } static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, const uint8_t * buf, int buf_size) { AACContext * ac = avccontext->priv_data; - ChannelElement * che = NULL; GetBitContext gb; enum RawDataBlockType elem_type; int err, elem_id, data_size_tmp; @@ -1633,7 +1573,15 @@ elem_id = get_bits(&gb, 4); err = -1; - if(elem_type < TYPE_DSE && !(che=get_che(ac, elem_type, elem_id))) { + if(elem_type == TYPE_SCE && elem_id == 1 && + !ac->che[TYPE_SCE][elem_id] && ac->che[TYPE_LFE][0]) { + /* Some streams incorrectly code 5.1 audio as SCE[0] CPE[0] CPE[1] SCE[1] + instead of SCE[0] CPE[0] CPE[0] LFE[0]. If we seem to have + encountered such a stream, transfer the LFE[0] element to SCE[1] */ + ac->che[TYPE_SCE][elem_id] = ac->che[TYPE_LFE][0]; + ac->che[TYPE_LFE][0] = NULL; + } + if(elem_type < TYPE_DSE && !ac->che[elem_type][elem_id]) { av_log(ac->avccontext, AV_LOG_ERROR, "channel element %d.%d is not allocated\n", elem_type, elem_id); return -1; } @@ -1641,19 +1589,19 @@ switch (elem_type) { case TYPE_SCE: - err = decode_ics(ac, &che->ch[0], &gb, 0, 0); + err = decode_ics(ac, &ac->che[TYPE_SCE][elem_id]->ch[0], &gb, 0, 0); break; case TYPE_CPE: - err = decode_cpe(ac, &gb, che); + err = decode_cpe(ac, &gb, ac->che[TYPE_CPE][elem_id]); break; case TYPE_CCE: - err = decode_cce(ac, &gb, che); + err = decode_cce(ac, &gb, ac->che[TYPE_CCE][elem_id]); break; case TYPE_LFE: - err = decode_ics(ac, &che->ch[0], &gb, 0, 0); + err = decode_ics(ac, &ac->che[TYPE_LFE][elem_id]->ch[0], &gb, 0, 0); break; case TYPE_DSE: @@ -1667,7 +1615,7 @@ memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); if((err = decode_pce(ac, new_che_pos, &gb))) break; - err = output_configure(ac, ac->che_pos, new_che_pos, 0); + err = output_configure(ac, ac->che_pos, new_che_pos); break; } diff -Nru ffmpeg-0.5.2/libavcodec/aac.h ffmpeg-0.5+svn20090706/libavcodec/aac.h --- ffmpeg-0.5.2/libavcodec/aac.h 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/aac.h 2009-02-17 15:43:57.000000000 -0600 @@ -260,8 +260,6 @@ * first index as the first 4 raw data block types */ ChannelElement * che[4][MAX_ELEM_ID]; - ChannelElement * tag_che_map[4][MAX_ELEM_ID]; - int tags_mapped; /** @} */ /** diff -Nru ffmpeg-0.5.2/libavcodec/avcodec.h ffmpeg-0.5+svn20090706/libavcodec/avcodec.h --- ffmpeg-0.5.2/libavcodec/avcodec.h 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/avcodec.h 2009-02-26 17:47:32.000000000 -0600 @@ -31,7 +31,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 20 -#define LIBAVCODEC_VERSION_MICRO 1 +#define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ @@ -501,7 +501,6 @@ #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer. #define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible -#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only) /* Unsupported options : * Syntax Arithmetic coding (SAC) @@ -2333,16 +2332,6 @@ * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. */ int ticks_per_frame; - - /** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - */ - int weighted_p_pred; } AVCodecContext; /** @@ -3355,30 +3344,4 @@ */ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel); - -/** - * Lock operation used by lockmgr - */ -enum AVLockOp { - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY, ///< Free mutex resources -}; - -/** - * Register a user provided lock manager supporting the operations - * specified by AVLockOp. \p mutex points to a (void *) where the - * lockmgr should store/get a pointer to a user allocated mutex. It's - * NULL upon AV_LOCK_CREATE and != NULL for all other ops. - * - * @param cb User defined callback. Note: FFmpeg may invoke calls to this - * callback during the call to av_lockmgr_register(). - * Thus, the application must be prepared to handle that. - * If cb is set to NULL the lockmgr will be unregistered. - * Also note that during unregistration the previously registered - * lockmgr callback may also be invoked. - */ -int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); - #endif /* AVCODEC_AVCODEC_H */ diff -Nru ffmpeg-0.5.2/libavcodec/ffv1.c ffmpeg-0.5+svn20090706/libavcodec/ffv1.c --- ffmpeg-0.5.2/libavcodec/ffv1.c 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/ffv1.c 2009-01-31 20:00:19.000000000 -0600 @@ -248,9 +248,10 @@ else{ int i, e, a; e= 0; - while(get_rac(c, state+1 + e) && e<9){ //1..10 + while(get_rac(c, state+1 + e)){ //1..10 e++; } + assert(e<=9); a= 1; for(i=e-1; i>=0; i--){ diff -Nru ffmpeg-0.5.2/libavcodec/h264.c ffmpeg-0.5+svn20090706/libavcodec/h264.c --- ffmpeg-0.5.2/libavcodec/h264.c 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/h264.c 2009-02-28 21:13:04.000000000 -0600 @@ -7016,10 +7016,6 @@ if(sps->timing_info_present_flag){ sps->num_units_in_tick = get_bits_long(&s->gb, 32); sps->time_scale = get_bits_long(&s->gb, 32); - if(sps->num_units_in_tick-1 > 0x7FFFFFFEU || sps->time_scale-1 > 0x7FFFFFFEU){ - av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick inavlid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick); - return -1; - } sps->fixed_frame_rate_flag = get_bits1(&s->gb); } diff -Nru ffmpeg-0.5.2/libavcodec/huffyuv.c ffmpeg-0.5+svn20090706/libavcodec/huffyuv.c --- ffmpeg-0.5.2/libavcodec/huffyuv.c 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/huffyuv.c 2009-02-22 07:48:55.000000000 -0600 @@ -728,17 +728,10 @@ count/=2; - if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*4)){ - for(i=0; igb) < s->gb.size_in_bits; i++){ - READ_2PIX(s->temp[0][2*i ], s->temp[1][i], 1); - READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2); - } - }else{ for(i=0; itemp[0][2*i ], s->temp[1][i], 1); READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2); } - } } static void decode_gray_bitstream(HYuvContext *s, int count){ @@ -746,15 +739,9 @@ count/=2; - if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*2)){ - for(i=0; igb) < s->gb.size_in_bits; i++){ - READ_2PIX(s->temp[0][2*i ], s->temp[0][2*i+1], 0); - } - }else{ for(i=0; itemp[0][2*i ], s->temp[0][2*i+1], 0); } - } } #if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER diff -Nru ffmpeg-0.5.2/libavcodec/libavcodec.v ffmpeg-0.5+svn20090706/libavcodec/libavcodec.v --- ffmpeg-0.5.2/libavcodec/libavcodec.v 2010-08-17 20:10:42.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/libavcodec.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,3 +0,0 @@ -LIBAVCODEC_$MAJOR { - global: *; -}; diff -Nru ffmpeg-0.5.2/libavcodec/libx264.c ffmpeg-0.5+svn20090706/libavcodec/libx264.c --- ffmpeg-0.5.2/libavcodec/libx264.c 2010-08-17 20:10:43.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/libx264.c 2008-10-13 08:47:05.000000000 -0500 @@ -27,15 +27,14 @@ #include typedef struct X264Context { - x264_param_t params; - x264_t *enc; - x264_picture_t pic; - uint8_t *sei; - int sei_size; - AVFrame out_pic; + x264_param_t params; + x264_t *enc; + x264_picture_t pic; + AVFrame out_pic; } X264Context; -static void X264_log(void *p, int level, const char *fmt, va_list args) +static void +X264_log(void *p, int level, const char *fmt, va_list args) { static const int level_map[] = { [X264_LOG_ERROR] = AV_LOG_ERROR, @@ -44,75 +43,31 @@ [X264_LOG_DEBUG] = AV_LOG_DEBUG }; - if (level < 0 || level > X264_LOG_DEBUG) + if(level < 0 || level > X264_LOG_DEBUG) return; av_vlog(p, level_map[level], fmt, args); } -#if X264_BUILD >= 76 -static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size, - x264_nal_t *nals, int nnal, int skip_sei) -{ - X264Context *x4 = ctx->priv_data; - uint8_t *p = buf; - int i; - - /* Write the SEI as part of the first frame. */ - if (x4->sei_size > 0 && nnal > 0) { - memcpy(p, x4->sei, x4->sei_size); - p += x4->sei_size; - x4->sei_size = 0; - } - for (i = 0; i < nnal; i++){ - /* Don't put the SEI in extradata. */ - if (skip_sei && nals[i].i_type == NAL_SEI) { - x4->sei_size = nals[i].i_payload; - x4->sei = av_malloc(x4->sei_size); - memcpy(x4->sei, nals[i].p_payload, nals[i].i_payload); - continue; - } - memcpy(p, nals[i].p_payload, nals[i].i_payload); - p += nals[i].i_payload; - } - - return p - buf; -} -#else -static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size, x264_nal_t *nals, int nnal, int skip_sei) +static int +encode_nals(uint8_t *buf, int size, x264_nal_t *nals, int nnal) { - X264Context *x4 = ctx->priv_data; uint8_t *p = buf; - int i, s; - - /* Write the SEI as part of the first frame. */ - if (x4->sei_size > 0 && nnal > 0) { - memcpy(p, x4->sei, x4->sei_size); - p += x4->sei_size; - x4->sei_size = 0; - } + int i; - for (i = 0; i < nnal; i++) { - /* Don't put the SEI in extradata. */ - if (skip_sei && nals[i].i_type == NAL_SEI) { - x4->sei = av_malloc( 5 + nals[i].i_payload * 4 / 3 ); - if(x264_nal_encode(x4->sei, &x4->sei_size, 1, nals + i) < 0) - return -1; - continue; - } - s = x264_nal_encode(p, &size, 1, nals + i); - if (s < 0) + for(i = 0; i < nnal; i++){ + int s = x264_nal_encode(p, &size, 1, nals + i); + if(s < 0) return -1; p += s; } return p - buf; } -#endif -static int X264_frame(AVCodecContext *ctx, uint8_t *buf, - int bufsize, void *data) +static int +X264_frame(AVCodecContext *ctx, uint8_t *buf, int bufsize, void *data) { X264Context *x4 = ctx->priv_data; AVFrame *frame = data; @@ -120,30 +75,31 @@ int nnal, i; x264_picture_t pic_out; - x4->pic.img.i_csp = X264_CSP_I420; + x4->pic.img.i_csp = X264_CSP_I420; x4->pic.img.i_plane = 3; if (frame) { - for (i = 0; i < 3; i++) { + for(i = 0; i < 3; i++){ x4->pic.img.plane[i] = frame->data[i]; x4->pic.img.i_stride[i] = frame->linesize[i]; } - x4->pic.i_pts = frame->pts; + x4->pic.i_pts = frame->pts; x4->pic.i_type = X264_TYPE_AUTO; } - if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0) + if(x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, + &pic_out)) return -1; - bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0); - if (bufsize < 0) + bufsize = encode_nals(buf, bufsize, nal, nnal); + if(bufsize < 0) return -1; - /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */ + /* FIXME: dts */ x4->out_pic.pts = pic_out.i_pts; - switch (pic_out.i_type) { + switch(pic_out.i_type){ case X264_TYPE_IDR: case X264_TYPE_I: x4->out_pic.pict_type = FF_I_TYPE; @@ -157,194 +113,166 @@ break; } -#if X264_BUILD < 82 x4->out_pic.key_frame = pic_out.i_type == X264_TYPE_IDR; -#else - x4->out_pic.key_frame = pic_out.b_keyframe; -#endif - x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; + x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; return bufsize; } -static av_cold int X264_close(AVCodecContext *avctx) +static av_cold int +X264_close(AVCodecContext *avctx) { X264Context *x4 = avctx->priv_data; av_freep(&avctx->extradata); - av_free(x4->sei); - if (x4->enc) + if(x4->enc) x264_encoder_close(x4->enc); return 0; } -static av_cold int X264_init(AVCodecContext *avctx) +static av_cold int +X264_init(AVCodecContext *avctx) { X264Context *x4 = avctx->priv_data; - x4->sei_size = 0; x264_param_default(&x4->params); - x4->params.pf_log = X264_log; - x4->params.p_log_private = avctx; + x4->params.pf_log = X264_log; + x4->params.p_log_private = avctx; - x4->params.i_keyint_max = avctx->gop_size; - x4->params.rc.i_bitrate = avctx->bit_rate / 1000; + x4->params.i_keyint_max = avctx->gop_size; + x4->params.rc.i_bitrate = avctx->bit_rate / 1000; x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000; - x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; - x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1; - if (avctx->flags & CODEC_FLAG_PASS2) { - x4->params.rc.b_stat_read = 1; - } else { - if (avctx->crf) { - x4->params.rc.i_rc_method = X264_RC_CRF; + x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; + x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1; + if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1; + else{ + if(avctx->crf){ + x4->params.rc.i_rc_method = X264_RC_CRF; x4->params.rc.f_rf_constant = avctx->crf; - } else if (avctx->cqp > -1) { - x4->params.rc.i_rc_method = X264_RC_CQP; + }else if(avctx->cqp > -1){ + x4->params.rc.i_rc_method = X264_RC_CQP; x4->params.rc.i_qp_constant = avctx->cqp; } } // if neither crf nor cqp modes are selected we have to enable the RC // we do it this way because we cannot check if the bitrate has been set - if (!(avctx->crf || (avctx->cqp > -1))) - x4->params.rc.i_rc_method = X264_RC_ABR; + if(!(avctx->crf || (avctx->cqp > -1))) x4->params.rc.i_rc_method = X264_RC_ABR; - x4->params.i_bframe = avctx->max_b_frames; - x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; + x4->params.i_bframe = avctx->max_b_frames; + x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; x4->params.i_bframe_adaptive = avctx->b_frame_strategy; - x4->params.i_bframe_bias = avctx->bframebias; -#if X264_BUILD >= 78 - x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE; -#else - x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID; -#endif - avctx->has_b_frames = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames; + x4->params.i_bframe_bias = avctx->bframebias; + x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID; + avctx->has_b_frames= avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames; x4->params.i_keyint_min = avctx->keyint_min; - if (x4->params.i_keyint_min > x4->params.i_keyint_max) + if(x4->params.i_keyint_min > x4->params.i_keyint_max) x4->params.i_keyint_min = x4->params.i_keyint_max; - x4->params.i_scenecut_threshold = avctx->scenechange_threshold; + x4->params.i_scenecut_threshold = avctx->scenechange_threshold; - x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER; + x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER; x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; - x4->params.i_deblocking_filter_beta = avctx->deblockbeta; + x4->params.i_deblocking_filter_beta = avctx->deblockbeta; - x4->params.rc.i_qp_min = avctx->qmin; - x4->params.rc.i_qp_max = avctx->qmax; - x4->params.rc.i_qp_step = avctx->max_qdiff; + x4->params.rc.i_qp_min = avctx->qmin; + x4->params.rc.i_qp_max = avctx->qmax; + x4->params.rc.i_qp_step = avctx->max_qdiff; - x4->params.rc.f_qcompress = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */ - x4->params.rc.f_qblur = avctx->qblur; /* temporally blur quants */ + x4->params.rc.f_qcompress = avctx->qcompress; /* 0.0 => cbr, 1.0 => constant qp */ + x4->params.rc.f_qblur = avctx->qblur; /* temporally blur quants */ x4->params.rc.f_complexity_blur = avctx->complexityblur; - x4->params.i_frame_reference = avctx->refs; + x4->params.i_frame_reference = avctx->refs; - x4->params.i_width = avctx->width; - x4->params.i_height = avctx->height; - x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num; - x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den; -#if X264_BUILD >= 81 - x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den; - x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num; -#endif - - x4->params.analyse.inter = 0; - if (avctx->partitions) { - if (avctx->partitions & X264_PART_I4X4) + x4->params.i_width = avctx->width; + x4->params.i_height = avctx->height; + x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num; + x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den; + x4->params.i_fps_num = avctx->time_base.den; + x4->params.i_fps_den = avctx->time_base.num; + + x4->params.analyse.inter = 0; + if(avctx->partitions){ + if(avctx->partitions & X264_PART_I4X4) x4->params.analyse.inter |= X264_ANALYSE_I4x4; - if (avctx->partitions & X264_PART_I8X8) + if(avctx->partitions & X264_PART_I8X8) x4->params.analyse.inter |= X264_ANALYSE_I8x8; - if (avctx->partitions & X264_PART_P8X8) + if(avctx->partitions & X264_PART_P8X8) x4->params.analyse.inter |= X264_ANALYSE_PSUB16x16; - if (avctx->partitions & X264_PART_P4X4) + if(avctx->partitions & X264_PART_P4X4) x4->params.analyse.inter |= X264_ANALYSE_PSUB8x8; - if (avctx->partitions & X264_PART_B8X8) + if(avctx->partitions & X264_PART_B8X8) x4->params.analyse.inter |= X264_ANALYSE_BSUB16x16; } - x4->params.analyse.i_direct_mv_pred = avctx->directpred; + x4->params.analyse.i_direct_mv_pred = avctx->directpred; x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED; -#if X264_BUILD >= 79 - x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred; -#endif - if (avctx->me_method == ME_EPZS) + if(avctx->me_method == ME_EPZS) x4->params.analyse.i_me_method = X264_ME_DIA; - else if (avctx->me_method == ME_HEX) + else if(avctx->me_method == ME_HEX) x4->params.analyse.i_me_method = X264_ME_HEX; - else if (avctx->me_method == ME_UMH) + else if(avctx->me_method == ME_UMH) x4->params.analyse.i_me_method = X264_ME_UMH; - else if (avctx->me_method == ME_FULL) + else if(avctx->me_method == ME_FULL) x4->params.analyse.i_me_method = X264_ME_ESA; - else if (avctx->me_method == ME_TESA) + else if(avctx->me_method == ME_TESA) x4->params.analyse.i_me_method = X264_ME_TESA; else x4->params.analyse.i_me_method = X264_ME_HEX; - x4->params.analyse.i_me_range = avctx->me_range; - x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; + x4->params.analyse.i_me_range = avctx->me_range; + x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; - x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS; - x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA; - x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT; - x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP; + x4->params.analyse.b_mixed_references = + avctx->flags2 & CODEC_FLAG2_MIXED_REFS; + x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA; + x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT; + x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP; - x4->params.analyse.i_trellis = avctx->trellis; - x4->params.analyse.i_noise_reduction = avctx->noise_reduction; + x4->params.analyse.i_trellis = avctx->trellis; + x4->params.analyse.i_noise_reduction = avctx->noise_reduction; - if (avctx->level > 0) - x4->params.i_level_idc = avctx->level; + if(avctx->level > 0) x4->params.i_level_idc = avctx->level; x4->params.rc.f_rate_tolerance = (float)avctx->bit_rate_tolerance/avctx->bit_rate; - if ((avctx->rc_buffer_size != 0) && - (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) { + if((avctx->rc_buffer_size != 0) && + (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)){ x4->params.rc.f_vbv_buffer_init = - (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size; - } else - x4->params.rc.f_vbv_buffer_init = 0.9; - -#if X264_BUILD >= 69 - x4->params.rc.b_mb_tree = !!(avctx->flags2 & CODEC_FLAG2_MBTREE); -#endif - x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor); - x4->params.rc.f_pb_factor = avctx->b_quant_factor; + (float)avctx->rc_initial_buffer_occupancy/avctx->rc_buffer_size; + } + else x4->params.rc.f_vbv_buffer_init = 0.9; + + x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor); + x4->params.rc.f_pb_factor = avctx->b_quant_factor; x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR; - x4->params.i_log_level = X264_LOG_DEBUG; + x4->params.i_log_level = X264_LOG_DEBUG; - x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD; + x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD; - x4->params.i_threads = avctx->thread_count; + x4->params.i_threads = avctx->thread_count; - x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT; + x4->params.b_interlaced = avctx->flags & CODEC_FLAG_INTERLACED_DCT; - if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) + if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){ x4->params.b_repeat_headers = 0; + } x4->enc = x264_encoder_open(&x4->params); - if (!x4->enc) + if(!x4->enc) return -1; avctx->coded_frame = &x4->out_pic; -#if X264_BUILD >= 76 - if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { - x264_nal_t *nal; - int nnal, s; - - s = x264_encoder_headers(x4->enc, &nal, &nnal); - - avctx->extradata = av_malloc(s); - avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1); - } -#else if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){ x264_nal_t *nal; int nnal, i, s = 0; @@ -352,26 +280,25 @@ x264_encoder_headers(x4->enc, &nal, &nnal); /* 5 bytes NAL header + worst case escaping */ - for (i = 0; i < nnal; i++) - s += 5 + nal[i].i_payload * 4 / 3; + for(i = 0; i < nnal; i++) + s += 5 + nal[i].i_payload * 4 / 3; avctx->extradata = av_malloc(s); - avctx->extradata_size = encode_nals(avctx, avctx->extradata, s, nal, nnal, 1); + avctx->extradata_size = encode_nals(avctx->extradata, s, nal, nnal); } -#endif return 0; } AVCodec libx264_encoder = { - .name = "libx264", - .type = CODEC_TYPE_VIDEO, - .id = CODEC_ID_H264, + .name = "libx264", + .type = CODEC_TYPE_VIDEO, + .id = CODEC_ID_H264, .priv_data_size = sizeof(X264Context), - .init = X264_init, - .encode = X264_frame, - .close = X264_close, - .capabilities = CODEC_CAP_DELAY, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE }, - .long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + .init = X264_init, + .encode = X264_frame, + .close = X264_close, + .capabilities = CODEC_CAP_DELAY, + .pix_fmts = (enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE }, + .long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), }; diff -Nru ffmpeg-0.5.2/libavcodec/mlpdec.c ffmpeg-0.5+svn20090706/libavcodec/mlpdec.c --- ffmpeg-0.5.2/libavcodec/mlpdec.c 2010-08-17 20:10:43.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/mlpdec.c 2009-03-01 23:18:33.000000000 -0600 @@ -878,7 +878,7 @@ length = (AV_RB16(buf) & 0xfff) * 2; - if (length < 4 || length > buf_size) + if (length > buf_size) return -1; init_get_bits(&gb, (buf + 4), (length - 4) * 8); diff -Nru ffmpeg-0.5.2/libavcodec/mpegaudiodec.c ffmpeg-0.5+svn20090706/libavcodec/mpegaudiodec.c --- ffmpeg-0.5.2/libavcodec/mpegaudiodec.c 2010-08-17 20:10:43.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/mpegaudiodec.c 2009-02-22 07:48:55.000000000 -0600 @@ -2287,10 +2287,6 @@ avctx->bit_rate = s->bit_rate; avctx->sub_id = s->layer; - if(*data_size < 1152*avctx->channels*sizeof(OUT_INT)) - return -1; - *data_size = 0; - if(s->frame_size<=0 || s->frame_size > buf_size){ av_log(avctx, AV_LOG_ERROR, "incomplete frame\n"); return -1; @@ -2474,9 +2470,6 @@ OUT_INT *outptr, *bp; int fr, j, n; - if(*data_size < MPA_FRAME_SIZE * MPA_MAX_CHANNELS * s->frames * sizeof(OUT_INT)) - return -1; - *data_size = 0; // Discard too short frames if (buf_size < HEADER_SIZE) diff -Nru ffmpeg-0.5.2/libavcodec/options.c ffmpeg-0.5+svn20090706/libavcodec/options.c --- ffmpeg-0.5.2/libavcodec/options.c 2010-08-17 20:10:42.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/options.c 2009-03-31 16:06:20.000000000 -0500 @@ -122,7 +122,6 @@ {"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E}, {"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E}, {"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E}, -{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, 0, INT_MIN, INT_MAX, V|E}, {"hurry_up", NULL, OFFSET(hurry_up), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|D}, {"ps", "rtp payload size in bits", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, V|E}, {"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, @@ -389,7 +388,6 @@ {"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|D}, {"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, 1.0, 0.0, 1.0, A|D}, {"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BIT_RESERVOIR, INT_MIN, INT_MAX, A|E, "flags2"}, -{"mbtree", "use macroblock tree ratecontrol (x264 only)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_MBTREE, INT_MIN, INT_MAX, V|E, "flags2"}, {"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"channel_layout", NULL, OFFSET(channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|E|D, "channel_layout"}, {"request_channel_layout", NULL, OFFSET(request_channel_layout), FF_OPT_TYPE_INT64, DEFAULT, 0, INT64_MAX, A|D, "request_channel_layout"}, diff -Nru ffmpeg-0.5.2/libavcodec/ppc/check_altivec.c ffmpeg-0.5+svn20090706/libavcodec/ppc/check_altivec.c --- ffmpeg-0.5.2/libavcodec/ppc/check_altivec.c 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/ppc/check_altivec.c 2009-01-31 20:00:19.000000000 -0600 @@ -63,7 +63,7 @@ if (err == 0) return has_vu != 0; return 0; -#elif CONFIG_RUNTIME_CPUDETECT +#elif defined(RUNTIME_CPUDETECT) int proc_ver; // Support of mfspr PVR emulation added in Linux 2.6.17. __asm__ volatile("mfspr %0, 287" : "=r" (proc_ver)); diff -Nru ffmpeg-0.5.2/libavcodec/snow.c ffmpeg-0.5+svn20090706/libavcodec/snow.c --- ffmpeg-0.5.2/libavcodec/snow.c 2010-08-17 20:10:41.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/snow.c 2009-01-18 16:57:40.000000000 -0600 @@ -1626,7 +1626,6 @@ s->b_width = w; s->b_height= h; - av_free(s->block); s->block= av_mallocz(w * h * sizeof(BlockNode) << (s->block_max_depth*2)); return 0; } @@ -3555,7 +3554,7 @@ } static int decode_header(SnowContext *s){ - int plane_index, tmp; + int plane_index; uint8_t kstate[32]; memset(kstate, MID_STATE, sizeof(kstate)); @@ -3584,12 +3583,7 @@ s->chroma_v_shift= get_symbol(&s->c, s->header_state, 0); s->spatial_scalability= get_rac(&s->c, s->header_state); // s->rate_scalability= get_rac(&s->c, s->header_state); - tmp= get_symbol(&s->c, s->header_state, 0)+1; - if(tmp < 1 || tmp > MAX_REF_FRAMES){ - av_log(s->avctx, AV_LOG_ERROR, "reference frame count is %d\n", tmp); - return -1; - } - s->max_ref_frames= tmp; + s->max_ref_frames= get_symbol(&s->c, s->header_state, 0)+1; decode_qlogs(s); } @@ -3655,7 +3649,6 @@ int i, j; s->avctx= avctx; - s->max_ref_frames=1; //just make sure its not an invalid value in case of no initial keyframe dsputil_init(&s->dsp, avctx); @@ -4516,7 +4509,7 @@ && p->hcoeff[2]==2; } - alloc_blocks(s); + if(!s->block) alloc_blocks(s); frame_start(s); //keyframe flag duplication mess FIXME diff -Nru ffmpeg-0.5.2/libavcodec/utils.c ffmpeg-0.5+svn20090706/libavcodec/utils.c --- ffmpeg-0.5.2/libavcodec/utils.c 2010-08-17 20:10:42.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/utils.c 2009-02-24 12:51:16.000000000 -0600 @@ -65,8 +65,6 @@ }; static int volatile entangled_thread_counter=0; -int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op); -static void *codec_mutex; void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size) { @@ -422,12 +420,6 @@ { int ret= -1; - /* If there is a user-supplied mutex locking routine, call it. */ - if (ff_lockmgr_cb) { - if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN)) - return -1; - } - entangled_thread_counter++; if(entangled_thread_counter != 1){ av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); @@ -472,11 +464,6 @@ ret=0; end: entangled_thread_counter--; - - /* Release any user-supplied mutex. */ - if (ff_lockmgr_cb) { - (*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE); - } return ret; } @@ -596,12 +583,6 @@ int avcodec_close(AVCodecContext *avctx) { - /* If there is a user-supplied mutex locking routine, call it. */ - if (ff_lockmgr_cb) { - if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN)) - return -1; - } - entangled_thread_counter++; if(entangled_thread_counter != 1){ av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); @@ -617,11 +598,6 @@ av_freep(&avctx->priv_data); avctx->codec = NULL; entangled_thread_counter--; - - /* Release any user-supplied mutex. */ - if (ff_lockmgr_cb) { - (*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE); - } return 0; } @@ -1176,19 +1152,3 @@ } return NULL; } - -int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) -{ - if (ff_lockmgr_cb) { - if (ff_lockmgr_cb(&codec_mutex, AV_LOCK_DESTROY)) - return -1; - } - - ff_lockmgr_cb = cb; - - if (ff_lockmgr_cb) { - if (ff_lockmgr_cb(&codec_mutex, AV_LOCK_CREATE)) - return -1; - } - return 0; -} diff -Nru ffmpeg-0.5.2/libavcodec/vorbis.c ffmpeg-0.5+svn20090706/libavcodec/vorbis.c --- ffmpeg-0.5.2/libavcodec/vorbis.c 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/vorbis.c 2009-01-31 20:00:19.000000000 -0600 @@ -45,9 +45,6 @@ // Generate vlc codes from vorbis huffman code lengths -// the two bits[p] > 32 checks should be redundant, all calling code should -// already ensure that, but since it allows overwriting the stack it seems -// reasonable to check redundantly. int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num) { uint_fast32_t exit_at_level[33]={404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; @@ -66,7 +63,6 @@ } codes[p]=0; - if (bits[p] > 32) return 1; for(i=0;i 32) return 1; if (bits[p]==0) continue; // find corresponding exit(node which the tree can grow further from) for(i=bits[p];i>0;--i) { diff -Nru ffmpeg-0.5.2/libavcodec/vorbis_dec.c ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c --- ffmpeg-0.5.2/libavcodec/vorbis_dec.c 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/vorbis_dec.c 2009-01-31 20:00:19.000000000 -0600 @@ -37,7 +37,6 @@ #define V_NB_BITS 8 #define V_NB_BITS2 11 #define V_MAX_VLCS (1<<16) -#define V_MAX_PARTITIONS (1<<20) #ifndef V_DEBUG #define AV_DEBUG(...) @@ -250,8 +249,8 @@ } codebook_setup->dimensions=get_bits(gb, 16); - if (codebook_setup->dimensions>16||codebook_setup->dimensions==0) { - av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is invalid (%d). \n", cb, codebook_setup->dimensions); + if (codebook_setup->dimensions>16) { + av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is too large (%d). \n", cb, codebook_setup->dimensions); goto error; } entries=get_bits(gb, 24); @@ -493,23 +492,13 @@ AV_DEBUG(" %d floor %d class dim: %d subclasses %d \n", i, j, floor_setup->data.t1.class_dimensions[j], floor_setup->data.t1.class_subclasses[j]); if (floor_setup->data.t1.class_subclasses[j]) { - int bits=get_bits(gb, 8); - if (bits>=vc->codebook_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "Masterbook index %d is out of range.\n", bits); - return 1; - } - floor_setup->data.t1.class_masterbook[j]=bits; + floor_setup->data.t1.class_masterbook[j]=get_bits(gb, 8); AV_DEBUG(" masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]); } for(k=0;k<(1<data.t1.class_subclasses[j]);++k) { - int16_t bits=get_bits(gb, 8)-1; - if (bits!=-1 && bits>=vc->codebook_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "Subclass book index %d is out of range.\n", bits); - return 1; - } - floor_setup->data.t1.subclass_books[j][k]=bits; + floor_setup->data.t1.subclass_books[j][k]=(int16_t)get_bits(gb, 8)-1; AV_DEBUG(" book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]); } @@ -569,11 +558,12 @@ uint_fast8_t book_idx; for (idx=0;idxdata.t0.num_books;++idx) { book_idx=get_bits(gb, 8); - if (book_idx>=vc->codebook_count) - return 1; floor_setup->data.t0.book_list[idx]=book_idx; if (vc->codebooks[book_idx].dimensions > max_codebook_dim) max_codebook_dim=vc->codebooks[book_idx].dimensions; + + if (floor_setup->data.t0.book_list[idx]>vc->codebook_count) + return 1; } } @@ -644,20 +634,8 @@ res_setup->begin=get_bits(gb, 24); res_setup->end=get_bits(gb, 24); res_setup->partition_size=get_bits(gb, 24)+1; - /* Validations to prevent a buffer overflow later. */ - if (res_setup->begin>res_setup->end - || res_setup->end>vc->blocksize[1]/(res_setup->type==2?1:2) - || (res_setup->end-res_setup->begin)/res_setup->partition_size>V_MAX_PARTITIONS) { - av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %d, %d, %d, %d, %d\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1]/2); - return 1; - } - res_setup->classifications=get_bits(gb, 6)+1; res_setup->classbook=get_bits(gb, 8); - if (res_setup->classbook>=vc->codebook_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "classbook value %d out of range. \n", res_setup->classbook); - return 1; - } AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size, res_setup->classifications, res_setup->classbook); @@ -677,12 +655,7 @@ for(j=0;jclassifications;++j) { for(k=0;k<8;++k) { if (cascade[j]&(1<=vc->codebook_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "book value %d out of range. \n", bits); - return 1; - } - res_setup->books[j][k]=bits; + res_setup->books[j][k]=get_bits(gb, 8); AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]); @@ -729,14 +702,7 @@ for(j=0;jcoupling_steps;++j) { mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1)); mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1)); - if (mapping_setup->magnitude[j]>=vc->audio_channels) { - av_log(vc->avccontext, AV_LOG_ERROR, "magnitude channel %d out of range. \n", mapping_setup->magnitude[j]); - return 1; - } - if (mapping_setup->angle[j]>=vc->audio_channels) { - av_log(vc->avccontext, AV_LOG_ERROR, "angle channel %d out of range. \n", mapping_setup->angle[j]); - return 1; - } + // FIXME: sanity checks } } else { mapping_setup->coupling_steps=0; @@ -757,20 +723,9 @@ } for(j=0;jsubmaps;++j) { - int bits; skip_bits(gb, 8); // FIXME check? - bits=get_bits(gb, 8); - if (bits>=vc->floor_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "submap floor value %d out of range. \n", bits); - return -1; - } - mapping_setup->submap_floor[j]=bits; - bits=get_bits(gb, 8); - if (bits>=vc->residue_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "submap residue value %d out of range. \n", bits); - return -1; - } - mapping_setup->submap_residue[j]=bits; + mapping_setup->submap_floor[j]=get_bits(gb, 8); + mapping_setup->submap_residue[j]=get_bits(gb, 8); AV_DEBUG(" %d mapping %d submap : floor %d, residue %d \n", i, j, mapping_setup->submap_floor[j], mapping_setup->submap_residue[j]); } @@ -833,11 +788,7 @@ mode_setup->blockflag=get_bits1(gb); mode_setup->windowtype=get_bits(gb, 16); //FIXME check mode_setup->transformtype=get_bits(gb, 16); //FIXME check - mode_setup->mapping=get_bits(gb, 8); - if (mode_setup->mapping>=vc->mapping_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "mode mapping value %d out of range. \n", mode_setup->mapping); - return 1; - } + mode_setup->mapping=get_bits(gb, 8); //FIXME check AV_DEBUG(" %d mode: blockflag %d, windowtype %d, transformtype %d, mapping %d \n", i, mode_setup->blockflag, mode_setup->windowtype, mode_setup->transformtype, mode_setup->mapping); } @@ -902,16 +853,8 @@ } vc->version=get_bits_long(gb, 32); //FIXME check 0 - vc->audio_channels=get_bits(gb, 8); - if(vc->audio_channels <= 0){ - av_log(vc->avccontext, AV_LOG_ERROR, "Invalid number of channels\n"); - return -1; - } - vc->audio_samplerate=get_bits_long(gb, 32); - if(vc->audio_samplerate <= 0){ - av_log(vc->avccontext, AV_LOG_ERROR, "Invalid samplerate\n"); - return -1; - } + vc->audio_channels=get_bits(gb, 8); //FIXME check >0 + vc->audio_samplerate=get_bits_long(gb, 32); //FIXME check >0 vc->bitrate_maximum=get_bits_long(gb, 32); vc->bitrate_nominal=get_bits_long(gb, 32); vc->bitrate_minimum=get_bits_long(gb, 32); @@ -1505,10 +1448,6 @@ } else { mode_number=get_bits(gb, ilog(vc->mode_count-1)); } - if (mode_number>=vc->mode_count) { - av_log(vc->avccontext, AV_LOG_ERROR, "mode number %d out of range.\n", mode_number); - return -1; - } vc->mode_number=mode_number; mapping=&vc->mappings[vc->modes[mode_number].mapping]; @@ -1553,7 +1492,7 @@ uint_fast8_t ch=0; for(j=0;jaudio_channels;++j) { - if ((mapping->submaps==1) || (i==mapping->mux[j])) { + if ((mapping->submaps==1) || (i=mapping->mux[j])) { res_chan[j]=res_num; if (no_residue[j]) { do_not_decode[ch]=1; diff -Nru ffmpeg-0.5.2/libavcodec/vp3.c ffmpeg-0.5+svn20090706/libavcodec/vp3.c --- ffmpeg-0.5.2/libavcodec/vp3.c 2010-08-17 20:10:43.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavcodec/vp3.c 2009-02-22 07:48:55.000000000 -0600 @@ -43,8 +43,6 @@ #define FRAGMENT_PIXELS 8 -static av_cold int vp3_decode_end(AVCodecContext *avctx); - typedef struct Coeff { struct Coeff *next; DCTELEM coeff; @@ -1686,11 +1684,6 @@ s->coeffs = av_malloc(s->fragment_count * sizeof(Coeff) * 65); s->coded_fragment_list = av_malloc(s->fragment_count * sizeof(int)); s->pixel_addresses_initialized = 0; - if (!s->superblock_coding || !s->all_fragments || !s->coeff_counts || - !s->coeffs || !s->coded_fragment_list) { - vp3_decode_end(avctx); - return -1; - } if (!s->theora_tables) { @@ -1744,34 +1737,29 @@ for (i = 0; i < 16; i++) { /* DC histograms */ - if (init_vlc(&s->dc_vlc[i], 5, 32, + init_vlc(&s->dc_vlc[i], 5, 32, &s->huffman_table[i][0][1], 4, 2, - &s->huffman_table[i][0][0], 4, 2, 0) < 0) - goto vlc_fail; + &s->huffman_table[i][0][0], 4, 2, 0); /* group 1 AC histograms */ - if (init_vlc(&s->ac_vlc_1[i], 5, 32, + init_vlc(&s->ac_vlc_1[i], 5, 32, &s->huffman_table[i+16][0][1], 4, 2, - &s->huffman_table[i+16][0][0], 4, 2, 0) < 0) - goto vlc_fail; + &s->huffman_table[i+16][0][0], 4, 2, 0); /* group 2 AC histograms */ - if (init_vlc(&s->ac_vlc_2[i], 5, 32, + init_vlc(&s->ac_vlc_2[i], 5, 32, &s->huffman_table[i+16*2][0][1], 4, 2, - &s->huffman_table[i+16*2][0][0], 4, 2, 0) < 0) - goto vlc_fail; + &s->huffman_table[i+16*2][0][0], 4, 2, 0); /* group 3 AC histograms */ - if (init_vlc(&s->ac_vlc_3[i], 5, 32, + init_vlc(&s->ac_vlc_3[i], 5, 32, &s->huffman_table[i+16*3][0][1], 4, 2, - &s->huffman_table[i+16*3][0][0], 4, 2, 0) < 0) - goto vlc_fail; + &s->huffman_table[i+16*3][0][0], 4, 2, 0); /* group 4 AC histograms */ - if (init_vlc(&s->ac_vlc_4[i], 5, 32, + init_vlc(&s->ac_vlc_4[i], 5, 32, &s->huffman_table[i+16*4][0][1], 4, 2, - &s->huffman_table[i+16*4][0][0], 4, 2, 0) < 0) - goto vlc_fail; + &s->huffman_table[i+16*4][0][0], 4, 2, 0); } } @@ -1796,11 +1784,6 @@ s->superblock_macroblocks = av_malloc(s->superblock_count * 4 * sizeof(int)); s->macroblock_fragments = av_malloc(s->macroblock_count * 6 * sizeof(int)); s->macroblock_coding = av_malloc(s->macroblock_count + 1); - if (!s->superblock_fragments || !s->superblock_macroblocks || - !s->macroblock_fragments || !s->macroblock_coding) { - vp3_decode_end(avctx); - return -1; - } init_block_mapping(s); for (i = 0; i < 3; i++) { @@ -1810,10 +1793,6 @@ } return 0; - -vlc_fail: - av_log(avctx, AV_LOG_FATAL, "Invalid huffman table\n"); - return -1; } /* @@ -2252,7 +2231,7 @@ } for(i=0;i<3;i++) { - init_get_bits(&gb, header_start[i], header_len[i] * 8); + init_get_bits(&gb, header_start[i], header_len[i]); ptype = get_bits(&gb, 8); diff -Nru ffmpeg-0.5.2/libavdevice/libavdevice.v ffmpeg-0.5+svn20090706/libavdevice/libavdevice.v --- ffmpeg-0.5.2/libavdevice/libavdevice.v 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavdevice/libavdevice.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,4 +0,0 @@ -LIBAVDEVICE_$MAJOR { - global: avdevice_*; - local: *; -}; diff -Nru ffmpeg-0.5.2/libavfilter/libavfilter.v ffmpeg-0.5+svn20090706/libavfilter/libavfilter.v --- ffmpeg-0.5.2/libavfilter/libavfilter.v 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavfilter/libavfilter.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,4 +0,0 @@ -LIBAVFILTER_$MAJOR { - global: avfilter_*; av_*; - local: *; -}; diff -Nru ffmpeg-0.5.2/libavformat/asfdec.c ffmpeg-0.5+svn20090706/libavformat/asfdec.c --- ffmpeg-0.5.2/libavformat/asfdec.c 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/asfdec.c 2009-03-31 16:06:20.000000000 -0500 @@ -212,7 +212,7 @@ asf->hdr.min_pktsize = get_le32(pb); asf->hdr.max_pktsize = get_le32(pb); asf->hdr.max_bitrate = get_le32(pb); - s->packet_size = asf->hdr.max_pktsize; + asf->packet_size = asf->hdr.max_pktsize; } else if (!memcmp(&g, &ff_asf_stream_header, sizeof(GUID))) { enum CodecType type; int type_specific_size, sizeX; @@ -555,9 +555,7 @@ int rsize = 8; int c, d, e, off; - off= 32768; - if (s->packet_size > 0) - off= (url_ftell(pb) - s->data_offset) % s->packet_size + 3; + off= (url_ftell(pb) - s->data_offset) % asf->packet_size + 3; c=d=e=-1; while(off-- > 0){ @@ -587,12 +585,12 @@ asf->packet_flags = c; asf->packet_property = d; - DO_2BITS(asf->packet_flags >> 5, packet_length, s->packet_size); + DO_2BITS(asf->packet_flags >> 5, packet_length, asf->packet_size); DO_2BITS(asf->packet_flags >> 1, padsize, 0); // sequence ignored DO_2BITS(asf->packet_flags >> 3, padsize, 0); // padding length //the following checks prevent overflows and infinite loops - if(!packet_length || packet_length >= (1U<<29)){ + if(packet_length >= (1U<<29)){ av_log(s, AV_LOG_ERROR, "invalid packet_length %d at:%"PRId64"\n", packet_length, url_ftell(pb)); return -1; } @@ -616,7 +614,7 @@ if (packet_length < asf->hdr.min_pktsize) padsize += asf->hdr.min_pktsize - packet_length; asf->packet_padsize = padsize; - dprintf(s, "packet: size=%d padsize=%d left=%d\n", s->packet_size, asf->packet_padsize, asf->packet_size_left); + dprintf(s, "packet: size=%d padsize=%d left=%d\n", asf->packet_size, asf->packet_padsize, asf->packet_size_left); return 0; } @@ -788,7 +786,7 @@ /* read data */ //printf("READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n", - // s->packet_size, asf_st->pkt.size, asf->packet_frag_offset, + // asf->packet_size, asf_st->pkt.size, asf->packet_frag_offset, // asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data); asf->packet_size_left -= asf->packet_frag_size; if (asf->packet_size_left < 0) @@ -931,6 +929,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit) { + ASFContext *asf = s->priv_data; AVPacket pkt1, *pkt = &pkt1; ASFStream *asf_st; int64_t pts; @@ -942,8 +941,7 @@ start_pos[i]= pos; } - if (s->packet_size > 0) - pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset; + pos= (pos+asf->packet_size-1-s->data_offset)/asf->packet_size*asf->packet_size+ s->data_offset; *ppos= pos; url_fseek(s->pb, pos, SEEK_SET); @@ -963,7 +961,7 @@ asf_st= s->streams[i]->priv_data; -// assert((asf_st->packet_pos - s->data_offset) % s->packet_size == 0); +// assert((asf_st->packet_pos - s->data_offset) % asf->packet_size == 0); pos= asf_st->packet_pos; av_add_index_entry(s->streams[i], pos, pts, pkt->size, pos - start_pos[i] + 1, AVINDEX_KEYFRAME); @@ -1006,10 +1004,10 @@ int pktct =get_le16(s->pb); av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d\n", pktnum, pktct); - pos=s->data_offset + s->packet_size*(int64_t)pktnum; + pos=s->data_offset + asf->packet_size*(int64_t)pktnum; index_pts=av_rescale(itime, i, 10000); - av_add_index_entry(s->streams[stream_index], pos, index_pts, s->packet_size, 0, AVINDEX_KEYFRAME); + av_add_index_entry(s->streams[stream_index], pos, index_pts, asf->packet_size, 0, AVINDEX_KEYFRAME); } asf->index_read= 1; } @@ -1023,7 +1021,7 @@ int64_t pos; int index; - if (s->packet_size <= 0) + if (asf->packet_size <= 0) return -1; /* Try using the protocol's read_seek if available */ diff -Nru ffmpeg-0.5.2/libavformat/asfenc.c ffmpeg-0.5+svn20090706/libavformat/asfenc.c --- ffmpeg-0.5.2/libavformat/asfenc.c 2010-08-17 20:10:43.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/asfenc.c 2009-03-31 16:06:20.000000000 -0500 @@ -321,8 +321,8 @@ put_le64(pb, asf->duration); /* duration (in 100ns units) */ put_le64(pb, PREROLL_TIME); /* start time stamp */ put_le32(pb, (asf->is_streamed || url_is_streamed(pb)) ? 3 : 2); /* ??? */ - put_le32(pb, s->packet_size); /* packet size */ - put_le32(pb, s->packet_size); /* packet size */ + put_le32(pb, asf->packet_size); /* packet size */ + put_le32(pb, asf->packet_size); /* packet size */ put_le32(pb, bit_rate); /* Nominal data rate in bps */ end_header(pb, hpos); @@ -514,7 +514,7 @@ { ASFContext *asf = s->priv_data; - s->packet_size = PACKET_SIZE; + asf->packet_size = PACKET_SIZE; asf->nb_packets = 0; asf->last_indexed_pts = 0; @@ -536,7 +536,7 @@ asf->packet_nb_payloads = 0; asf->packet_timestamp_start = -1; asf->packet_timestamp_end = -1; - init_put_byte(&asf->pb, asf->packet_buf, s->packet_size, 1, + init_put_byte(&asf->pb, asf->packet_buf, asf->packet_size, 1, NULL, NULL, NULL, NULL); return 0; @@ -612,7 +612,7 @@ assert(asf->packet_timestamp_end >= asf->packet_timestamp_start); if (asf->is_streamed) { - put_chunk(s, 0x4424, s->packet_size, 0); + put_chunk(s, 0x4424, asf->packet_size, 0); } packet_hdr_size = put_payload_parsing_info( @@ -627,14 +627,14 @@ assert(packet_hdr_size <= asf->packet_size_left); memset(asf->packet_buf + packet_filled_size, 0, asf->packet_size_left); - put_buffer(s->pb, asf->packet_buf, s->packet_size - packet_hdr_size); + put_buffer(s->pb, asf->packet_buf, asf->packet_size - packet_hdr_size); put_flush_packet(s->pb); asf->nb_packets++; asf->packet_nb_payloads = 0; asf->packet_timestamp_start = -1; asf->packet_timestamp_end = -1; - init_put_byte(&asf->pb, asf->packet_buf, s->packet_size, 1, + init_put_byte(&asf->pb, asf->packet_buf, asf->packet_size, 1, NULL, NULL, NULL, NULL); } diff -Nru ffmpeg-0.5.2/libavformat/asf.h ffmpeg-0.5+svn20090706/libavformat/asf.h --- ffmpeg-0.5.2/libavformat/asf.h 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/asf.h 2009-02-28 18:12:08.000000000 -0600 @@ -80,6 +80,7 @@ typedef struct { uint32_t seqno; + unsigned int packet_size; int is_streamed; int asfid2avid[128]; ///< conversion table from asf ID 2 AVStream ID ASFStream streams[128]; ///< it's max number and it's not that big diff -Nru ffmpeg-0.5.2/libavformat/avformat.h ffmpeg-0.5+svn20090706/libavformat/avformat.h --- ffmpeg-0.5.2/libavformat/avformat.h 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/avformat.h 2009-03-01 10:35:25.000000000 -0600 @@ -1035,7 +1035,7 @@ * @param pts_den denominator to convert to seconds (MPEG: 90000) */ void av_set_pts_info(AVStream *s, int pts_wrap_bits, - unsigned int pts_num, unsigned int pts_den); + int pts_num, int pts_den); #define AVSEEK_FLAG_BACKWARD 1 ///< seek backward #define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes diff -Nru ffmpeg-0.5.2/libavformat/libavformat.v ffmpeg-0.5+svn20090706/libavformat/libavformat.v --- ffmpeg-0.5.2/libavformat/libavformat.v 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/libavformat.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,3 +0,0 @@ -LIBAVFORMAT_$MAJOR { - global: *; -}; diff -Nru ffmpeg-0.5.2/libavformat/mov.c ffmpeg-0.5+svn20090706/libavformat/mov.c --- ffmpeg-0.5.2/libavformat/mov.c 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/mov.c 2009-03-01 10:06:26.000000000 -0600 @@ -238,15 +238,10 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; int entries, i, j; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_be32(pb); // version + flags entries = get_be32(pb); if (entries >= UINT_MAX / sizeof(*sc->drefs)) @@ -386,13 +381,9 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; int tag, len; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - get_be32(pb); /* version + flags */ len = mp4_read_descr(c, pb, &tag); if (tag == MP4ESDescrTag) { @@ -449,12 +440,7 @@ { const int num = get_be32(pb); const int den = get_be32(pb); - AVStream *st; - - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - + AVStream * const st = c->fc->streams[c->fc->nb_streams-1]; if (den != 0) { if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default (den != st->sample_aspect_ratio.den || num != st->sample_aspect_ratio.num)) @@ -508,18 +494,12 @@ static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; - int version; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; + int version = get_byte(pb); char language[4] = {0}; unsigned lang; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - - version = get_byte(pb); if (version > 1) return -1; /* unsupported */ @@ -581,11 +561,7 @@ static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; if((uint64_t)atom.size > (1<<30)) return -1; @@ -605,14 +581,9 @@ static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - int little_endian; - - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + int little_endian = get_be16(pb); - little_endian = get_be16(pb); dprintf(c->fc, "enda %d\n", little_endian); if (little_endian == 1) { switch (st->codec->codec_id) { @@ -662,11 +633,7 @@ static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; if((uint64_t)atom.size > (1<<30)) return -1; @@ -693,11 +660,7 @@ */ static int mov_read_glbl(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; if((uint64_t)atom.size > (1<<30)) return -1; @@ -713,15 +676,10 @@ static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; unsigned int i, entries; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ @@ -784,15 +742,10 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; int j, entries, pseudo_stream_id; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ @@ -1111,15 +1064,10 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; unsigned int i, entries; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ @@ -1144,15 +1092,10 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; unsigned int i, entries; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ @@ -1176,15 +1119,10 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; unsigned int i, entries, sample_size; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ @@ -1212,17 +1150,12 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; unsigned int i, entries; int64_t duration=0; int64_t total_sample_count=0; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ entries = get_be32(pb); @@ -1261,15 +1194,10 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st; - MOVStreamContext *sc; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; unsigned int i, entries; - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ entries = get_be32(pb); @@ -1576,16 +1504,10 @@ int height; int64_t disp_transform[2]; int display_matrix[3][2]; - AVStream *st; - MOVStreamContext *sc; - int version; - - if (c->fc->nb_streams < 1) - return 0; - st = c->fc->streams[c->fc->nb_streams-1]; - sc = st->priv_data; + AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + MOVStreamContext *sc = st->priv_data; + int version = get_byte(pb); - version = get_byte(pb); get_be24(pb); /* flags */ /* MOV_TRACK_ENABLED 0x0001 @@ -1854,13 +1776,9 @@ /* edit list atom */ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - MOVStreamContext *sc; + MOVStreamContext *sc = c->fc->streams[c->fc->nb_streams-1]->priv_data; int i, edit_count; - if (c->fc->nb_streams < 1) - return 0; - sc = c->fc->streams[c->fc->nb_streams-1]->priv_data; - get_byte(pb); /* version */ get_be24(pb); /* flags */ edit_count = get_be32(pb); /* entries */ diff -Nru ffmpeg-0.5.2/libavformat/oggdec.c ffmpeg-0.5+svn20090706/libavformat/oggdec.c --- ffmpeg-0.5.2/libavformat/oggdec.c 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/oggdec.c 2009-02-14 07:44:21.000000000 -0600 @@ -477,17 +477,12 @@ ogg_read_header (AVFormatContext * s, AVFormatParameters * ap) { struct ogg *ogg = s->priv_data; - int i; ogg->curidx = -1; //linear headers seek from start if (ogg_get_headers (s) < 0){ return -1; } - for (i = 0; i < ogg->nstreams; i++) - if (ogg->streams[i].header < 0) - ogg->streams[i].codec = NULL; - //linear granulepos seek from end ogg_get_length (s); diff -Nru ffmpeg-0.5.2/libavformat/oggparsevorbis.c ffmpeg-0.5+svn20090706/libavformat/oggparsevorbis.c --- ffmpeg-0.5.2/libavformat/oggparsevorbis.c 2010-08-17 20:10:43.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/oggparsevorbis.c 2009-02-12 15:39:37.000000000 -0600 @@ -35,28 +35,27 @@ { const uint8_t *p = buf; const uint8_t *end = buf + size; - unsigned n, j; - int s; + unsigned s, n, j; if (size < 8) /* must have vendor_length and user_comment_list_length */ return -1; s = bytestream_get_le32(&p); - if (end - p - 4 < s || s < 0) + if (end - p < s) return -1; p += s; n = bytestream_get_le32(&p); - while (end - p >= 4 && n > 0) { + while (p < end && n > 0) { const char *t, *v; int tl, vl; s = bytestream_get_le32(&p); - if (end - p < s || s < 0) + if (end - p < s) break; t = p; diff -Nru ffmpeg-0.5.2/libavformat/utils.c ffmpeg-0.5+svn20090706/libavformat/utils.c --- ffmpeg-0.5.2/libavformat/utils.c 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavformat/utils.c 2009-03-02 14:32:24.000000000 -0600 @@ -3286,7 +3286,7 @@ } void av_set_pts_info(AVStream *s, int pts_wrap_bits, - unsigned int pts_num, unsigned int pts_den) + int pts_num, int pts_den) { unsigned int gcd= av_gcd(pts_num, pts_den); s->pts_wrap_bits = pts_wrap_bits; diff -Nru ffmpeg-0.5.2/libavutil/libavutil.v ffmpeg-0.5+svn20090706/libavutil/libavutil.v --- ffmpeg-0.5.2/libavutil/libavutil.v 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libavutil/libavutil.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,4 +0,0 @@ -LIBAVUTIL_$MAJOR { - global: av_*; ff_*; avutil_*; - local: *; -}; diff -Nru ffmpeg-0.5.2/libpostproc/libpostproc.v ffmpeg-0.5+svn20090706/libpostproc/libpostproc.v --- ffmpeg-0.5.2/libpostproc/libpostproc.v 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libpostproc/libpostproc.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,4 +0,0 @@ -LIBPOSTPROC_$MAJOR { - global: postproc_*; pp_*; - local: *; -}; diff -Nru ffmpeg-0.5.2/libpostproc/postprocess.c ffmpeg-0.5+svn20090706/libpostproc/postprocess.c --- ffmpeg-0.5.2/libpostproc/postprocess.c 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libpostproc/postprocess.c 2009-01-31 20:00:19.000000000 -0600 @@ -554,7 +554,7 @@ //Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one //Plain C versions -#if !(HAVE_MMX || HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT +#if !(HAVE_MMX || HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT) #define COMPILE_C #endif @@ -564,15 +564,15 @@ #if ARCH_X86 -#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT +#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_MMX #endif -#if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT +#if HAVE_MMX2 || defined (RUNTIME_CPUDETECT) #define COMPILE_MMX2 #endif -#if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT +#if (HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_3DNOW #endif #endif /* ARCH_X86 */ @@ -645,7 +645,7 @@ // Using ifs here as they are faster than function pointers although the // difference would not be measurable here but it is much better because // someone might exchange the CPU whithout restarting MPlayer ;) -#if CONFIG_RUNTIME_CPUDETECT +#ifdef RUNTIME_CPUDETECT #if ARCH_X86 // ordered per speed fastest first if(c->cpuCaps & PP_CPU_CAPS_MMX2) @@ -664,7 +664,7 @@ #endif postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); #endif -#else //CONFIG_RUNTIME_CPUDETECT +#else //RUNTIME_CPUDETECT #if HAVE_MMX2 postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); #elif HAVE_AMD3DNOW @@ -676,7 +676,7 @@ #else postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); #endif -#endif //!CONFIG_RUNTIME_CPUDETECT +#endif //!RUNTIME_CPUDETECT } //static void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, diff -Nru ffmpeg-0.5.2/libswscale/libswscale.v ffmpeg-0.5+svn20090706/libswscale/libswscale.v --- ffmpeg-0.5.2/libswscale/libswscale.v 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libswscale/libswscale.v 1969-12-31 18:00:00.000000000 -0600 @@ -1,3 +0,0 @@ -LIBSWSCALE_$MAJOR { - global: *; -}; diff -Nru ffmpeg-0.5.2/libswscale/swscale.c ffmpeg-0.5+svn20090706/libswscale/swscale.c --- ffmpeg-0.5.2/libswscale/swscale.c 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/libswscale/swscale.c 2009-07-05 15:35:02.000000000 -0500 @@ -955,27 +955,27 @@ //Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one //Plain C versions -#if ((!HAVE_MMX || !CONFIG_GPL) && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT +#if ((!HAVE_MMX || !CONFIG_GPL) && !HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT) #define COMPILE_C #endif #if ARCH_PPC -#if HAVE_ALTIVEC +#if HAVE_ALTIVEC || defined (RUNTIME_CPUDETECT) #define COMPILE_ALTIVEC #endif #endif //ARCH_PPC #if ARCH_X86 -#if ((HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT) && CONFIG_GPL +#if ((HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_MMX #endif -#if (HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT) && CONFIG_GPL +#if (HAVE_MMX2 || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_MMX2 #endif -#if ((HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT) && CONFIG_GPL +#if ((HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_3DNOW #endif #endif //ARCH_X86 @@ -1636,7 +1636,7 @@ static SwsFunc getSwsFunc(int flags){ -#if CONFIG_RUNTIME_CPUDETECT +#if defined(RUNTIME_CPUDETECT) #if ARCH_X86 && CONFIG_GPL // ordered per speed fastest first if (flags & SWS_CPU_CAPS_MMX2) @@ -1649,7 +1649,7 @@ return swScale_C; #else -#if ARCH_PPC && defined COMPILE_ALTIVEC +#if ARCH_PPC if (flags & SWS_CPU_CAPS_ALTIVEC) return swScale_altivec; else @@ -1657,7 +1657,7 @@ #endif return swScale_C; #endif /* ARCH_X86 && CONFIG_GPL */ -#else //CONFIG_RUNTIME_CPUDETECT +#else //RUNTIME_CPUDETECT #if HAVE_MMX2 return swScale_MMX2; #elif HAVE_AMD3DNOW @@ -1669,7 +1669,7 @@ #else return swScale_C; #endif -#endif //!CONFIG_RUNTIME_CPUDETECT +#endif //!RUNTIME_CPUDETECT } static int PlanarToNV12Wrapper(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, @@ -2193,7 +2193,7 @@ __asm__ volatile("emms\n\t"::: "memory"); #endif -#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off +#if !defined(RUNTIME_CPUDETECT) //ensure that the flags match the compiled variant if cpudetect is off flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN); #if HAVE_MMX2 flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2; @@ -2206,7 +2206,7 @@ #elif ARCH_BFIN flags |= SWS_CPU_CAPS_BFIN; #endif -#endif /* CONFIG_RUNTIME_CPUDETECT */ +#endif /* RUNTIME_CPUDETECT */ if (clip_table[512] != 255) globalInit(); if (!rgb15to16) sws_rgb2rgb_init(flags); diff -Nru ffmpeg-0.5.2/MAINTAINERS ffmpeg-0.5+svn20090706/MAINTAINERS --- ffmpeg-0.5.2/MAINTAINERS 2010-08-17 20:10:40.000000000 -0500 +++ ffmpeg-0.5+svn20090706/MAINTAINERS 2009-02-28 11:24:46.000000000 -0600 @@ -49,7 +49,6 @@ project server Diego Biurrun, Mans Rullgard mailinglists Michael Niedermayer, Baptiste Coudurier presets Robert Swain -release management Diego Biurrun, Reinhard Tartler libavutil @@ -330,6 +329,5 @@ Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B Reimar Döffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7 -Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4 Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C diff -Nru ffmpeg-0.5.2/RELEASE ffmpeg-0.5+svn20090706/RELEASE --- ffmpeg-0.5.2/RELEASE 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/RELEASE 2009-03-04 10:52:37.000000000 -0600 @@ -1,7 +1,7 @@ Release Notes ============= -* 0.5 "Bike Shed World Domination" March 3, 2009 +* 0.5 "Bike Shed" March 3, 2009 General notes ------------- @@ -37,78 +37,3 @@ If at all possible, do not use the deprecated APIs. All notes on API changes should appear in doc/APIchanges. - - - -* 0.5.1 March 2, 2010 - -General notes -------------- - -This point release includes some minor updates to make the 0.5 release series -usable for users that need to retain the existing behavior as closely as -possible. The changes follow below: - -Security fixes --------------- - -Various programming errors in container and codec implementations -may lead to denial of service or the execution of arbitrary code -if the user is tricked into opening a malformed media file or stream. - -Affected and updated have been the implementations of the following -codecs and container formats: - - - the Vorbis audio codec - - the FF Video 1 codec - - the MPEG audio codec - - the H264 video codec - - the MLP codec - - the HuffYUV codec - - the ASF demuxer - - the Ogg container implementation - - the MOV container implementation - -Symbol Versioning enabled -------------------------- - -The backported symbol versioning change is enabled on platforms that support -it. This allows users to upgrade from 0.5.1 to the upcoming 0.6 release -without having to recompile their applications. Please note that distributors -have to recompile applications against 0.5.1 before upgrading to 0.6. - -libx264.c backport ------------------- - -This release includes a backport to the libx264 wrapper that allows FFmpeg to -be compiled against newer versions of libx264 up to API version 85. - -licensing changes ------------------ - -Previously both libswscale and our AC-3 decoder had GPLed parts. These have -been replaced by fresh LGPL code. x86 optimizations for libswscale remain GPL, -but the C code is fully functional. Optimizations for other architectures have -been relicensed to LGPL. - -AMR-NB decoding/encoding and AMR-WB decoding is now possible through the free -software OpenCORE libraries as an alternative to the non-free libamr libraries. - -We found out that libfaac contains non-free parts and is not LGPL as previously -claimed. We have changed configure to reflect this. You now have to pass the ---enable-nonfree option if you wish to compile with libfaac support enabled. - -Furthermore the non-free bits in libavcodec/fdctref.c have been rewritten. Note -well that they were only used in a test program and never compiled into any -FFmpeg library. - - - -* 0.5.2 May 25, 2010 - -General notes -------------- - -This is a maintenance only release that addresses a small number of security -and portability issues. Distributors and system integrators are encouraged -to update and share their patches against this branch. diff -Nru ffmpeg-0.5.2/subdir.mak ffmpeg-0.5+svn20090706/subdir.mak --- ffmpeg-0.5.2/subdir.mak 2010-08-17 20:10:45.000000000 -0500 +++ ffmpeg-0.5+svn20090706/subdir.mak 2008-12-13 09:31:30.000000000 -0600 @@ -27,9 +27,9 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) -$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver +$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIB_CREATE_DEF_CMD) - $(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter-out $(SUBDIR)lib$(NAME).ver $(DEP_LIBS),$$^) $(FFEXTRALIBS) $(EXTRAOBJS) + $(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter-out $(DEP_LIBS),$$^) $(FFEXTRALIBS) $(EXTRAOBJS) $(SLIB_EXTRA_CMD) ifdef SUBDIR diff -Nru ffmpeg-0.5.2/.svnrevision ffmpeg-0.5+svn20090706/.svnrevision --- ffmpeg-0.5.2/.svnrevision 1969-12-31 18:00:00.000000000 -0600 +++ ffmpeg-0.5+svn20090706/.svnrevision 2009-08-13 05:44:15.000000000 -0500 @@ -0,0 +1 @@ +19352 diff -Nru ffmpeg-0.5.2/VERSION ffmpeg-0.5+svn20090706/VERSION --- ffmpeg-0.5.2/VERSION 2010-08-17 20:10:44.000000000 -0500 +++ ffmpeg-0.5+svn20090706/VERSION 2009-03-31 16:11:04.000000000 -0500 @@ -1 +1 @@ -0.5.2 +0.5