From 4dbce6b69967c1e14092637aa95b6c31855a81fc Mon Sep 17 00:00:00 2001 From: konablend Date: Sun, 1 Mar 2009 17:03:11 +0000 Subject: BuildSystem: conversion from jam-based to make-based system. KNOWN ISSUES: 1. OSX + Xcode builds do not support parallel builds; attempting to use them may cause unbounded number of jobs. However, disabling via configure --disable-xcode avoids the issue. 2. OSX ppc binary produces binary which has audio-scan problems. 3. OSX ppc64 binary has not been runtime tested. ADDED: 00-BuildUserGuide.txt contrib/*/module.* doc/ make/ libhb/module.* test/module.* macos/module.* gtk/module.* DROPPED: BUILD BuildContribDarwin.sh DownloadMacOsXContribBinaries.sh Jamfile Jamrules MacOsXContribBinariesVersion.txt Makefile Makefile.config jam libhb/Jamefile libhb/Makefile test/BUILDSHARED test/Makefile contrib/Jamfile contrib/Makefile contrib/patch-ffmpeg.patch contrib/patch-x264-idr.patch contrib/patch-x264-linux.patch RENAMED: contrib/*.patch -> contrib/MODULE/[AP]??-*.patch macosx/HandBrake.plist -> macosx/Info.plist MODIFIED: libhb/decavcodec.c Patched to use cleaner include "libavcodec/audioconvert". Second part to support this cleanup is ffmpeg A02-audioconvert.patch . MODIFIED: libhb/hb.c MODIFIED: libhb/hb.h MODIFIED: libhb/muxmkv.c MODIFIED: libhb/muxmp4.c MODIFIED: libhb/update.c Patched to use "project.h" for project metadata. Renamed HB_BUILD -> HB_PROJECT_BUILD. Renamed HB_VERSION -> HB_PROJECT_VERSION. MODIFIED: test/test.c: Patched HandBrakeCLI to support I/O on Mac OS X ZFS filesystems. Reference r1803 as similar patch for HandBrake.app . Unpatched behavior is crash/buserror when using ZFS. MODIFIED: macosx/Growl.framework/ Upgraded 0.7.6 (i386,ppc) -> 1.1.2 (i386,x86_64,ppc,ppc64). New architectures facilitate x86_64 and ppc64 builds. MODIFIED: macosx/HandBrake.xcodeproj/ Bumped compatibilty mode from 2.4 -> 3.1 . Dumped old configurations Deployment, Developer. Added configurations standard, sebug as replacements. Added standard.i386, standard.x86_64, standard.ppc, standard.ppc64 . for explicit architecture build. All configurations settings cleaned up and normalized. Build output directories adjusted to support new build system. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2180 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- contrib/Jamfile | 494 ------------ contrib/Makefile | 49 -- contrib/a52dec/A00-dpl2.patch | 114 +++ contrib/a52dec/module.defs | 6 + contrib/a52dec/module.rules | 2 + contrib/bzip2/module.defs | 24 + contrib/bzip2/module.rules | 2 + contrib/faac/P00-cygwin.patch | 12 + contrib/faac/module.defs | 8 + contrib/faac/module.rules | 2 + contrib/faad2/A00-libtool22.patch | 13 + contrib/faad2/module.defs | 7 + contrib/faad2/module.rules | 2 + contrib/ffmpeg/A00-latm.patch | 886 +++++++++++++++++++++ contrib/ffmpeg/A01-mpegleak.patch | 56 ++ contrib/ffmpeg/A02-audioconvert.patch | 12 + contrib/ffmpeg/P00-cygwin.patch | 15 + contrib/ffmpeg/P01-sunos.patch | 25 + contrib/ffmpeg/P02-darwin-h264dsp-crash.patch | 13 + contrib/ffmpeg/module.defs | 32 + contrib/ffmpeg/module.rules | 2 + contrib/lame/P00-darwin-xmmintrin.patch | 28 + contrib/lame/module.defs | 5 + contrib/lame/module.rules | 2 + contrib/libdca/A00-general.patch | 834 ++++++++++++++++++++ contrib/libdca/module.defs | 5 + contrib/libdca/module.rules | 2 + contrib/libdvdread/P00-darwin-css-vlc-dylib.patch | 12 + contrib/libdvdread/P01-cygwin.patch | 26 + contrib/libdvdread/module.defs | 5 + contrib/libdvdread/module.rules | 2 + contrib/libmkv/module.defs | 5 + contrib/libmkv/module.rules | 2 + contrib/libmp4v2/module.defs | 5 + contrib/libmp4v2/module.rules | 2 + contrib/libogg/module.defs | 7 + contrib/libogg/module.rules | 2 + contrib/libsamplerate/module.defs | 5 + contrib/libsamplerate/module.rules | 2 + contrib/libtheora/module.defs | 13 + contrib/libtheora/module.rules | 2 + contrib/libvorbis/module.defs | 7 + contrib/libvorbis/module.rules | 2 + contrib/mpeg2dec/module.defs | 7 + contrib/mpeg2dec/module.rules | 2 + contrib/patch-a52dec.patch | 114 --- contrib/patch-faac-cygwin.patch | 12 - contrib/patch-faad2-libtool22.patch | 13 - contrib/patch-ffmpeg-cygwin.patch | 15 - contrib/patch-ffmpeg-h264dsp-crash.diff | 13 - contrib/patch-ffmpeg-latm.patch | 893 ---------------------- contrib/patch-ffmpeg-mpegleak.patch | 58 -- contrib/patch-ffmpeg-solaris.patch | 25 - contrib/patch-ffmpeg.patch | 18 - contrib/patch-libdca.patch | 834 -------------------- contrib/patch-libdvdread-css-vlc-dylib.patch | 11 - contrib/patch-libdvdread-cygwin.patch | 26 - contrib/patch-libmpeg2.patch | 33 - contrib/patch-x264-cygwin.patch | 13 - contrib/patch-x264-idr.patch | 17 - contrib/patch-x264-linux.patch | 194 ----- contrib/patch-x264-solaris.patch | 67 -- contrib/patch-xvidcore-cygwin.patch | 34 - contrib/patch-xvidcore-fdct.patch | 8 - contrib/patch-xvidcore-macosx.patch | 31 - contrib/patch-xvidcore-nasm-2.00-configure.patch | 13 - contrib/patch_mpeg4ip_cygwin.patch | 262 ------- contrib/version_a52dec.txt | 1 - contrib/version_bzip2.txt | 1 - contrib/version_faac.txt | 1 - contrib/version_faad2.txt | 1 - contrib/version_ffmpeg.txt | 1 - contrib/version_lame.txt | 1 - contrib/version_libdca.txt | 1 - contrib/version_libdvdcss.txt | 1 - contrib/version_libdvdread.txt | 1 - contrib/version_libmkv.txt | 1 - contrib/version_libmp4v2.txt | 1 - contrib/version_libogg.txt | 1 - contrib/version_libsamplerate.txt | 1 - contrib/version_libtheora.txt | 2 - contrib/version_libvorbis.txt | 1 - contrib/version_mpeg2dec.txt | 1 - contrib/version_mpeg4ip.txt | 1 - contrib/version_qt.txt | 1 - contrib/version_x264.txt | 1 - contrib/version_xvidcore.txt | 1 - contrib/version_zlib.txt | 1 - contrib/x264/P00-cygwin.patch | 13 + contrib/x264/P01-sunos.patch | 67 ++ contrib/x264/module.defs | 11 + contrib/x264/module.rules | 2 + contrib/xvidcore/A00-nasm.patch | 13 + contrib/xvidcore/A01-fdct.patch | 8 + contrib/xvidcore/P00-darwin.patch | 31 + contrib/xvidcore/P01-cygwin.patch | 34 + contrib/xvidcore/module.defs | 20 + contrib/xvidcore/module.rules | 2 + contrib/zlib/module.defs | 6 + contrib/zlib/module.rules | 2 + 100 files changed, 2426 insertions(+), 3269 deletions(-) delete mode 100644 contrib/Jamfile delete mode 100644 contrib/Makefile create mode 100644 contrib/a52dec/A00-dpl2.patch create mode 100644 contrib/a52dec/module.defs create mode 100644 contrib/a52dec/module.rules create mode 100644 contrib/bzip2/module.defs create mode 100644 contrib/bzip2/module.rules create mode 100644 contrib/faac/P00-cygwin.patch create mode 100644 contrib/faac/module.defs create mode 100644 contrib/faac/module.rules create mode 100644 contrib/faad2/A00-libtool22.patch create mode 100644 contrib/faad2/module.defs create mode 100644 contrib/faad2/module.rules create mode 100644 contrib/ffmpeg/A00-latm.patch create mode 100644 contrib/ffmpeg/A01-mpegleak.patch create mode 100644 contrib/ffmpeg/A02-audioconvert.patch create mode 100644 contrib/ffmpeg/P00-cygwin.patch create mode 100644 contrib/ffmpeg/P01-sunos.patch create mode 100644 contrib/ffmpeg/P02-darwin-h264dsp-crash.patch create mode 100644 contrib/ffmpeg/module.defs create mode 100644 contrib/ffmpeg/module.rules create mode 100644 contrib/lame/P00-darwin-xmmintrin.patch create mode 100644 contrib/lame/module.defs create mode 100644 contrib/lame/module.rules create mode 100644 contrib/libdca/A00-general.patch create mode 100644 contrib/libdca/module.defs create mode 100644 contrib/libdca/module.rules create mode 100644 contrib/libdvdread/P00-darwin-css-vlc-dylib.patch create mode 100644 contrib/libdvdread/P01-cygwin.patch create mode 100644 contrib/libdvdread/module.defs create mode 100644 contrib/libdvdread/module.rules create mode 100644 contrib/libmkv/module.defs create mode 100644 contrib/libmkv/module.rules create mode 100644 contrib/libmp4v2/module.defs create mode 100644 contrib/libmp4v2/module.rules create mode 100644 contrib/libogg/module.defs create mode 100644 contrib/libogg/module.rules create mode 100644 contrib/libsamplerate/module.defs create mode 100644 contrib/libsamplerate/module.rules create mode 100644 contrib/libtheora/module.defs create mode 100644 contrib/libtheora/module.rules create mode 100644 contrib/libvorbis/module.defs create mode 100644 contrib/libvorbis/module.rules create mode 100644 contrib/mpeg2dec/module.defs create mode 100644 contrib/mpeg2dec/module.rules delete mode 100644 contrib/patch-a52dec.patch delete mode 100644 contrib/patch-faac-cygwin.patch delete mode 100644 contrib/patch-faad2-libtool22.patch delete mode 100644 contrib/patch-ffmpeg-cygwin.patch delete mode 100644 contrib/patch-ffmpeg-h264dsp-crash.diff delete mode 100644 contrib/patch-ffmpeg-latm.patch delete mode 100644 contrib/patch-ffmpeg-mpegleak.patch delete mode 100644 contrib/patch-ffmpeg-solaris.patch delete mode 100644 contrib/patch-ffmpeg.patch delete mode 100644 contrib/patch-libdca.patch delete mode 100644 contrib/patch-libdvdread-css-vlc-dylib.patch delete mode 100644 contrib/patch-libdvdread-cygwin.patch delete mode 100644 contrib/patch-libmpeg2.patch delete mode 100644 contrib/patch-x264-cygwin.patch delete mode 100644 contrib/patch-x264-idr.patch delete mode 100644 contrib/patch-x264-linux.patch delete mode 100644 contrib/patch-x264-solaris.patch delete mode 100644 contrib/patch-xvidcore-cygwin.patch delete mode 100644 contrib/patch-xvidcore-fdct.patch delete mode 100644 contrib/patch-xvidcore-macosx.patch delete mode 100644 contrib/patch-xvidcore-nasm-2.00-configure.patch delete mode 100644 contrib/patch_mpeg4ip_cygwin.patch delete mode 100644 contrib/version_a52dec.txt delete mode 100644 contrib/version_bzip2.txt delete mode 100644 contrib/version_faac.txt delete mode 100644 contrib/version_faad2.txt delete mode 100644 contrib/version_ffmpeg.txt delete mode 100644 contrib/version_lame.txt delete mode 100644 contrib/version_libdca.txt delete mode 100644 contrib/version_libdvdcss.txt delete mode 100644 contrib/version_libdvdread.txt delete mode 100644 contrib/version_libmkv.txt delete mode 100644 contrib/version_libmp4v2.txt delete mode 100644 contrib/version_libogg.txt delete mode 100644 contrib/version_libsamplerate.txt delete mode 100644 contrib/version_libtheora.txt delete mode 100644 contrib/version_libvorbis.txt delete mode 100644 contrib/version_mpeg2dec.txt delete mode 100644 contrib/version_mpeg4ip.txt delete mode 100644 contrib/version_qt.txt delete mode 100644 contrib/version_x264.txt delete mode 100644 contrib/version_xvidcore.txt delete mode 100644 contrib/version_zlib.txt create mode 100644 contrib/x264/P00-cygwin.patch create mode 100644 contrib/x264/P01-sunos.patch create mode 100644 contrib/x264/module.defs create mode 100644 contrib/x264/module.rules create mode 100644 contrib/xvidcore/A00-nasm.patch create mode 100644 contrib/xvidcore/A01-fdct.patch create mode 100644 contrib/xvidcore/P00-darwin.patch create mode 100644 contrib/xvidcore/P01-cygwin.patch create mode 100644 contrib/xvidcore/module.defs create mode 100644 contrib/xvidcore/module.rules create mode 100644 contrib/zlib/module.defs create mode 100644 contrib/zlib/module.rules (limited to 'contrib') diff --git a/contrib/Jamfile b/contrib/Jamfile deleted file mode 100644 index d0450cdfc..000000000 --- a/contrib/Jamfile +++ /dev/null @@ -1,494 +0,0 @@ -SubDir TOP contrib ; - -# Use curl on Mac OS X since it's always installed, and assume wget -# is installed for all other systems -if $(OS) = MACOSX -{ - WGET = curl -q -L -o ; -} -else -{ - WGET = wget -O ; -} - -if $(OS) = UNKNOWN -{ - OS = CYGWIN ; -} - -if $(OS) = SOLARIS -{ - PATCH = gpatch ; - STRIP = echo ; -} -else -{ - PATCH = patch ; - STRIP = strip -S ; -} - -# Wget rule: downloads $(<) from the link in $(>) -rule Wget -{ - Depends $(<) : $(>) ; -} -actions Wget -{ - $(RM) $(<) && - $(WGET) $(<) `cat $(>)` && - ( touch $(<) || true ) -} - -# liba52 -rule LibA52 -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibA52 -{ - - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf a52dec && (gzip -dc a52dec.tar.gz | tar xf -) && - cd a52dec && $(PATCH) -p1 < ../patch-a52dec.patch && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/liba52.a -} -Wget $(SUBDIR)/a52dec.tar.gz : $(SUBDIR)/version_a52dec.txt ; -LibA52 $(SUBDIR)/lib/liba52.a : $(SUBDIR)/a52dec.tar.gz ; - -# FAAD2 -rule LibFaad2 -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} - -actions LibFaad2 -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf faad2 && (gzip -dc faad2.tar.gz | tar xf -) && - cd faad2 && $(PATCH) -p1 < ../patch-faad2-libtool22.patch && - ./bootstrap && ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && $(MAKE) && $(MAKE) install -} -Wget $(SUBDIR)/faad2.tar.gz : $(SUBDIR)/version_faad2.txt ; -LibFaad2 $(SUBDIR)/lib/libfaad.a : $(SUBDIR)/faad2.tar.gz ; - -# libavcodec -rule LibAvCodec -{ - FFMPEG_PATCH = "$(PATCH) -p0 < ../patch-ffmpeg.patch" ; - FFMPEG_PATCH += " && $(PATCH) -p0 < ../patch-ffmpeg-latm.patch " ; - FFMPEG_PATCH += " && $(PATCH) -p0 < ../patch-ffmpeg-mpegleak.patch " ; - if $(OS) = CYGWIN - { - FFMPEG_PATCH += " && $(PATCH) -p1 < ../patch-ffmpeg-cygwin.patch " ; - } - else if $(OS) = SOLARIS - { - FFMPEG_PATCH += " && $(PATCH) -p1 < ../patch-ffmpeg-solaris.patch " ; - } - else if $(OS) = MACOSX - { - FFMPEG_PATCH += " && $(PATCH) -p1 < ../patch-ffmpeg-h264dsp-crash.diff " ; - } - - if $(OS) = SOLARIS - { - # - # Not all of ffmpeg works on Solaris - disable the bits that - # don't. When we get new versions of FFMPEG we can try enabling - # then again. - # - FFMPEG_EXTRA_OPTIONS = "--disable-vis --disable-demuxer=mpc8 --disable-vhook --disable-network" ; - } - - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibAvCodec -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf ffmpeg && (gzip -dc ffmpeg.tar.gz | tar xf -) && - cd ffmpeg && $(FFMPEG_PATCH) && - ./configure --prefix=$CONTRIB --enable-gpl --enable-pthreads --enable-swscale \ - --disable-shared --enable-static --disable-encoders \ - --enable-encoder=mpeg4 --enable-encoder=ac3 --enable-encoder=snow \ - --enable-libfaad --disable-ffmpeg --disable-ffserver \ - --disable-muxers --enable-muxer=ipod --disable-bsfs --disable-vhook \ - --extra-cflags="-I$CONTRIB/include" \ - --extra-ldflags="-L$CONTRIB/lib" $(FFMPEG_EXTRA_OPTIONS) && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libavcodec.a -} -Wget $(SUBDIR)/ffmpeg.tar.gz : $(SUBDIR)/version_ffmpeg.txt ; -LibAvCodec $(SUBDIR)/lib/libavcodec.a : $(SUBDIR)/ffmpeg.tar.gz ; - -rule LibAvUtil -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibAvUtil -{ - $(STRIP) $(<) -} -LibAvUtil $(SUBDIR)/lib/libavutil.a : $(SUBDIR)/lib/libavcodec.a ; -LibAvUtil $(SUBDIR)/lib/libavformat.a : $(SUBDIR)/lib/libavcodec.a ; -LibAvUtil $(SUBDIR)/lib/libswscale.a : $(SUBDIR)/lib/libavcodec.a ; - -# HandBrake does not include a DVD decrypting library, -# so if a user requests it, let them download and compile it from a 3rd party -if $(CSS) = 1 -{ - # libdvdcss - # We need libdvdcss.so for libdvdread's configure to work... - rule LibDvdCss - { - Depends $(<) : $(>) ; - Depends lib : $(<) ; - } - actions LibDvdCss - { - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libdvdcss-1.2.9 && (gzip -dc libdvdcss.tar.gz | tar xf - ) && - cd libdvdcss-1.2.9 && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libdvdcss.a - } - Wget $(SUBDIR)/libdvdcss.tar.gz : $(SUBDIR)/version_libdvdcss.txt ; - LibDvdCss $(SUBDIR)/lib/libdvdcss.a : $(SUBDIR)/libdvdcss.tar.gz ; -} - -# libdca -rule LibDCA -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibDCA -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libdca && (gzip -dc libdca.tar.gz | tar xf - ) && - cd libdca && $(PATCH) -p1 < ../patch-libdca.patch && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libdca.a -} -Wget $(SUBDIR)/libdca.tar.gz : $(SUBDIR)/version_libdca.txt ; -LibDCA $(SUBDIR)/lib/libdca.a : $(SUBDIR)/libdca.tar.gz ; - -# libdvdread -rule LibDvdRead -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; - - if $(OS) = MACOSX - { - DVDREAD_PATCH = "$(PATCH) -p0 < ../patch-libdvdread-css-vlc-dylib.patch &&" ; - } - - if $(OS) = CYGWIN - { - DVDREAD_PATCH = "$(PATCH) -p1 < ../patch-libdvdread-cygwin.patch &&" ; - } - -} -if $(CSS) = 1 # Include CSS support in libdvdread if requested -{ - actions LibDvdRead - { - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libdvdread && (gzip -dc libdvdread.tar.gz | tar xf - ) && - cd libdvdread && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --with-libdvdcss=$CONTRIB && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libdvdread.a - } -} -else { - # Cygwin/Windows doesn't use CSS as of now, so don't include it on the - # configure line. - # MacOSX uses a dylib for CSS, so it doesn't need including there either. - actions LibDvdRead - { - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libdvdread && (gzip -dc libdvdread.tar.gz | tar xf - ) && - cd libdvdread && $(DVDREAD_PATCH) - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libdvdread.a - } -} -Wget $(SUBDIR)/libdvdread.tar.gz : $(SUBDIR)/version_libdvdread.txt ; -LibDvdRead $(SUBDIR)/lib/libdvdread.a : $(SUBDIR)/libdvdread.tar.gz ; - -# libfaac -rule LibFaac -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; - if $(OS) = CYGWIN - { - CYGWIN_PATCH = "$(PATCH) -p1 < ../patch-faac-cygwin.patch &&" ; - } -} -actions LibFaac -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf faac && (gzip -dc faac.tar.gz | tar xf - ) && cd faac && $(CYGWIN_PATCH) ./bootstrap && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --enable-static --without-mp4v2 && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libfaac.a -} -Wget $(SUBDIR)/faac.tar.gz : $(SUBDIR)/version_faac.txt ; -LibFaac $(SUBDIR)/lib/libfaac.a : $(SUBDIR)/faac.tar.gz ; - -# libmp3lame -rule LibMp3Lame -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibMp3Lame -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf lame && (gzip -dc lame.tar.gz | tar xf - ) && cd lame && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libmp3lame.a -} -Wget $(SUBDIR)/lame.tar.gz : $(SUBDIR)/version_lame.txt ; -LibMp3Lame $(SUBDIR)/lib/libmp3lame.a : $(SUBDIR)/lame.tar.gz ; - -# libmp4v2 -rule LibMp4v2 -{ - LIBMP4V2_PATCH = "" ; - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibMp4v2 -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libmp4v2 && (gzip -dc libmp4v2.tar.gz | tar xf - ) && - cd libmp4v2 && $(LIBMP4V2_PATCH) rm -rf build && mkdir build && cd build && - ../configure --disable-shared --disable-debug --prefix=$CONTRIB && $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libmp4v2.a -} -Wget $(SUBDIR)/libmp4v2.tar.gz : $(SUBDIR)/version_libmp4v2.txt ; -LibMp4v2 $(SUBDIR)/lib/libmp4v2.a : $(SUBDIR)/libmp4v2.tar.gz ; - -rule LibMkv -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibMkv -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libmkv && (gzip -dc libmkv.tar.gz | tar xf - ) && - cd libmkv && - ./configure --disable-shared --enable-static --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libmkv.a -} -Wget $(SUBDIR)/libmkv.tar.gz : $(SUBDIR)/version_libmkv.txt ; -LibMkv $(SUBDIR)/lib/libmkv.a : $(SUBDIR)/libmkv.tar.gz ; - -# libmpeg2 -rule LibMpeg2 -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibMpeg2 -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf mpeg2dec && (gzip -dc mpeg2dec.tar.gz | tar xf - ) && - cd mpeg2dec && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared --disable-sdl --without-x && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libmpeg2.a -} -Wget $(SUBDIR)/mpeg2dec.tar.gz : $(SUBDIR)/version_mpeg2dec.txt ; -LibMpeg2 $(SUBDIR)/lib/libmpeg2.a : $(SUBDIR)/mpeg2dec.tar.gz ; - -# libogg -rule LibOgg -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibOgg -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libogg && (gzip -dc libogg.tar.gz | tar xf - ) && - cd libogg && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libogg.a -} -Wget $(SUBDIR)/libogg.tar.gz : $(SUBDIR)/version_libogg.txt ; -LibOgg $(SUBDIR)/lib/libogg.a : $(SUBDIR)/libogg.tar.gz ; - -# libsamplerate -rule LibSampleRate -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibSampleRate -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libsamplerate && (gzip -dc libsamplerate.tar.gz | tar xf - ) && - cd libsamplerate && - ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libsamplerate.a -} -Wget $(SUBDIR)/libsamplerate.tar.gz : $(SUBDIR)/version_libsamplerate.txt ; -LibSampleRate $(SUBDIR)/lib/libsamplerate.a : $(SUBDIR)/libsamplerate.tar.gz ; - -# libvorbis -rule LibVorbis -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibVorbis -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf libvorbis && (gzip -dc libvorbis.tar.gz | tar xf - ) && - cd libvorbis && - ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libvorbis.a -} -Wget $(SUBDIR)/libvorbis.tar.gz : $(SUBDIR)/version_libvorbis.txt ; -LibVorbis $(SUBDIR)/lib/libvorbis.a : $(SUBDIR)/libvorbis.tar.gz ; - -rule LibVorbisEnc -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibVorbisEnc -{ - $(STRIP) $(<) -} -LibVorbisEnc $(SUBDIR)/lib/libvorbisenc.a : $(SUBDIR)/lib/libvorbis.a ; - -# libtheora -rule LibTheora -{ - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibTheora -{ - cd `dirname $(>)` && CONTRIB=`pwd` && rm -rf libtheora && - (gzip -dc libtheora.tar.gz | tar xf - ) && cd libtheora && - HAVE_PKG_CONFIG="no" && export HAVE_PKG_CONFIG && - ./configure --prefix=$CONTRIB --with-ogg=$CONTRIB --with-vorbis=$CONTRIB --cache-file=$CONTRIB/config.cache --disable-shared \ - --disable-oggtest --disable-vorbistest --disable-sdltest --disable-examples && - $(MAKE) && $(MAKE) install && - $(STRIP) $CONTRIB/lib/libtheora.a -} -Wget $(SUBDIR)/libtheora.tar.gz : $(SUBDIR)/version_libtheora.txt ; -LibTheora $(SUBDIR)/lib/libtheora.a : $(SUBDIR)/libtheora.tar.gz ; - -# libx264 -rule LibX264 -{ - LIBX264_PATCH = "" ; - if $(OS) = CYGWIN - { - LIBX264_PATCH += "$(PATCH) -p1 < ../patch-x264-cygwin.patch && " ; - } - else if $(OS) = SOLARIS - { - LIBX264_PATCH += " $(PATCH) -p1 < ../patch-x264-solaris.patch && " ; - } - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibX264 -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf x264 && (gzip -dc x264.tar.gz | tar xf - ) && - cd x264 && $(LIBX264_PATCH) - bash ./configure --prefix=$CONTRIB --enable-pthread && - $(MAKE) libx264.a && cp libx264.a $CONTRIB/lib/ && cp x264.h $CONTRIB/include/ && $(STRIP) $CONTRIB/lib/libx264.a -} -Wget $(SUBDIR)/x264.tar.gz : $(SUBDIR)/version_x264.txt ; -LibX264 $(SUBDIR)/lib/libx264.a : $(SUBDIR)/x264.tar.gz ; - -# libxvidcore -rule LibXvidCore -{ - LIBXVIDCORE_PATCH = "" ; - if $(OS) = MACOSX - { - LIBXVIDCORE_PATCH = "$(PATCH) -p1 < ../patch-xvidcore-macosx.patch && " ; - } - else if $(OS) = CYGWIN - { - LIBXVIDCORE_PATCH = "$(PATCH) -p1 < ../patch-xvidcore-cygwin.patch && " ; - } - LIBXVIDCORE_PATCH += "$(PATCH) -p1 < ../patch-xvidcore-nasm-2.00-configure.patch && " ; - LIBXVIDCORE_PATCH += "$(PATCH) -p1 < ../patch-xvidcore-fdct.patch && " ; - Depends $(<) : $(>) ; - Depends lib : $(<) ; -} -actions LibXvidCore -{ - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf xvidcore && (gzip -dc xvidcore.tar.gz | tar xf - ) && - cd xvidcore && $(LIBXVIDCORE_PATCH) - cd build/generic/ && ./configure --prefix=$CONTRIB --cache-file=$CONTRIB/config.cache && $(MAKE) libxvidcore.a && - cp ./=build/libxvidcore.a $CONTRIB/lib/ && - cp ../../src/xvid.h $CONTRIB/include/ && - $(STRIP) $CONTRIB/lib/libxvidcore.a -} -Wget $(SUBDIR)/xvidcore.tar.gz : $(SUBDIR)/version_xvidcore.txt ; -LibXvidCore $(SUBDIR)/lib/libxvidcore.a : $(SUBDIR)/xvidcore.tar.gz ; - -# zlib -if $(OS) = CYGWIN -{ - rule Zlib - { - Depends $(<) : $(>) ; - Depends lib : $(<) ; - } - actions Zlib - { - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf zlib && (gzip -dc zlib.tar.gz | tar xf - ) && - cd zlib && ./configure --prefix=$CONTRIB && - $(MAKE) && $(MAKE) install && touch $CONTRIB/.contrib && - $(STRIP) $CONTRIB/lib/libz.a - } - Wget $(SUBDIR)/zlib.tar.gz : $(SUBDIR)/version_zlib.txt ; - Zlib $(SUBDIR)/lib/libz.a : $(SUBDIR)/zlib.tar.gz ; -} - -# bzip2 -if $(OS) = CYGWIN -{ - rule BZip2 - { - Depends $(<) : $(>) ; - Depends lib : $(<) ; - } - actions BZip2 - { - cd `dirname $(>)` && CONTRIB=`pwd` && - rm -rf bzip2 && (gzip -dc bzip2.tar.gz | tar xf - ) && - cd bzip2 && $(MAKE) && $(MAKE) install && cp libbz2.a $CONTRIB/lib/ && - $(STRIP) $CONTRIB/lib/libbz2.a - } - Wget $(SUBDIR)/bzip2.tar.gz : $(SUBDIR)/version_bzip2.txt ; - BZip2 $(SUBDIR)/lib/libbz2.a : $(SUBDIR)/bzip2.tar.gz ; -} diff --git a/contrib/Makefile b/contrib/Makefile deleted file mode 100644 index 1855ed06c..000000000 --- a/contrib/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# Contrib Makefile - -SYSTEM = $(shell uname -s) - -# Special case for Mac OS X: everything is handled from the Xcode project -ifeq ($(SYSTEM),Darwin) - -all: .contrib - -.contrib: - ( cd .. ; ./configure ; cd contrib ; cp -f ../config.jam . ; ../jam ) - -clean: - ( echo "Do a make mrproper to remove the contrib libraries ) - -mrproper: - (rm -rf lib ; rm -rf include ) - -endif - -ifeq ($(SYSTEM),Linux) - -all: .contrib - -.contrib: - ( cd .. ; ./configure ; cd contrib ; cp -f ../config.jam . ; jam ) - -clean: - ( echo "Do a make mrproper to remove the contrib libraries ) - -mrproper: - (rm -rf lib ; rm -rf include ) - -endif - -ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) - -all: .contrib - -.contrib: - ( cd .. ; ./configure ; cd contrib ; cp -f ../config.jam . ; jam.exe ) - -clean: - ( echo "Do a make mrproper to remove the contrib libraries ) - -mrproper: clean - (rm -rf lib ; rm -rf include ; rm -f .contrib) - -endif diff --git a/contrib/a52dec/A00-dpl2.patch b/contrib/a52dec/A00-dpl2.patch new file mode 100644 index 000000000..cf1c8a64a --- /dev/null +++ b/contrib/a52dec/A00-dpl2.patch @@ -0,0 +1,114 @@ +diff -Naur a52dec_original/include/a52.h a52dec_patched/include/a52.h +--- a52dec_original/include/a52.h 2002-01-28 05:37:54.000000000 +0000 ++++ a52dec_patched/include/a52.h 2007-04-04 19:12:57.000000000 +0100 +@@ -48,6 +48,10 @@ + #define A52_LFE 16 + #define A52_ADJUST_LEVEL 32 + ++// this next constant can be ORed with A52_DOLBY to tell liba52 to use 5.0 DPLII matrix encoding, ++// rather than just 4.0 Dolby Surround matrix encoding ++#define A52_USE_DPLII 64 ++ + a52_state_t * a52_init (uint32_t mm_accel); + sample_t * a52_samples (a52_state_t * state); + int a52_syncinfo (uint8_t * buf, int * flags, +diff -Naur a52dec_original/liba52/a52_internal.h a52dec_patched/liba52/a52_internal.h +--- a52dec_original/liba52/a52_internal.h 2002-07-28 02:52:06.000000000 +0100 ++++ a52dec_patched/liba52/a52_internal.h 2007-04-04 19:11:43.000000000 +0100 +@@ -93,6 +93,10 @@ + #define LEVEL_45DB 0.5946035575013605 + #define LEVEL_6DB 0.5 + ++// these next two constants are used for DPL matrix encoding in downmix.c ++#define LEVEL_SQRT_1_2 0.5 ++#define LEVEL_SQRT_3_4 0.8660254037844386 ++ + #define EXP_REUSE (0) + #define EXP_D15 (1) + #define EXP_D25 (2) +diff -Naur a52dec_original/liba52/downmix.c a52dec_patched/liba52/downmix.c +--- a52dec_original/liba52/downmix.c 2002-01-28 05:37:54.000000000 +0000 ++++ a52dec_patched/liba52/downmix.c 2007-04-06 13:47:49.000000000 +0100 +@@ -34,6 +34,7 @@ + int a52_downmix_init (int input, int flags, sample_t * level, + sample_t clev, sample_t slev) + { ++ + static uint8_t table[11][8] = { + {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO, + A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO}, +@@ -148,6 +149,9 @@ + break; + } + ++ // add the DPLII flag back into the output if it was passed in ++ output = output | (flags & A52_USE_DPLII); ++ + return output; + } + +@@ -418,17 +422,46 @@ + } + } + +-static void mix32toS (sample_t * samples, sample_t bias) ++static void mix32toS (sample_t * samples, sample_t bias, int use_dpl2) + { +- int i; +- sample_t common, surround; + +- for (i = 0; i < 256; i++) { +- common = samples[i + 256] + bias; +- surround = samples[i + 768] + samples[i + 1024]; +- samples[i] += common - surround; +- samples[i + 256] = samples[i + 512] + common + surround; +- } ++ if (use_dpl2 == 1) { ++ ++ int i; ++ sample_t cc, Lt, Rt, Ls, Rs, Lss, Rss; ++ ++ for (i = 0; i < 256; i++) { ++ ++ cc = samples[i + 256] * LEVEL_3DB; ++ ++ Lt = samples[i] + cc; ++ Rt = samples[i + 512] + cc; ++ ++ Ls = samples[i + 768]; ++ Rs = samples[i + 1024]; ++ ++ Lss = (LEVEL_SQRT_3_4 * Ls) - (LEVEL_SQRT_1_2 * Rs); ++ Rss = -(LEVEL_SQRT_1_2 * Ls) + (LEVEL_SQRT_3_4 * Rs); ++ ++ samples[i] = bias + Lt + Lss; ++ samples[i + 256] = bias + Rt + Rss; ++ ++ } ++ ++ } else { ++ ++ int i; ++ sample_t common, surround; ++ ++ for (i = 0; i < 256; i++) { ++ common = samples[i + 256] + bias; ++ surround = samples[i + 768] + samples[i + 1024]; ++ samples[i] += common - surround; ++ samples[i + 256] = samples[i + 512] + common + surround; ++ } ++ ++ } ++ + } + + static void move2to1 (sample_t * src, sample_t * dest, sample_t bias) +@@ -533,7 +566,7 @@ + break; + + case CONVERT (A52_3F2R, A52_DOLBY): +- mix32toS (samples, bias); ++ mix32toS (samples, bias, ((output & A52_USE_DPLII) == A52_USE_DPLII)); + break; + + case CONVERT (A52_3F1R, A52_3F): diff --git a/contrib/a52dec/module.defs b/contrib/a52dec/module.defs new file mode 100644 index 000000000..470ddfa12 --- /dev/null +++ b/contrib/a52dec/module.defs @@ -0,0 +1,6 @@ +$(eval $(call import.MODULE.defs,A52DEC,a52dec)) +$(eval $(call import.CONTRIB.defs,A52DEC)) + +A52DEC.FETCH.url = http://download.m0k.org/handbrake/contrib/a52dec-0.7.4.tar.gz +A52DEC.EXTRACT.tarbase = a52dec +A52DEC.INSTALL.strip = liba52.a diff --git a/contrib/a52dec/module.rules b/contrib/a52dec/module.rules new file mode 100644 index 000000000..cecab72f7 --- /dev/null +++ b/contrib/a52dec/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,A52DEC)) +$(eval $(call import.CONTRIB.rules,A52DEC)) diff --git a/contrib/bzip2/module.defs b/contrib/bzip2/module.defs new file mode 100644 index 000000000..dcc878ad4 --- /dev/null +++ b/contrib/bzip2/module.defs @@ -0,0 +1,24 @@ +$(eval $(call import.MODULE.defs,BZIP2,bzip2)) +$(eval $(call import.CONTRIB.defs,BZIP2)) + +BZIP2.FETCH.url = http://download.m0k.org/handbrake/contrib/bzip2-1.0.5.tar.gz +BZIP2.EXTRACT.tarbase = bzip2 +BZIP2.CONFIGURE = + +BZIP2.BUILD.extra = \ + CC=$(BZIP2.GCC.gcc) \ + CFLAGS="$(call fn.ARGS,BZIP2.GCC,*archs)" \ + PREFIX=$(call fn.ABSOLUTE,$(CONTRIB.build/)) + +BZIP2.BUILD.ntargets = libbz2.a + +define BZIP2.INSTALL + mkdir -p $(CONTRIB.build/)lib/ $(CONTRIB.build/)include/ + cp $(BZIP2.EXTRACT.target/)libbz2.a $(CONTRIB.build/)lib/ + cp $(BZIP2.EXTRACT.target/)bzlib.h $(CONTRIB.build/)include/ +endef + +define BZIP2.UNINSTALL + rm $(CONTRIB.build/)lib/libbz2.a + rm $(CONTRIB.build/)include/bzlib.h +endef diff --git a/contrib/bzip2/module.rules b/contrib/bzip2/module.rules new file mode 100644 index 000000000..456bb1215 --- /dev/null +++ b/contrib/bzip2/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,BZIP2)) +$(eval $(call import.CONTRIB.rules,BZIP2)) diff --git a/contrib/faac/P00-cygwin.patch b/contrib/faac/P00-cygwin.patch new file mode 100644 index 000000000..d54b08d02 --- /dev/null +++ b/contrib/faac/P00-cygwin.patch @@ -0,0 +1,12 @@ +diff -Naur faac2/include/faac.h faac3/include/faac.h +--- faac/include/faac.h 2004-07-04 13:12:06.000000000 +0100 ++++ faac/include/faac.h 2008-08-17 19:56:29.734375000 +0100 +@@ -50,7 +50,7 @@ + typedef void *faacEncHandle; + + #ifndef HAVE_INT32_T +-typedef int int32_t; ++//typedef int int32_t; + #endif + + /* diff --git a/contrib/faac/module.defs b/contrib/faac/module.defs new file mode 100644 index 000000000..2b032fee9 --- /dev/null +++ b/contrib/faac/module.defs @@ -0,0 +1,8 @@ +$(eval $(call import.MODULE.defs,FAAC,faac)) +$(eval $(call import.CONTRIB.defs,FAAC)) + +FAAC.FETCH.url = http://download.m0k.org/handbrake/contrib/faac-1.26.tar.gz +FAAC.EXTRACT.tarbase = faac + +FAAC.CONFIGURE.bootstrap = ./bootstrap; +FAAC.CONFIGURE.extra = --without-mp4v2 diff --git a/contrib/faac/module.rules b/contrib/faac/module.rules new file mode 100644 index 000000000..5c311304a --- /dev/null +++ b/contrib/faac/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,FAAC)) +$(eval $(call import.CONTRIB.rules,FAAC)) diff --git a/contrib/faad2/A00-libtool22.patch b/contrib/faad2/A00-libtool22.patch new file mode 100644 index 000000000..4eab08487 --- /dev/null +++ b/contrib/faad2/A00-libtool22.patch @@ -0,0 +1,13 @@ +Index: faad2/configure.in +=================================================================== +--- faad2.orig/configure.in ++++ faad2/configure.in +@@ -18,7 +18,7 @@ dnl Checks for programs. + AC_PROG_CC + AC_PROG_CPP + dnl disable for mpeg4ip plugin +-dnl AC_PROG_CXX ++AC_PROG_CXX + AC_PROG_INSTALL + AC_PROG_LN_S + AC_PROG_MAKE_SET diff --git a/contrib/faad2/module.defs b/contrib/faad2/module.defs new file mode 100644 index 000000000..04b9e0b82 --- /dev/null +++ b/contrib/faad2/module.defs @@ -0,0 +1,7 @@ +$(eval $(call import.MODULE.defs,FAAD2,faad2)) +$(eval $(call import.CONTRIB.defs,FAAD2)) + +FAAD2.FETCH.url = http://download.m0k.org/handbrake/contrib/faad2-2.6.1.tar.gz +FAAD2.EXTRACT.tarbase = faad2 + +FAAD2.CONFIGURE.bootstrap = ./bootstrap; diff --git a/contrib/faad2/module.rules b/contrib/faad2/module.rules new file mode 100644 index 000000000..2b9bdd015 --- /dev/null +++ b/contrib/faad2/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,FAAD2)) +$(eval $(call import.CONTRIB.rules,FAAD2)) diff --git a/contrib/ffmpeg/A00-latm.patch b/contrib/ffmpeg/A00-latm.patch new file mode 100644 index 000000000..a286f4c19 --- /dev/null +++ b/contrib/ffmpeg/A00-latm.patch @@ -0,0 +1,886 @@ +diff -Naur ffmpeg.orig/libavcodec/Makefile ffmpeg/libavcodec/Makefile +--- ffmpeg.orig/libavcodec/Makefile 2008-12-01 01:40:36.000000000 -0500 ++++ ffmpeg/libavcodec/Makefile 2009-02-21 08:25:13.000000000 -0500 +@@ -338,7 +338,7 @@ + OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o + OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o + OBJS-$(CONFIG_LIBFAAC) += libfaac.o +-OBJS-$(CONFIG_LIBFAAD) += libfaad.o ++OBJS-$(CONFIG_LIBFAAD) += libfaad.o latmaac.o + OBJS-$(CONFIG_LIBGSM) += libgsm.o + OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o + OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o +@@ -350,7 +350,7 @@ + OBJS-$(CONFIG_LIBXVID) += libxvidff.o libxvid_rc.o + + # parsers +-OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o ++OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o latm_parser.o + OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o + OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o + OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o +diff -Naur ffmpeg.orig/libavcodec/allcodecs.c ffmpeg/libavcodec/allcodecs.c +--- ffmpeg.orig/libavcodec/allcodecs.c 2008-12-01 01:40:36.000000000 -0500 ++++ ffmpeg/libavcodec/allcodecs.c 2009-02-21 08:25:13.000000000 -0500 +@@ -291,6 +291,7 @@ + REGISTER_ENCDEC (LIBDIRAC, libdirac); + REGISTER_ENCODER (LIBFAAC, libfaac); + REGISTER_DECODER (LIBFAAD, libfaad); ++ REGISTER_DECODER (LIBFAAD, libfaad2); + REGISTER_ENCDEC (LIBGSM, libgsm); + REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms); + REGISTER_ENCODER (LIBMP3LAME, libmp3lame); +@@ -303,6 +304,7 @@ + + /* parsers */ + REGISTER_PARSER (AAC, aac); ++ REGISTER_PARSER (AAC, aac_latm); + REGISTER_PARSER (AC3, ac3); + REGISTER_PARSER (CAVSVIDEO, cavsvideo); + REGISTER_PARSER (DCA, dca); +diff -Naur ffmpeg.orig/libavcodec/avcodec.h ffmpeg/libavcodec/avcodec.h +--- ffmpeg.orig/libavcodec/avcodec.h 2008-12-01 01:40:36.000000000 -0500 ++++ ffmpeg/libavcodec/avcodec.h 2009-02-21 08:25:13.000000000 -0500 +@@ -264,6 +264,7 @@ + CODEC_ID_MP2= 0x15000, + CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 + CODEC_ID_AAC, ++ CODEC_ID_AAC_LATM, + CODEC_ID_AC3, + CODEC_ID_DTS, + CODEC_ID_VORBIS, +diff -Naur ffmpeg.orig/libavcodec/latm_parser.c ffmpeg/libavcodec/latm_parser.c +--- ffmpeg.orig/libavcodec/latm_parser.c 1969-12-31 19:00:00.000000000 -0500 ++++ ffmpeg/libavcodec/latm_parser.c 2009-02-21 08:25:13.000000000 -0500 +@@ -0,0 +1,128 @@ ++/* ++ * LATM parser ++ * Copyright (c) 2008 Paul Kendall ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file latm_parser.c ++ * LATM parser ++ */ ++ ++#include "parser.h" ++ ++#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits) ++#define LATM_MASK 0xFFE000 // top 11 bits ++#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits ++ ++typedef struct LATMParseContext{ ++ ParseContext pc; ++ int count; ++} LATMParseContext; ++ ++/** ++ * finds the end of the current frame in the bitstream. ++ * @return the position of the first byte of the next frame, or -1 ++ */ ++static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf, ++ int buf_size) { ++ LATMParseContext *s = s1->priv_data; ++ ParseContext *pc = &s->pc; ++ int pic_found, i; ++ uint32_t state; ++ ++ pic_found = pc->frame_start_found; ++ state = pc->state; ++ ++ i = 0; ++ if(!pic_found){ ++ for(i=0; icount = - i; ++ pic_found=1; ++ break; ++ } ++ } ++ } ++ ++ if(pic_found){ ++ /* EOF considered as end of frame */ ++ if (buf_size == 0) ++ return 0; ++ if((state & LATM_SIZE_MASK) - s->count <= buf_size) { ++ pc->frame_start_found = 0; ++ pc->state = -1; ++ return (state & LATM_SIZE_MASK) - s->count; ++ } ++ } ++ ++ s->count += buf_size; ++ pc->frame_start_found = pic_found; ++ pc->state = state; ++ return END_NOT_FOUND; ++} ++ ++static int latm_parse(AVCodecParserContext *s1, ++ AVCodecContext *avctx, ++ const uint8_t **poutbuf, int *poutbuf_size, ++ const uint8_t *buf, int buf_size) ++{ ++ LATMParseContext *s = s1->priv_data; ++ ParseContext *pc = &s->pc; ++ int next; ++ ++ if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){ ++ next = buf_size; ++ }else{ ++ next = latm_find_frame_end(s1, buf, buf_size); ++ ++ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { ++ *poutbuf = NULL; ++ *poutbuf_size = 0; ++ return buf_size; ++ } ++ } ++ *poutbuf = buf; ++ *poutbuf_size = buf_size; ++ return next; ++} ++ ++static int latm_split(AVCodecContext *avctx, ++ const uint8_t *buf, int buf_size) ++{ ++ int i; ++ uint32_t state= -1; ++ ++ for(i=0; i ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file latmaac.c ++ * LATM wrapped AAC decoder ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "parser.h" ++#include "bitstream.h" ++#include "mpeg4audio.h" ++#include "neaacdec.h" ++ ++#define min(a,b) ((a)<(b) ? (a) : (b)) ++ ++ ++/* ++ Note: This decoder filter is intended to decode LATM streams transferred ++ in MPEG transport streams which are only supposed to contain one program. ++ To do a more complex LATM demuxing a separate LATM demuxer should be used. ++*/ ++ ++#define AAC_NONE 0 // mode not detected (or indicated in mediatype) ++#define AAC_LATM 1 // LATM packets (ISO/IEC 14496-3 1.7.3 Multiplex layer) ++ ++#define SYNC_LATM 0x2b7 // 11 bits ++ ++#define MAX_SIZE 8*1024 ++ ++typedef struct AACConfig ++{ ++ uint8_t extra[64]; // should be way enough ++ int extrasize; ++ ++ int audioObjectType; ++ int samplingFrequencyIndex; ++ int samplingFrequency; ++ int channelConfiguration; ++ int channels; ++} AACConfig; ++ ++typedef struct AACParser ++{ ++ AACConfig config; ++ uint8_t frameLengthType; ++ uint16_t muxSlotLengthBytes; ++ ++ uint8_t audio_mux_version; ++ uint8_t audio_mux_version_A; ++ int taraFullness; ++ uint8_t config_crc; ++ int64_t other_data_bits; ++ ++ int mode; ++ int offset; // byte offset in "buf" buffer ++ uint8_t buf[MAX_SIZE]; // allocated buffer ++ int count; // number of bytes written in buffer ++} AACParser; ++ ++typedef struct AACDecoder ++{ ++ AACParser *parser; ++ faacDecHandle aac_decoder; ++ int open; ++ uint32_t in_samplerate; ++ uint8_t in_channels; ++} AACDecoder; ++ ++typedef struct { ++ AACDecoder* decoder; ++} FAACContext; ++ ++static inline int64_t latm_get_value(GetBitContext *b) ++{ ++ uint8_t bytesForValue = get_bits(b, 2); ++ int64_t value = 0; ++ int i; ++ for (i=0; i<=bytesForValue; i++) { ++ value <<= 8; ++ value |= get_bits(b, 8); ++ } ++ return value; ++} ++ ++static void readGASpecificConfig(struct AACConfig *cfg, GetBitContext *b, PutBitContext *o) ++{ ++ int framelen_flag = get_bits(b, 1); ++ put_bits(o, 1, framelen_flag); ++ int dependsOnCoder = get_bits(b, 1); ++ put_bits(o, 1, dependsOnCoder); ++ int ext_flag; ++ int delay; ++ int layerNr; ++ ++ if (dependsOnCoder) { ++ delay = get_bits(b, 14); ++ put_bits(o, 14, delay); ++ } ++ ext_flag = get_bits(b, 1); ++ put_bits(o, 1, ext_flag); ++ if (!cfg->channelConfiguration) { ++ // program config element ++ // TODO: ++ } ++ ++ if (cfg->audioObjectType == 6 || cfg->audioObjectType == 20) { ++ layerNr = get_bits(b, 3); ++ put_bits(o, 3, layerNr); ++ } ++ if (ext_flag) { ++ if (cfg->audioObjectType == 22) { ++ skip_bits(b, 5); // numOfSubFrame ++ skip_bits(b, 11); // layer_length ++ ++ put_bits(o, 16, 0); ++ } ++ if (cfg->audioObjectType == 17 || ++ cfg->audioObjectType == 19 || ++ cfg->audioObjectType == 20 || ++ cfg->audioObjectType == 23) { ++ ++ skip_bits(b, 3); // stuff ++ put_bits(o, 3, 0); ++ } ++ ++ skip_bits(b, 1); // extflag3 ++ put_bits(o, 1, 0); ++ } ++} ++ ++static int readAudioSpecificConfig(struct AACConfig *cfg, GetBitContext *b) ++{ ++ PutBitContext o; ++ init_put_bits(&o, cfg->extra, sizeof(cfg->extra)); ++ ++ // returns the number of bits read ++ int ret = 0; ++ int sbr_present = -1; ++ ++ // object ++ cfg->audioObjectType = get_bits(b, 5); ++ put_bits(&o, 5, cfg->audioObjectType); ++ if (cfg->audioObjectType == 31) { ++ uint8_t n = get_bits(b, 6); ++ put_bits(&o, 6, n); ++ cfg->audioObjectType = 32 + n; ++ } ++ ++ cfg->samplingFrequencyIndex = get_bits(b, 4); ++ cfg->samplingFrequency = ff_mpeg4audio_sample_rates[cfg->samplingFrequencyIndex]; ++ put_bits(&o, 4, cfg->samplingFrequencyIndex); ++ if (cfg->samplingFrequencyIndex == 0x0f) { ++ uint32_t f = get_bits_long(b, 24); ++ put_bits(&o, 24, f); ++ cfg->samplingFrequency = f; ++ } ++ cfg->channelConfiguration = get_bits(b, 4); ++ put_bits(&o, 4, cfg->channelConfiguration); ++ cfg->channels = ff_mpeg4audio_channels[cfg->channelConfiguration]; ++ ++ if (cfg->audioObjectType == 5) { ++ sbr_present = 1; ++ ++ // TODO: parsing !!!!!!!!!!!!!!!! ++ } ++ ++ switch (cfg->audioObjectType) { ++ case 1: ++ case 2: ++ case 3: ++ case 4: ++ case 6: ++ case 7: ++ case 17: ++ case 19: ++ case 20: ++ case 21: ++ case 22: ++ case 23: ++ readGASpecificConfig(cfg, b, &o); ++ break; ++ } ++ ++ if (sbr_present == -1) { ++ if (cfg->samplingFrequency <= 24000) { ++ cfg->samplingFrequency *= 2; ++ } ++ } ++ ++ // count the extradata ++ ret = put_bits_count(&o); ++ align_put_bits(&o); ++ flush_put_bits(&o); ++ cfg->extrasize = (ret + 7) >> 3; ++ return ret; ++} ++ ++static void readStreamMuxConfig(struct AACParser *parser, GetBitContext *b) ++{ ++ parser->audio_mux_version_A = 0; ++ parser->audio_mux_version = get_bits(b, 1); ++ if (parser->audio_mux_version == 1) { // audioMuxVersion ++ parser->audio_mux_version_A = get_bits(b, 1); ++ } ++ ++ if (parser->audio_mux_version_A == 0) { ++ if (parser->audio_mux_version == 1) { ++ parser->taraFullness = latm_get_value(b); ++ } ++ get_bits(b, 1); // allStreamSameTimeFraming = 1 ++ get_bits(b, 6); // numSubFrames = 0 ++ get_bits(b, 4); // numPrograms = 0 ++ ++ // for each program ++ get_bits(b, 3); // numLayer = 0 ++ ++ // for each layer ++ if (parser->audio_mux_version == 0) { ++ // audio specific config. ++ readAudioSpecificConfig(&parser->config, b); ++ } else { ++ int ascLen = latm_get_value(b); ++ ascLen -= readAudioSpecificConfig(&parser->config, b); ++ ++ // fill bits ++ while (ascLen > 16) { ++ skip_bits(b, 16); ++ ascLen -= 16; ++ } ++ skip_bits(b, ascLen); ++ } ++ ++ // these are not needed... perhaps ++ int frame_length_type = get_bits(b, 3); ++ parser->frameLengthType = frame_length_type; ++ if (frame_length_type == 0) { ++ get_bits(b, 8); ++ } else if (frame_length_type == 1) { ++ get_bits(b, 9); ++ } else if (frame_length_type == 3 || ++ frame_length_type == 4 || ++ frame_length_type == 5) { ++ int celp_table_index = get_bits(b, 6); ++ } else if (frame_length_type == 6 || ++ frame_length_type == 7) { ++ int hvxc_table_index = get_bits(b, 1); ++ } ++ ++ // other data ++ parser->other_data_bits = 0; ++ if (get_bits(b, 1)) { ++ // other data present ++ if (parser->audio_mux_version == 1) { ++ parser->other_data_bits = latm_get_value(b); ++ } else { ++ // other data not present ++ parser->other_data_bits = 0; ++ int esc, tmp; ++ do { ++ parser->other_data_bits <<= 8; ++ esc = get_bits(b, 1); ++ tmp = get_bits(b, 8); ++ parser->other_data_bits |= tmp; ++ } while (esc); ++ } ++ } ++ ++ // CRC ++ if (get_bits(b, 1)) { ++ parser->config_crc = get_bits(b, 8); ++ } ++ } else { ++ // tbd ++ } ++} ++ ++static void readPayloadLengthInfo(struct AACParser *parser, GetBitContext *b) ++{ ++ uint8_t tmp; ++ if (parser->frameLengthType == 0) { ++ parser->muxSlotLengthBytes = 0; ++ do { ++ tmp = get_bits(b, 8); ++ parser->muxSlotLengthBytes += tmp; ++ } while (tmp == 255); ++ } else { ++ if (parser->frameLengthType == 5 || ++ parser->frameLengthType == 7 || ++ parser->frameLengthType == 3) { ++ get_bits(b, 2); ++ } ++ } ++} ++ ++static void readAudioMuxElement(struct AACParser *parser, GetBitContext *b, uint8_t *payload, int *payloadsize) ++{ ++ uint8_t use_same_mux = get_bits(b, 1); ++ if (!use_same_mux) { ++ readStreamMuxConfig(parser, b); ++ } ++ ++ if (parser->audio_mux_version_A == 0) { ++ int j; ++ ++ readPayloadLengthInfo(parser, b); ++ ++ // copy data ++ for (j=0; jmuxSlotLengthBytes; j++) { ++ *payload++ = get_bits(b, 8); ++ } ++ *payloadsize = parser->muxSlotLengthBytes; ++ ++ // ignore otherdata ++ } else { ++ // TBD ++ } ++} ++ ++static int readAudioSyncStream(struct AACParser *parser, GetBitContext *b, int size, uint8_t *payload, int *payloadsize) ++{ ++ // ISO/IEC 14496-3 Table 1.28 - Syntax of AudioMuxElement() ++ if (get_bits(b, 11) != 0x2b7) return -1; // not LATM ++ int muxlength = get_bits(b, 13); ++ ++ if (3+muxlength > size) return 0; // not enough data ++ ++ readAudioMuxElement(parser, b, payload, payloadsize); ++ ++ // we don't parse anything else here... ++ return (3+muxlength); ++} ++ ++ ++static void flush_buf(struct AACParser *parser, int offset) { ++ int bytes_to_flush = min(parser->count, offset); ++ int left = (parser->count - bytes_to_flush); ++ ++ if (bytes_to_flush > 0) { ++ if (left > 0) { ++ memcpy(parser->buf, parser->buf+bytes_to_flush, left); ++ parser->count = left; ++ } else { ++ parser->count = 0; ++ } ++ } ++} ++ ++static struct AACParser *latm_create_parser() ++{ ++ struct AACParser *parser = (struct AACParser *)av_malloc(sizeof(struct AACParser)); ++ memset(parser, 0, sizeof(struct AACParser)); ++ return parser; ++} ++ ++static void latm_destroy_parser(struct AACParser *parser) ++{ ++ av_free(parser); ++} ++ ++static void latm_flush(struct AACParser *parser) ++{ ++ parser->offset = 0; ++ parser->count = 0; ++} ++ ++static void latm_write_data(struct AACParser *parser, uint8_t *data, int len) ++{ ++ // buffer overflow check... just ignore the data before ++ if (parser->count + len > MAX_SIZE) { ++ flush_buf(parser, parser->offset); ++ parser->offset = 0; ++ if (parser->count + len > MAX_SIZE) { ++ int to_flush = (parser->count+len) - MAX_SIZE; ++ flush_buf(parser, to_flush); ++ } ++ } ++ ++ // append data ++ memcpy(parser->buf+parser->count, data, len); ++ parser->count += len; ++} ++ ++static int latm_parse_packet(struct AACParser *parser, uint8_t *data, int maxsize) ++{ ++ /* ++ Return value is either number of bytes parsed or ++ -1 when failed. ++ 0 = need more data. ++ */ ++ ++ uint8_t *start = parser->buf + parser->offset; ++ int bytes = parser->count - parser->offset; ++ GetBitContext b; ++ init_get_bits(&b, start, bytes); ++ ++ if (parser->mode == AAC_LATM) { ++ int outsize = 0; ++ int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize); ++ ++ if (ret < 0) return -1; ++ if (ret == 0) return 0; ++ ++ // update the offset ++ parser->offset += ret; ++ return outsize; ++ } ++ ++ // check for syncwords ++ while (bytes > 2) { ++ if (show_bits(&b, 11) == SYNC_LATM) { ++ // we must parse config first... ++ int outsize = 0; ++ ++ // check if there is a complete packet available... ++ int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize); ++ if (ret < 0) return -1; ++ if (ret == 0) return 0; ++ parser->offset += ret; ++ ++ parser->mode = AAC_LATM; ++ return outsize; ++ } ++ skip_bits(&b, 8); ++ parser->offset++; ++ bytes--; ++ } ++ return 0; ++} ++ ++static void aac_filter_close(AACDecoder *decoder) ++{ ++ if (decoder->aac_decoder) { ++ NeAACDecClose(decoder->aac_decoder); ++ decoder->aac_decoder = NULL; ++ } ++ decoder->open = 0; ++} ++ ++static int aac_decoder_open(AACDecoder *decoder) ++{ ++ if (decoder->aac_decoder) return 0; ++ ++ decoder->aac_decoder = NeAACDecOpen(); ++ if (!decoder->aac_decoder) return -1; ++ ++ // are we going to initialize from decoder specific info ? ++ if (decoder->parser->config.extrasize > 0) { ++ char ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &decoder->in_samplerate, &decoder->in_channels); ++ if (ret < 0) { ++ aac_filter_close(decoder); // gone wrong ? ++ return -1; ++ } ++ decoder->open = 1; ++ } else { ++ // we'll open the decoder later... ++ decoder->open = 0; ++ } ++ return 0; ++} ++ ++AACDecoder *aac_filter_create() ++{ ++ AACDecoder *decoder = (AACDecoder *)av_malloc(sizeof(AACDecoder)); ++ decoder->parser = latm_create_parser(); ++ decoder->aac_decoder = NULL; ++ decoder->open = 0; ++ return (void *)decoder; ++} ++ ++void aac_filter_destroy(AACDecoder *decoder) ++{ ++ aac_filter_close(decoder); ++ latm_destroy_parser(decoder->parser); ++ av_free(decoder); ++} ++ ++int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size) ++{ ++ uint8_t tempbuf[32*1024]; ++ int ret; ++ int consumed = size; ++ int decoded; ++ int max_size = *out_size; ++ ++ *out_size = 0; ++ ++ //------------------------------------------------------------------------- ++ // Multiplex Parsing ++ //------------------------------------------------------------------------- ++ ++ latm_write_data(decoder->parser, data, size); ++ ++ do { ++ ret = latm_parse_packet(decoder->parser, tempbuf, sizeof(tempbuf)); ++ if (ret < 0) { ++ latm_flush(decoder->parser); ++ return consumed; ++ } ++ if (ret == 0) return consumed; ++ ++ data = tempbuf; ++ size = ret; ++ ++ //------------------------------------------------------------------------- ++ // Initialize decoder (if necessary) ++ //------------------------------------------------------------------------- ++ if (!decoder->open) { ++ aac_filter_close(decoder); ++ if (decoder->parser->mode == AAC_LATM) { ++ ret = aac_decoder_open(decoder); ++ if (ret < 0) return consumed; ++ } ++ ++ if(!decoder->open) return consumed; ++ } ++ ++ //------------------------------------------------------------------------- ++ // Decode samples ++ //------------------------------------------------------------------------- ++ NeAACDecFrameInfo info; ++ void *buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size); ++ ++ if (buf) { ++ decoder->in_samplerate = info.samplerate; ++ decoder->in_channels = info.channels; ++ ++ //--------------------------------------------------------------------- ++ // Deliver decoded samples ++ //--------------------------------------------------------------------- ++ ++ // kram dekoduje 16-bit. my vypustame 16-bit. takze by to malo byt okej ++ decoded = info.samples * sizeof(short); ++ ++ // napraskame tam sample ++ *out_size += decoded; ++ if(*out_size > max_size) { ++ av_log(NULL, AV_LOG_ERROR, "overflow!\n"); ++ } else { ++ memcpy(out, buf, decoded); ++ out = (unsigned char *)out + decoded; ++ } ++ } else { ++ // need more data ++ break; ++ } ++ ++ } while (1); // decode all packets ++ return consumed; ++} ++ ++void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels) ++{ ++ if(!decoder->open) return; ++ *sample_rate = decoder->in_samplerate; ++ *channels = decoder->in_channels; ++} ++ ++static int faac_decode_init(AVCodecContext *avctx) ++{ ++ FAACContext *s = avctx->priv_data; ++ avctx->frame_size = 360; ++ avctx->sample_rate = 48000; ++ avctx->channels = 2; ++ avctx->bit_rate = 8192 * 8 * avctx->sample_rate / avctx->frame_size; ++ s->decoder = aac_filter_create(); ++ return 0; ++} ++ ++static int faac_decode_frame(AVCodecContext *avctx, ++ void *data, int *data_size, ++ uint8_t *buf, int buf_size) ++{ ++ FAACContext *s = avctx->priv_data; ++ int ret; ++ ++ if (s->decoder == NULL) faac_decode_init(avctx); ++ ret = aac_filter_receive(s->decoder, data, data_size, buf, buf_size); ++ aac_filter_getinfo(s->decoder, &(avctx->sample_rate), &(avctx->channels)); ++ return ret; ++} ++ ++static int faac_decode_end(AVCodecContext *avctx) ++{ ++ FAACContext *s = avctx->priv_data; ++ if(s->decoder != NULL) { ++ aac_filter_destroy(s->decoder); ++ } ++ return 0; ++} ++ ++AVCodec libfaad2_decoder = { ++ .name = "AAC_LATM", ++ .type = CODEC_TYPE_AUDIO, ++ .id = CODEC_ID_AAC_LATM, ++ .priv_data_size = sizeof (FAACContext), ++ .init = faac_decode_init, ++ .close = faac_decode_end, ++ .decode = faac_decode_frame, ++ .long_name = "AAC over LATM", ++}; ++ +diff -Naur ffmpeg.orig/libavformat/mpeg.c ffmpeg/libavformat/mpeg.c +--- ffmpeg.orig/libavformat/mpeg.c 2008-10-02 12:03:00.000000000 -0400 ++++ ffmpeg/libavformat/mpeg.c 2009-02-21 08:25:13.000000000 -0500 +@@ -281,7 +281,7 @@ + /* find matching stream */ + if (!((startcode >= 0x1c0 && startcode <= 0x1df) || + (startcode >= 0x1e0 && startcode <= 0x1ef) || +- (startcode == 0x1bd) || (startcode == 0x1fd))) ++ (startcode == 0x1bd) || (startcode == 0x1fa) || (startcode == 0x1fd))) + goto redo; + if (ppos) { + *ppos = url_ftell(s->pb) - 4; +@@ -441,6 +441,9 @@ + } else if(es_type == STREAM_TYPE_AUDIO_AAC){ + codec_id = CODEC_ID_AAC; + type = CODEC_TYPE_AUDIO; ++ } else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){ ++ codec_id = CODEC_ID_AAC_LATM; ++ type = CODEC_TYPE_AUDIO; + } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){ + codec_id = CODEC_ID_MPEG4; + type = CODEC_TYPE_VIDEO; +diff -Naur ffmpeg.orig/libavformat/mpeg.h ffmpeg/libavformat/mpeg.h +--- ffmpeg.orig/libavformat/mpeg.h 2008-08-31 03:39:47.000000000 -0400 ++++ ffmpeg/libavformat/mpeg.h 2009-02-21 08:25:13.000000000 -0500 +@@ -53,6 +53,7 @@ + #define STREAM_TYPE_PRIVATE_DATA 0x06 + #define STREAM_TYPE_AUDIO_AAC 0x0f + #define STREAM_TYPE_VIDEO_MPEG4 0x10 ++#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 + #define STREAM_TYPE_VIDEO_H264 0x1b + + #define STREAM_TYPE_AUDIO_AC3 0x81 +diff -Naur ffmpeg.orig/libavformat/mpegts.c ffmpeg/libavformat/mpegts.c +--- ffmpeg.orig/libavformat/mpegts.c 2008-10-02 12:28:58.000000000 -0400 ++++ ffmpeg/libavformat/mpegts.c 2009-02-21 08:25:13.000000000 -0500 +@@ -625,6 +625,7 @@ + case STREAM_TYPE_VIDEO_VC1: + case STREAM_TYPE_VIDEO_DIRAC: + case STREAM_TYPE_AUDIO_AAC: ++ case STREAM_TYPE_AUDIO_AAC_LATM: + case STREAM_TYPE_AUDIO_AC3: + case STREAM_TYPE_AUDIO_DTS: + case STREAM_TYPE_AUDIO_HDMV_DTS: +@@ -847,7 +848,7 @@ + code = pes->header[3] | 0x100; + if (!((code >= 0x1c0 && code <= 0x1df) || + (code >= 0x1e0 && code <= 0x1ef) || +- (code == 0x1bd) || (code == 0x1fd))) ++ (code == 0x1bd) || (code == 0x1fa) || (code == 0x1fd))) + goto skip; + if (!pes->st) { + /* allocate stream */ +@@ -968,6 +969,10 @@ + codec_type = CODEC_TYPE_AUDIO; + codec_id = CODEC_ID_AAC; + break; ++ case STREAM_TYPE_AUDIO_AAC_LATM: ++ codec_type = CODEC_TYPE_AUDIO; ++ codec_id = CODEC_ID_AAC_LATM; ++ break; + case STREAM_TYPE_AUDIO_AC3: + codec_type = CODEC_TYPE_AUDIO; + codec_id = CODEC_ID_AC3; +diff -Naur ffmpeg.orig/libavformat/mpegts.h ffmpeg/libavformat/mpegts.h +--- ffmpeg.orig/libavformat/mpegts.h 2008-08-31 03:39:47.000000000 -0400 ++++ ffmpeg/libavformat/mpegts.h 2009-02-21 08:25:13.000000000 -0500 +@@ -50,6 +50,7 @@ + #define STREAM_TYPE_PRIVATE_DATA 0x06 + #define STREAM_TYPE_AUDIO_AAC 0x0f + #define STREAM_TYPE_VIDEO_MPEG4 0x10 ++#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 + #define STREAM_TYPE_VIDEO_H264 0x1b + #define STREAM_TYPE_VIDEO_VC1 0xea + #define STREAM_TYPE_VIDEO_DIRAC 0xd1 diff --git a/contrib/ffmpeg/A01-mpegleak.patch b/contrib/ffmpeg/A01-mpegleak.patch new file mode 100644 index 000000000..36179ba57 --- /dev/null +++ b/contrib/ffmpeg/A01-mpegleak.patch @@ -0,0 +1,56 @@ +diff -Naur ffmpeg.orig/libavcodec/h264.c ffmpeg/libavcodec/h264.c +--- ffmpeg.orig/libavcodec/h264.c 2008-12-01 11:24:19.000000000 -0500 ++++ ffmpeg/libavcodec/h264.c 2009-02-21 08:23:58.000000000 -0500 +@@ -3298,7 +3298,7 @@ + * stream. Need to discard one frame. Prevents overrun of the + * short_ref and long_ref buffers. + */ +- av_log(h->s.avctx, AV_LOG_ERROR, ++ av_log(h->s.avctx, AV_LOG_DEBUG, + "number of reference frames exceeds max (probably " + "corrupt input), discarding one\n"); + +@@ -7556,7 +7556,7 @@ + + if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){ + if (avctx->skip_frame >= AVDISCARD_NONREF || s->hurry_up) return 0; +- av_log(avctx, AV_LOG_ERROR, "no frame!\n"); ++ av_log(avctx, AV_LOG_DEBUG, "no frame!\n"); + return -1; + } + +diff -Naur ffmpeg.orig/libavcodec/mpegvideo.c ffmpeg/libavcodec/mpegvideo.c +--- ffmpeg.orig/libavcodec/mpegvideo.c 2008-10-01 20:27:09.000000000 -0400 ++++ ffmpeg/libavcodec/mpegvideo.c 2009-02-21 08:23:58.000000000 -0500 +@@ -779,19 +779,18 @@ + } + + av_log(s->avctx, AV_LOG_FATAL, "Internal error, picture buffer overflow\n"); +- /* We could return -1, but the codec would crash trying to draw into a +- * non-existing frame anyway. This is safer than waiting for a random crash. +- * Also the return of this is never useful, an encoder must only allocate +- * as much as allowed in the specification. This has no relationship to how +- * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large +- * enough for such valid streams). +- * Plus, a decoder has to check stream validity and remove frames if too +- * many reference frames are around. Waiting for "OOM" is not correct at +- * all. Similarly, missing reference frames have to be replaced by +- * interpolated/MC frames, anything else is a bug in the codec ... +- */ +- abort(); +- return -1; ++ /* XXX there seems to be a leak caused by h264 in mpeg transport ++ * streams: Over-the-air streams have a lot of errors. A picture ++ * may be marked as referenced but the actual references get lost ++ * so it never gets released. We take care of that here by releasing ++ * the oldest we have & reusing its slot. */ ++ int oldest=0; ++ for(i=0; ipicture[i].coded_picture_number < s->picture[oldest].coded_picture_number) ++ oldest = i; ++ } ++ s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[oldest]); ++ return oldest; + } + + static void update_noise_reduction(MpegEncContext *s){ diff --git a/contrib/ffmpeg/A02-audioconvert.patch b/contrib/ffmpeg/A02-audioconvert.patch new file mode 100644 index 000000000..5062e3439 --- /dev/null +++ b/contrib/ffmpeg/A02-audioconvert.patch @@ -0,0 +1,12 @@ +diff -Naur ffmpeg.orig/libavcodec/Makefile ffmpeg/libavcodec/Makefile +--- ffmpeg.orig/libavcodec/Makefile 2008-12-01 01:40:36.000000000 -0500 ++++ ffmpeg/libavcodec/Makefile 2009-02-23 07:03:23.000000000 -0500 +@@ -3,7 +3,7 @@ + NAME = avcodec + FFLIBS = avutil + +-HEADERS = avcodec.h opt.h ++HEADERS = avcodec.h opt.h audioconvert.h + + OBJS = allcodecs.o \ + audioconvert.o \ diff --git a/contrib/ffmpeg/P00-cygwin.patch b/contrib/ffmpeg/P00-cygwin.patch new file mode 100644 index 000000000..b6ca99f26 --- /dev/null +++ b/contrib/ffmpeg/P00-cygwin.patch @@ -0,0 +1,15 @@ +diff -Naur ffmpeg/libavcodec/mpegaudiodec.c ffmpeg-patched/libavcodec/mpegaudiodec.c +--- ffmpeg/libavcodec/mpegaudiodec.c 2006-09-23 14:22:06.000000000 -0400 ++++ ffmpeg-patched/libavcodec/mpegaudiodec.c 2007-01-01 18:31:51.156250000 -0500 +@@ -401,9 +401,9 @@ + for(i=0; i<512*16; i++){ + int exponent= (i>>4); + double f= pow(i&15, 4.0 / 3.0) * pow(2, (exponent-400)*0.25 + FRAC_BITS + 5); +- expval_table[exponent][i&15]= llrint(f); ++ expval_table[exponent][i&15]= lrint(f); + if((i&15)==1) +- exp_table[exponent]= llrint(f); ++ exp_table[exponent]= lrint(f); + } + + for(i=0;i<7;i++) { diff --git a/contrib/ffmpeg/P01-sunos.patch b/contrib/ffmpeg/P01-sunos.patch new file mode 100644 index 000000000..f5cd7d726 --- /dev/null +++ b/contrib/ffmpeg/P01-sunos.patch @@ -0,0 +1,25 @@ +--- ffmpeg/configure Sat Jun 7 03:19:09 2008 ++++ ffmpeg.solaris/configure Thu Jun 19 12:10:48 2008 +@@ -50,6 +50,9 @@ + exit 1 + fi + ++# Solaris must use the xpg4 version of grep ++PATH=/usr/xpg4/bin:$PATH ++ + show_help(){ + echo "Usage: configure [options]" + echo "Options: [defaults in brackets after descriptions]" +@@ -1585,8 +1588,11 @@ + check_cc < + +-static int wav_play (ao_instance_t * _instance, int flags, sample_t * _samples) ++static int wav_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) + { + wav_instance_t * instance = (wav_instance_t *) _instance; + union +diff -Naur libdca/libao/audio_out_win.c libdca_patched/libao/audio_out_win.c +--- libdca/libao/audio_out_win.c 2007-05-02 10:05:04.000000000 +0100 ++++ libdca_patched/libao/audio_out_win.c 2007-05-02 10:09:36.000000000 +0100 +@@ -55,7 +55,7 @@ + } win_instance_t; + + static int win_setup (ao_instance_t * _instance, int sample_rate, int * flags, +- level_t * level, sample_t * bias) ++ dca_level_t * level, dca_sample_t * bias) + { + win_instance_t * instance = (win_instance_t *) _instance; + +@@ -70,7 +70,7 @@ + return 0; + } + +-static int win_play (ao_instance_t * _instance, int flags, sample_t * _samples) ++static int win_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) + { + win_instance_t * instance = (win_instance_t *) _instance; + int current_buffer; +diff -Naur libdca/libdca/dca_internal.h libdca_patched/libdca/dca_internal.h +--- libdca/libdca/dca_internal.h 2007-05-02 10:05:05.000000000 +0100 ++++ libdca_patched/libdca/dca_internal.h 2007-05-02 10:09:35.000000000 +0100 +@@ -116,20 +116,20 @@ + double subband_fir_noidea[DCA_PRIM_CHANNELS_MAX][64]; + + /* Audio output */ +- level_t clev; /* centre channel mix level */ +- level_t slev; /* surround channels mix level */ ++ dca_level_t clev; /* centre channel mix level */ ++ dca_level_t slev; /* surround channels mix level */ + + int output; /* type of output */ +- level_t level; /* output level */ +- sample_t bias; /* output bias */ ++ dca_level_t level; /* output level */ ++ dca_sample_t bias; /* output bias */ + +- sample_t * samples; /* pointer to the internal audio samples buffer */ ++ dca_sample_t * samples; /* pointer to the internal audio samples buffer */ + int downmixed; + + int dynrnge; /* apply dynamic range */ +- level_t dynrng; /* dynamic range */ ++ dca_level_t dynrng; /* dynamic range */ + void * dynrngdata; /* dynamic range callback funtion and data */ +- level_t (* dynrngcall) (level_t range, void * dynrngdata); ++ dca_level_t (* dynrngcall) (dca_level_t range, void * dynrngdata); + + /* Bitstream handling */ + uint32_t * buffer_start; +@@ -155,19 +155,23 @@ + #define LEVEL_45DB 0.5946035575013605 + #define LEVEL_6DB 0.5 + +-int dca_downmix_init (int input, int flags, level_t * level, +- level_t clev, level_t slev); +-int dca_downmix_coeff (level_t * coeff, int acmod, int output, level_t level, +- level_t clev, level_t slev); +-void dca_downmix (sample_t * samples, int acmod, int output, sample_t bias, +- level_t clev, level_t slev); +-void dca_upmix (sample_t * samples, int acmod, int output); ++// these next two constants are used for DPL matrix encoding in downmix.c ++#define LEVEL_SQRT_1_2 0.5 ++#define LEVEL_SQRT_3_4 0.8660254037844386 ++ ++int dca_downmix_init (int input, int flags, dca_level_t * level, ++ dca_level_t clev, dca_level_t slev); ++int dca_downmix_coeff (dca_level_t * coeff, int acmod, int output, dca_level_t level, ++ dca_level_t clev, dca_level_t slev); ++void dca_downmix (dca_sample_t * samples, int acmod, int output, dca_sample_t bias, ++ dca_level_t clev, dca_level_t slev); ++void dca_upmix (dca_sample_t * samples, int acmod, int output); + + #define ROUND(x) ((int)((x) + ((x) > 0 ? 0.5 : -0.5))) + + #ifndef LIBDCA_FIXED + +-typedef sample_t quantizer_t; ++typedef dca_sample_t quantizer_t; + #define SAMPLE(x) (x) + #define LEVEL(x) (x) + #define MUL(a,b) ((a) * (b)) +@@ -179,8 +183,8 @@ + #else /* LIBDCA_FIXED */ + + typedef int16_t quantizer_t; +-#define SAMPLE(x) (sample_t)((x) * (1 << 30)) +-#define LEVEL(x) (level_t)((x) * (1 << 26)) ++#define SAMPLE(x) (dca_sample_t)((x) * (1 << 30)) ++#define LEVEL(x) (dca_level_t)((x) * (1 << 26)) + + #if 0 + #define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30)) +diff -Naur libdca/libdca/downmix.c libdca_patched/libdca/downmix.c +--- libdca/libdca/downmix.c 2007-05-02 10:05:05.000000000 +0100 ++++ libdca_patched/libdca/downmix.c 2007-05-06 19:45:54.000000000 +0100 +@@ -33,8 +33,8 @@ + + #define CONVERT(acmod,output) (((output) << DCA_CHANNEL_BITS) + (acmod)) + +-int dca_downmix_init (int input, int flags, level_t * level, +- level_t clev, level_t slev) ++int dca_downmix_init (int input, int flags, dca_level_t * level, ++ dca_level_t clev, dca_level_t slev) + { + static uint8_t table[11][10] = { + /* DCA_MONO */ +@@ -96,7 +96,7 @@ + output = DCA_DOLBY; + + if (flags & DCA_ADJUST_LEVEL) { +- level_t adjust; ++ dca_level_t adjust; + + switch (CONVERT (input & 7, output)) { + +@@ -181,13 +181,16 @@ + *level = MUL_L (*level, adjust); + } + ++ // add the DPLI/DPLII flag back into the output if one was passed in ++ output = output | (flags & DCA_OUT_DPLI) | (flags & DCA_OUT_DPLII); ++ + return output; + } + +-int dca_downmix_coeff (level_t * coeff, int acmod, int output, level_t level, +- level_t clev, level_t slev) ++int dca_downmix_coeff (dca_level_t * coeff, int acmod, int output, dca_level_t level, ++ dca_level_t clev, dca_level_t slev) + { +- level_t level_3db; ++ dca_level_t level_3db; + + level_3db = MUL_C (level, LEVEL_3DB); + +@@ -344,7 +347,7 @@ + return -1; /* NOTREACHED */ + } + +-static void mix2to1 (sample_t * dest, sample_t * src, sample_t bias) ++static void mix2to1 (dca_sample_t * dest, dca_sample_t * src, dca_sample_t bias) + { + int i; + +@@ -352,7 +355,7 @@ + dest[i] += BIAS (src[i]); + } + +-static void mix3to1 (sample_t * samples, sample_t bias) ++static void mix3to1 (dca_sample_t * samples, dca_sample_t bias) + { + int i; + +@@ -360,7 +363,7 @@ + samples[i] += BIAS (samples[i + 256] + samples[i + 512]); + } + +-static void mix4to1 (sample_t * samples, sample_t bias) ++static void mix4to1 (dca_sample_t * samples, dca_sample_t bias) + { + int i; + +@@ -369,7 +372,7 @@ + samples[i + 768]); + } + +-static void mix5to1 (sample_t * samples, sample_t bias) ++static void mix5to1 (dca_sample_t * samples, dca_sample_t bias) + { + int i; + +@@ -378,10 +381,10 @@ + samples[i + 768] + samples[i + 1024]); + } + +-static void mix3to2 (sample_t * samples, sample_t bias) ++static void mix3to2 (dca_sample_t * samples, dca_sample_t bias) + { + int i; +- sample_t common; ++ dca_sample_t common; + + for (i = 0; i < 256; i++) { + common = BIAS (samples[i]); +@@ -390,10 +393,10 @@ + } + } + +-static void mix21to2 (sample_t * left, sample_t * right, sample_t bias) ++static void mix21to2 (dca_sample_t * left, dca_sample_t * right, dca_sample_t bias) + { + int i; +- sample_t common; ++ dca_sample_t common; + + for (i = 0; i < 256; i++) { + common = BIAS (right[i + 256]); +@@ -402,10 +405,10 @@ + } + } + +-static void mix21toS (sample_t * samples, sample_t bias) ++static void mix21toS (dca_sample_t * samples, dca_sample_t bias) + { + int i; +- sample_t surround; ++ dca_sample_t surround; + + for (i = 0; i < 256; i++) { + surround = samples[i + 512]; +@@ -414,10 +417,10 @@ + } + } + +-static void mix31to2 (sample_t * samples, sample_t bias) ++static void mix31to2 (dca_sample_t * samples, dca_sample_t bias) + { + int i; +- sample_t common; ++ dca_sample_t common; + + for (i = 0; i < 256; i++) { + common = BIAS (samples[i] + samples[i + 768]); +@@ -426,23 +429,32 @@ + } + } + +-static void mix31toS (sample_t * samples, sample_t bias) ++static void mix31toS (dca_sample_t * samples, dca_sample_t bias) + { +- int i; +- sample_t common, surround; + +- for (i = 0; i < 256; i++) { +- common = BIAS (samples[i]); +- surround = samples[i + 768]; +- samples[i] = samples[i + 256] + common - surround; +- samples[i + 256] = samples[i + 512] + common + surround; +- } ++ int i; ++ dca_sample_t cc, surround, Lt, Rt; ++ ++ for (i = 0; i < 256; i++) { ++ ++ cc = samples[i] * LEVEL_3DB; ++ ++ surround = samples[i + 768]; ++ ++ Lt = samples[i + 256] + cc; ++ Rt = samples[i + 512] + cc; ++ ++ samples[i] = Lt - surround; ++ samples[i + 256] = Rt + surround; ++ ++ } ++ + } + +-static void mix22toS (sample_t * samples, sample_t bias) ++static void mix22toS (dca_sample_t * samples, dca_sample_t bias) + { + int i; +- sample_t surround; ++ dca_sample_t surround; + + for (i = 0; i < 256; i++) { + surround = samples[i + 512] + samples[i + 768]; +@@ -451,10 +463,10 @@ + } + } + +-static void mix32to2 (sample_t * samples, sample_t bias) ++static void mix32to2 (dca_sample_t * samples, dca_sample_t bias) + { + int i; +- sample_t common; ++ dca_sample_t common; + + for (i = 0; i < 256; i++) { + common = BIAS (samples[i]); +@@ -463,20 +475,55 @@ + } + } + +-static void mix32toS (sample_t * samples, sample_t bias) ++static void mix32toS (dca_sample_t * samples, dca_sample_t bias, int use_dpl2) + { +- int i; +- sample_t common, surround; + +- for (i = 0; i < 256; i++) { +- common = BIAS (samples[i]); +- surround = samples[i + 768] + samples[i + 1024]; +- samples[i] = samples[i + 256] + common - surround; +- samples[i + 256] = samples[i + 512] + common + surround; +- } +-} ++ if (use_dpl2 == 1) { + +-static void move2to1 (sample_t * src, sample_t * dest, sample_t bias) ++ int i; ++ dca_sample_t cc, Lt, Rt, Ls, Rs, Lss, Rss; ++ ++ for (i = 0; i < 256; i++) { ++ ++ cc = samples[i] * LEVEL_3DB; ++ ++ Lt = samples[i + 256] + cc; ++ Rt = samples[i + 512] + cc; ++ ++ Ls = samples[i + 768]; ++ Rs = samples[i + 1024]; ++ ++ Lss = (LEVEL_SQRT_3_4 * Ls) - (LEVEL_SQRT_1_2 * Rs); ++ Rss = -(LEVEL_SQRT_1_2 * Ls) + (LEVEL_SQRT_3_4 * Rs); ++ ++ samples[i] = Lt + Lss; ++ samples[i + 256] = Rt + Rss; ++ ++ } ++ ++ } else { ++ ++ int i; ++ dca_sample_t cc, surround, Lt, Rt; ++ ++ for (i = 0; i < 256; i++) { ++ ++ cc = samples[i] * LEVEL_3DB; ++ ++ surround = samples[i + 768] + samples[i + 1024]; ++ ++ Lt = samples[i + 256] + cc; ++ Rt = samples[i + 512] + cc; ++ ++ samples[i] = Lt - surround; ++ samples[i + 256] = Rt + surround; ++ ++ } ++ ++ } ++ ++} ++static void move2to1 (dca_sample_t * src, dca_sample_t * dest, dca_sample_t bias) + { + int i; + +@@ -484,7 +531,7 @@ + dest[i] = BIAS (src[i] + src[i + 256]); + } + +-static void zero (sample_t * samples) ++static void zero (dca_sample_t * samples) + { + int i; + +@@ -492,8 +539,8 @@ + samples[i] = 0; + } + +-void dca_downmix (sample_t * samples, int acmod, int output, sample_t bias, +- level_t clev, level_t slev) ++void dca_downmix (dca_sample_t * samples, int acmod, int output, dca_sample_t bias, ++ dca_level_t clev, dca_level_t slev) + { + (void)clev; + +@@ -529,7 +576,7 @@ + break; + + case CONVERT (DCA_MONO, DCA_DOLBY): +- memcpy (samples + 256, samples, 256 * sizeof (sample_t)); ++ memcpy (samples + 256, samples, 256 * sizeof (dca_sample_t)); + break; + + case CONVERT (DCA_3F, DCA_STEREO): +@@ -576,7 +623,7 @@ + break; + + case CONVERT (DCA_3F2R, DCA_DOLBY): +- mix32toS (samples, bias); ++ mix32toS (samples, bias, 0); + break; + + case CONVERT (DCA_3F1R, DCA_3F): +@@ -594,7 +641,7 @@ + + case CONVERT (DCA_3F1R, DCA_2F1R): + mix3to2 (samples, bias); +- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); ++ memcpy (samples + 512, samples + 768, 256 * sizeof (dca_sample_t)); + break; + + case CONVERT (DCA_2F2R, DCA_2F1R): +@@ -608,30 +655,52 @@ + + case CONVERT (DCA_3F2R, DCA_3F1R): + mix2to1 (samples + 768, samples + 1024, bias); ++ /* deal with the special-case 5.0 to 4.0 DPL mix */ ++ if (output & DCA_OUT_DPLI) ++ { ++ mix31toS (samples, bias); ++ } + break; + + case CONVERT (DCA_2F1R, DCA_2F2R): +- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); ++ memcpy (samples + 768, samples + 512, 256 * sizeof (dca_sample_t)); + break; + + case CONVERT (DCA_3F1R, DCA_2F2R): + mix3to2 (samples, bias); +- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); ++ memcpy (samples + 512, samples + 768, 256 * sizeof (dca_sample_t)); + break; + + case CONVERT (DCA_3F2R, DCA_2F2R): + mix3to2 (samples, bias); +- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); +- memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t)); ++ memcpy (samples + 512, samples + 768, 256 * sizeof (dca_sample_t)); ++ memcpy (samples + 768, samples + 1024, 256 * sizeof (dca_sample_t)); + break; + + case CONVERT (DCA_3F1R, DCA_3F2R): +- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); ++ memcpy (samples + 1024, samples + 768, 256 * sizeof (dca_sample_t)); ++ break; ++ ++ /* deal with the special-case DPL mixes */ ++ ++ case CONVERT (DCA_3F1R, DCA_3F1R): ++ if (output & DCA_OUT_DPLI) ++ { ++ mix31toS (samples, bias); ++ } + break; ++ ++ case CONVERT (DCA_3F2R, DCA_3F2R): ++ if (output & DCA_OUT_DPLII) ++ { ++ mix32toS (samples, bias, 1); ++ } ++ break; ++ + } + } + +-void dca_upmix (sample_t * samples, int acmod, int output) ++void dca_upmix (dca_sample_t * samples, int acmod, int output) + { + switch (CONVERT (acmod, output & DCA_CHANNEL_MASK)) { + +@@ -657,7 +726,7 @@ + case CONVERT (DCA_3F, DCA_STEREO): + case CONVERT (DCA_3F, DCA_DOLBY): + mix_3to2: +- memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t)); ++ memcpy (samples + 512, samples + 256, 256 * sizeof (dca_sample_t)); + zero (samples + 256); + break; + +@@ -684,11 +753,11 @@ + zero (samples + 1024); + case CONVERT (DCA_3F1R, DCA_2F1R): + mix_31to21: +- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); ++ memcpy (samples + 768, samples + 512, 256 * sizeof (dca_sample_t)); + goto mix_3to2; + + case CONVERT (DCA_3F2R, DCA_2F2R): +- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); ++ memcpy (samples + 1024, samples + 768, 256 * sizeof (dca_sample_t)); + goto mix_31to21; + } + } +diff -Naur libdca/libdca/parse.c libdca_patched/libdca/parse.c +--- libdca/libdca/parse.c 2007-05-02 10:05:05.000000000 +0100 ++++ libdca_patched/libdca/parse.c 2007-05-02 10:09:33.000000000 +0100 +@@ -59,12 +59,12 @@ + static int decode_blockcode (int code, int levels, int *values); + + static void qmf_32_subbands (dca_state_t * state, int chans, +- double samples_in[32][8], sample_t *samples_out, +- double rScale, sample_t bias); ++ double samples_in[32][8], dca_sample_t *samples_out, ++ double rScale, dca_sample_t bias); + + static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample, +- double *samples_in, sample_t *samples_out, +- double rScale, sample_t bias ); ++ double *samples_in, dca_sample_t *samples_out, ++ double rScale, dca_sample_t bias ); + + static void pre_calc_cosmod( dca_state_t * state ); + +@@ -80,7 +80,7 @@ + + memset (state, 0, sizeof(dca_state_t)); + +- state->samples = (sample_t *) memalign (16, 256 * 12 * sizeof (sample_t)); ++ state->samples = (dca_sample_t *) memalign (16, 256 * 12 * sizeof (dca_sample_t)); + if (state->samples == NULL) { + free (state); + return NULL; +@@ -97,7 +97,7 @@ + return state; + } + +-sample_t * dca_samples (dca_state_t * state) ++dca_sample_t * dca_samples (dca_state_t * state) + { + return state->samples; + } +@@ -207,7 +207,7 @@ + } + + int dca_frame (dca_state_t * state, uint8_t * buf, int * flags, +- level_t * level, sample_t bias) ++ dca_level_t * level, dca_sample_t bias) + { + int i, j; + static float adj_table[] = { 1.0, 1.1250, 1.2500, 1.4375 }; +@@ -996,7 +996,7 @@ + { + dca_upmix (state->samples, state->amode, state->output); + } else +- if (state->prim_channels > dca_channels[state->output & DCA_CHANNEL_MASK]) ++ if (state->prim_channels >= dca_channels[state->output & DCA_CHANNEL_MASK]) + { + dca_downmix (state->samples, state->amode, state->output, state->bias, + state->clev, state->slev); +@@ -1142,8 +1142,8 @@ + } + + static void qmf_32_subbands (dca_state_t * state, int chans, +- double samples_in[32][8], sample_t *samples_out, +- double scale, sample_t bias) ++ double samples_in[32][8], dca_sample_t *samples_out, ++ double scale, dca_sample_t bias) + { + double *prCoeff; + int i, j, k; +@@ -1224,8 +1224,8 @@ + } + + static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample, +- double *samples_in, sample_t *samples_out, +- double scale, sample_t bias) ++ double *samples_in, dca_sample_t *samples_out, ++ double scale, dca_sample_t bias) + { + /* samples_in: An array holding decimated samples. + * Samples in current subframe starts from samples_in[0], +@@ -1275,7 +1275,7 @@ + } + + void dca_dynrng (dca_state_t * state, +- level_t (* call) (level_t, void *), void * data) ++ dca_level_t (* call) (dca_level_t, void *), void * data) + { + state->dynrange = 0; + if (call) { +diff -Naur libdca/src/dcadec.c libdca_patched/src/dcadec.c +--- libdca/src/dcadec.c 2007-05-02 10:05:04.000000000 +0100 ++++ libdca_patched/src/dcadec.c 2007-05-02 10:09:35.000000000 +0100 +@@ -280,15 +280,15 @@ + } + bufpos = buf + length; + } else { +- level_t level; +- sample_t bias; ++ dca_level_t level; ++ dca_sample_t bias; + int i; + + if (output->setup (output, sample_rate, &flags, &level, &bias)) + goto error; + if (!disable_adjust) + flags |= DCA_ADJUST_LEVEL; +- level = (level_t) (level * gain); ++ level = (dca_level_t) (level * gain); + if (dca_frame (state, buf, &flags, &level, bias)) + goto error; + if (disable_dynrng) diff --git a/contrib/libdca/module.defs b/contrib/libdca/module.defs new file mode 100644 index 000000000..b69d1fb3a --- /dev/null +++ b/contrib/libdca/module.defs @@ -0,0 +1,5 @@ +$(eval $(call import.MODULE.defs,LIBDCA,libdca)) +$(eval $(call import.CONTRIB.defs,LIBDCA)) + +LIBDCA.FETCH.url = http://download.m0k.org/handbrake/contrib/libdca-r81-strapped.tar.gz +LIBDCA.EXTRACT.tarbase = libdca diff --git a/contrib/libdca/module.rules b/contrib/libdca/module.rules new file mode 100644 index 000000000..0f33e2185 --- /dev/null +++ b/contrib/libdca/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBDCA)) +$(eval $(call import.CONTRIB.rules,LIBDCA)) diff --git a/contrib/libdvdread/P00-darwin-css-vlc-dylib.patch b/contrib/libdvdread/P00-darwin-css-vlc-dylib.patch new file mode 100644 index 000000000..cb0181517 --- /dev/null +++ b/contrib/libdvdread/P00-darwin-css-vlc-dylib.patch @@ -0,0 +1,12 @@ +diff -Naur libdvdread.orig/dvdread/dvd_input.c libdvdread/dvdread/dvd_input.c +--- libdvdread.orig/dvdread/dvd_input.c 2005-09-19 09:43:08.000000000 -0400 ++++ libdvdread/dvdread/dvd_input.c 2009-02-21 10:22:42.000000000 -0500 +@@ -332,7 +332,7 @@ + + #else + +- dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY); ++ dvdcss_library = dlopen("/Applications/VLC.app/Contents/MacOS/lib/libdvdcss.2.dylib", RTLD_LAZY); + + if(dvdcss_library != NULL) { + #if defined(__OpenBSD__) && !defined(__ELF__) diff --git a/contrib/libdvdread/P01-cygwin.patch b/contrib/libdvdread/P01-cygwin.patch new file mode 100644 index 000000000..fbb1f12d3 --- /dev/null +++ b/contrib/libdvdread/P01-cygwin.patch @@ -0,0 +1,26 @@ +diff -Naur libdvdread/configure libdvdread/configure +--- libdvdread/configure 2006-10-06 04:14:24.000000000 -0400 ++++ libdvdread/configure 2008-10-04 08:51:17.153181000 -0400 +@@ -3550,9 +3550,6 @@ + _ACEOF + + ;; +- x*mingw32* | x*cygwin*) +- CFLAGS="${CFLAGS} -Dssize_t=long" +- ;; + x*) + ;; + esac +diff -Naur libdvdread/configure.in libdvdread/configure.in +--- libdvdread/configure.in 2006-10-06 04:12:31.000000000 -0400 ++++ libdvdread/configure.in 2008-10-04 08:51:26.356306000 -0400 +@@ -15,9 +15,6 @@ + CFLAGS="${CFLAGS} -no-cpp-precomp" + AC_DEFINE(__DARWIN__, 1, Have a Mac OS X system) + ;; +- x*mingw32* | x*cygwin*) +- CFLAGS="${CFLAGS} -Dssize_t=long" +- ;; + x*) + ;; + esac \ No newline at end of file diff --git a/contrib/libdvdread/module.defs b/contrib/libdvdread/module.defs new file mode 100644 index 000000000..99b70923a --- /dev/null +++ b/contrib/libdvdread/module.defs @@ -0,0 +1,5 @@ +$(eval $(call import.MODULE.defs,LIBDVDREAD,libdvdread)) +$(eval $(call import.CONTRIB.defs,LIBDVDREAD)) + +LIBDVDREAD.FETCH.url = http://download.m0k.org/handbrake/contrib/libdvdread-0.9.7.tar.gz +LIBDVDREAD.EXTRACT.tarbase = libdvdread diff --git a/contrib/libdvdread/module.rules b/contrib/libdvdread/module.rules new file mode 100644 index 000000000..6a9b42b0d --- /dev/null +++ b/contrib/libdvdread/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBDVDREAD)) +$(eval $(call import.CONTRIB.rules,LIBDVDREAD)) diff --git a/contrib/libmkv/module.defs b/contrib/libmkv/module.defs new file mode 100644 index 000000000..102aea033 --- /dev/null +++ b/contrib/libmkv/module.defs @@ -0,0 +1,5 @@ +$(eval $(call import.MODULE.defs,LIBMKV,libmkv)) +$(eval $(call import.CONTRIB.defs,LIBMKV)) + +LIBMKV.FETCH.url = http://download.m0k.org/handbrake/contrib/libmkv-0.6.3.1.tar.gz +LIBMKV.EXTRACT.tarbase = libmkv diff --git a/contrib/libmkv/module.rules b/contrib/libmkv/module.rules new file mode 100644 index 000000000..7f443fe04 --- /dev/null +++ b/contrib/libmkv/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBMKV)) +$(eval $(call import.CONTRIB.rules,LIBMKV)) diff --git a/contrib/libmp4v2/module.defs b/contrib/libmp4v2/module.defs new file mode 100644 index 000000000..5a8063f3f --- /dev/null +++ b/contrib/libmp4v2/module.defs @@ -0,0 +1,5 @@ +$(eval $(call import.MODULE.defs,LIBMP4V2,libmp4v2)) +$(eval $(call import.CONTRIB.defs,LIBMP4V2)) + +LIBMP4V2.FETCH.url = http://download.m0k.org/handbrake/contrib/libmp4v2-2.0-r224-repack.tar.gz +LIBMP4V2.EXTRACT.tarbase = libmp4v2 diff --git a/contrib/libmp4v2/module.rules b/contrib/libmp4v2/module.rules new file mode 100644 index 000000000..8169e6032 --- /dev/null +++ b/contrib/libmp4v2/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBMP4V2)) +$(eval $(call import.CONTRIB.rules,LIBMP4V2)) diff --git a/contrib/libogg/module.defs b/contrib/libogg/module.defs new file mode 100644 index 000000000..0edc4106a --- /dev/null +++ b/contrib/libogg/module.defs @@ -0,0 +1,7 @@ +$(eval $(call import.MODULE.defs,LIBOGG,libogg)) +$(eval $(call import.CONTRIB.defs,LIBOGG)) + +LIBOGG.FETCH.url = http://download.m0k.org/handbrake/contrib/libogg-1.1.3.tar.gz +LIBOGG.EXTRACT.tarbase = libogg + +LIBOGG.CONFIGURE.extra = --disable-sdl diff --git a/contrib/libogg/module.rules b/contrib/libogg/module.rules new file mode 100644 index 000000000..956fe0788 --- /dev/null +++ b/contrib/libogg/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBOGG)) +$(eval $(call import.CONTRIB.rules,LIBOGG)) diff --git a/contrib/libsamplerate/module.defs b/contrib/libsamplerate/module.defs new file mode 100644 index 000000000..c0717df37 --- /dev/null +++ b/contrib/libsamplerate/module.defs @@ -0,0 +1,5 @@ +$(eval $(call import.MODULE.defs,LIBSAMPLERATE,libsamplerate)) +$(eval $(call import.CONTRIB.defs,LIBSAMPLERATE)) + +LIBSAMPLERATE.FETCH.url = http://download.m0k.org/handbrake/contrib/libsamplerate-0.1.4.tar.gz +LIBSAMPLERATE.EXTRACT.tarbase = libsamplerate diff --git a/contrib/libsamplerate/module.rules b/contrib/libsamplerate/module.rules new file mode 100644 index 000000000..ef633856c --- /dev/null +++ b/contrib/libsamplerate/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBSAMPLERATE)) +$(eval $(call import.CONTRIB.rules,LIBSAMPLERATE)) diff --git a/contrib/libtheora/module.defs b/contrib/libtheora/module.defs new file mode 100644 index 000000000..be40ab579 --- /dev/null +++ b/contrib/libtheora/module.defs @@ -0,0 +1,13 @@ +$(eval $(call import.MODULE.defs,LIBTHEORA,libtheora,LIBOGG LIBVORBIS)) +$(eval $(call import.CONTRIB.defs,LIBTHEORA)) + +LIBTHEORA.FETCH.url = http://download.m0k.org/handbrake/contrib/libtheora-1.0.tar.gz +LIBTHEORA.EXTRACT.tarbase = libtheora + +LIBTHEORA.CONFIGURE.extra = \ + --disable-examples \ + --disable-oggtest \ + --disable-sdltest \ + --disable-vorbistest \ + --with-ogg=$(call fn.ABSOLUTE,$(CONTRIB.build/)) \ + --with-vorbis=$(call fn.ABSOLUTE,$(CONTRIB.build/)) diff --git a/contrib/libtheora/module.rules b/contrib/libtheora/module.rules new file mode 100644 index 000000000..c30224bb2 --- /dev/null +++ b/contrib/libtheora/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBTHEORA)) +$(eval $(call import.CONTRIB.rules,LIBTHEORA)) diff --git a/contrib/libvorbis/module.defs b/contrib/libvorbis/module.defs new file mode 100644 index 000000000..9946bb53c --- /dev/null +++ b/contrib/libvorbis/module.defs @@ -0,0 +1,7 @@ +$(eval $(call import.MODULE.defs,LIBVORBIS,libvorbis,LIBOGG)) +$(eval $(call import.CONTRIB.defs,LIBVORBIS)) + +LIBVORBIS.FETCH.url = http://download.m0k.org/handbrake/contrib/libvorbis-aotuv_b5.tar.gz +LIBVORBIS.EXTRACT.tarbase = libvorbis + +LIBVORBIS.CONFIGURE.extra = --with-ogg=$(call fn.ABSOLUTE,$(CONTRIB.build/)) diff --git a/contrib/libvorbis/module.rules b/contrib/libvorbis/module.rules new file mode 100644 index 000000000..418dfe0ef --- /dev/null +++ b/contrib/libvorbis/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,LIBVORBIS)) +$(eval $(call import.CONTRIB.rules,LIBVORBIS)) diff --git a/contrib/mpeg2dec/module.defs b/contrib/mpeg2dec/module.defs new file mode 100644 index 000000000..5d608cc0b --- /dev/null +++ b/contrib/mpeg2dec/module.defs @@ -0,0 +1,7 @@ +$(eval $(call import.MODULE.defs,MPEG2DEC,mpeg2dec)) +$(eval $(call import.CONTRIB.defs,MPEG2DEC)) + +MPEG2DEC.FETCH.url = http://download.m0k.org/handbrake/contrib/mpeg2dec-0.5.1.tar.gz +MPEG2DEC.EXTRACT.tarbase = mpeg2dec + +MPEG2DEC.CONFIGURE.extra = --disable-sdl --without-x diff --git a/contrib/mpeg2dec/module.rules b/contrib/mpeg2dec/module.rules new file mode 100644 index 000000000..78ce10aca --- /dev/null +++ b/contrib/mpeg2dec/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,MPEG2DEC)) +$(eval $(call import.CONTRIB.rules,MPEG2DEC)) diff --git a/contrib/patch-a52dec.patch b/contrib/patch-a52dec.patch deleted file mode 100644 index cf1c8a64a..000000000 --- a/contrib/patch-a52dec.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff -Naur a52dec_original/include/a52.h a52dec_patched/include/a52.h ---- a52dec_original/include/a52.h 2002-01-28 05:37:54.000000000 +0000 -+++ a52dec_patched/include/a52.h 2007-04-04 19:12:57.000000000 +0100 -@@ -48,6 +48,10 @@ - #define A52_LFE 16 - #define A52_ADJUST_LEVEL 32 - -+// this next constant can be ORed with A52_DOLBY to tell liba52 to use 5.0 DPLII matrix encoding, -+// rather than just 4.0 Dolby Surround matrix encoding -+#define A52_USE_DPLII 64 -+ - a52_state_t * a52_init (uint32_t mm_accel); - sample_t * a52_samples (a52_state_t * state); - int a52_syncinfo (uint8_t * buf, int * flags, -diff -Naur a52dec_original/liba52/a52_internal.h a52dec_patched/liba52/a52_internal.h ---- a52dec_original/liba52/a52_internal.h 2002-07-28 02:52:06.000000000 +0100 -+++ a52dec_patched/liba52/a52_internal.h 2007-04-04 19:11:43.000000000 +0100 -@@ -93,6 +93,10 @@ - #define LEVEL_45DB 0.5946035575013605 - #define LEVEL_6DB 0.5 - -+// these next two constants are used for DPL matrix encoding in downmix.c -+#define LEVEL_SQRT_1_2 0.5 -+#define LEVEL_SQRT_3_4 0.8660254037844386 -+ - #define EXP_REUSE (0) - #define EXP_D15 (1) - #define EXP_D25 (2) -diff -Naur a52dec_original/liba52/downmix.c a52dec_patched/liba52/downmix.c ---- a52dec_original/liba52/downmix.c 2002-01-28 05:37:54.000000000 +0000 -+++ a52dec_patched/liba52/downmix.c 2007-04-06 13:47:49.000000000 +0100 -@@ -34,6 +34,7 @@ - int a52_downmix_init (int input, int flags, sample_t * level, - sample_t clev, sample_t slev) - { -+ - static uint8_t table[11][8] = { - {A52_CHANNEL, A52_DOLBY, A52_STEREO, A52_STEREO, - A52_STEREO, A52_STEREO, A52_STEREO, A52_STEREO}, -@@ -148,6 +149,9 @@ - break; - } - -+ // add the DPLII flag back into the output if it was passed in -+ output = output | (flags & A52_USE_DPLII); -+ - return output; - } - -@@ -418,17 +422,46 @@ - } - } - --static void mix32toS (sample_t * samples, sample_t bias) -+static void mix32toS (sample_t * samples, sample_t bias, int use_dpl2) - { -- int i; -- sample_t common, surround; - -- for (i = 0; i < 256; i++) { -- common = samples[i + 256] + bias; -- surround = samples[i + 768] + samples[i + 1024]; -- samples[i] += common - surround; -- samples[i + 256] = samples[i + 512] + common + surround; -- } -+ if (use_dpl2 == 1) { -+ -+ int i; -+ sample_t cc, Lt, Rt, Ls, Rs, Lss, Rss; -+ -+ for (i = 0; i < 256; i++) { -+ -+ cc = samples[i + 256] * LEVEL_3DB; -+ -+ Lt = samples[i] + cc; -+ Rt = samples[i + 512] + cc; -+ -+ Ls = samples[i + 768]; -+ Rs = samples[i + 1024]; -+ -+ Lss = (LEVEL_SQRT_3_4 * Ls) - (LEVEL_SQRT_1_2 * Rs); -+ Rss = -(LEVEL_SQRT_1_2 * Ls) + (LEVEL_SQRT_3_4 * Rs); -+ -+ samples[i] = bias + Lt + Lss; -+ samples[i + 256] = bias + Rt + Rss; -+ -+ } -+ -+ } else { -+ -+ int i; -+ sample_t common, surround; -+ -+ for (i = 0; i < 256; i++) { -+ common = samples[i + 256] + bias; -+ surround = samples[i + 768] + samples[i + 1024]; -+ samples[i] += common - surround; -+ samples[i + 256] = samples[i + 512] + common + surround; -+ } -+ -+ } -+ - } - - static void move2to1 (sample_t * src, sample_t * dest, sample_t bias) -@@ -533,7 +566,7 @@ - break; - - case CONVERT (A52_3F2R, A52_DOLBY): -- mix32toS (samples, bias); -+ mix32toS (samples, bias, ((output & A52_USE_DPLII) == A52_USE_DPLII)); - break; - - case CONVERT (A52_3F1R, A52_3F): diff --git a/contrib/patch-faac-cygwin.patch b/contrib/patch-faac-cygwin.patch deleted file mode 100644 index d54b08d02..000000000 --- a/contrib/patch-faac-cygwin.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur faac2/include/faac.h faac3/include/faac.h ---- faac/include/faac.h 2004-07-04 13:12:06.000000000 +0100 -+++ faac/include/faac.h 2008-08-17 19:56:29.734375000 +0100 -@@ -50,7 +50,7 @@ - typedef void *faacEncHandle; - - #ifndef HAVE_INT32_T --typedef int int32_t; -+//typedef int int32_t; - #endif - - /* diff --git a/contrib/patch-faad2-libtool22.patch b/contrib/patch-faad2-libtool22.patch deleted file mode 100644 index 4eab08487..000000000 --- a/contrib/patch-faad2-libtool22.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: faad2/configure.in -=================================================================== ---- faad2.orig/configure.in -+++ faad2/configure.in -@@ -18,7 +18,7 @@ dnl Checks for programs. - AC_PROG_CC - AC_PROG_CPP - dnl disable for mpeg4ip plugin --dnl AC_PROG_CXX -+AC_PROG_CXX - AC_PROG_INSTALL - AC_PROG_LN_S - AC_PROG_MAKE_SET diff --git a/contrib/patch-ffmpeg-cygwin.patch b/contrib/patch-ffmpeg-cygwin.patch deleted file mode 100644 index b6ca99f26..000000000 --- a/contrib/patch-ffmpeg-cygwin.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -Naur ffmpeg/libavcodec/mpegaudiodec.c ffmpeg-patched/libavcodec/mpegaudiodec.c ---- ffmpeg/libavcodec/mpegaudiodec.c 2006-09-23 14:22:06.000000000 -0400 -+++ ffmpeg-patched/libavcodec/mpegaudiodec.c 2007-01-01 18:31:51.156250000 -0500 -@@ -401,9 +401,9 @@ - for(i=0; i<512*16; i++){ - int exponent= (i>>4); - double f= pow(i&15, 4.0 / 3.0) * pow(2, (exponent-400)*0.25 + FRAC_BITS + 5); -- expval_table[exponent][i&15]= llrint(f); -+ expval_table[exponent][i&15]= lrint(f); - if((i&15)==1) -- exp_table[exponent]= llrint(f); -+ exp_table[exponent]= lrint(f); - } - - for(i=0;i<7;i++) { diff --git a/contrib/patch-ffmpeg-h264dsp-crash.diff b/contrib/patch-ffmpeg-h264dsp-crash.diff deleted file mode 100644 index 53b5cf09d..000000000 --- a/contrib/patch-ffmpeg-h264dsp-crash.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: ffmpeg/libavcodec/i386/dsputil_mmx.c -=================================================================== ---- ffmpeg/libavcodec/i386/dsputil_mmx.c (revision 14508) -+++ ffmpeg/libavcodec/i386/dsputil_mmx.c (working copy) -@@ -2626,6 +2626,8 @@ - H264_QPEL_FUNCS(3, 2, sse2); - H264_QPEL_FUNCS(3, 3, sse2); - } -+#undef H264_QPEL_FUNCS -+#define H264_QPEL_FUNCS(x, y, CPU) - #ifdef HAVE_SSSE3 - if(mm_flags & MM_SSSE3){ - H264_QPEL_FUNCS(1, 0, ssse3); diff --git a/contrib/patch-ffmpeg-latm.patch b/contrib/patch-ffmpeg-latm.patch deleted file mode 100644 index 84cd6a85f..000000000 --- a/contrib/patch-ffmpeg-latm.patch +++ /dev/null @@ -1,893 +0,0 @@ -Index: libavcodec/Makefile -=================================================================== ---- libavcodec/Makefile (revision 14016) -+++ libavcodec/Makefile (working copy) -@@ -322,7 +322,7 @@ - OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o - OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o - OBJS-$(CONFIG_LIBFAAC) += libfaac.o --OBJS-$(CONFIG_LIBFAAD) += libfaad.o -+OBJS-$(CONFIG_LIBFAAD) += libfaad.o latmaac.o - OBJS-$(CONFIG_LIBGSM) += libgsm.o - OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o - OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o -@@ -350,7 +350,7 @@ - OBJS-$(CONFIG_LIBXVID) += libxvidff.o libxvid_rc.o - - # parsers --OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o -+OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o latm_parser.o - OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o - OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o - OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o -Index: libavcodec/latmaac.c -=================================================================== ---- libavcodec/latmaac.c (revision 0) -+++ libavcodec/latmaac.c (revision 0) -@@ -0,0 +1,624 @@ -+/* -+ * copyright (c) 2008 Paul Kendall -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file latmaac.c -+ * LATM wrapped AAC decoder -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "parser.h" -+#include "bitstream.h" -+#include "mpeg4audio.h" -+#include "neaacdec.h" -+ -+#define min(a,b) ((a)<(b) ? (a) : (b)) -+ -+ -+/* -+ Note: This decoder filter is intended to decode LATM streams transferred -+ in MPEG transport streams which are only supposed to contain one program. -+ To do a more complex LATM demuxing a separate LATM demuxer should be used. -+*/ -+ -+#define AAC_NONE 0 // mode not detected (or indicated in mediatype) -+#define AAC_LATM 1 // LATM packets (ISO/IEC 14496-3 1.7.3 Multiplex layer) -+ -+#define SYNC_LATM 0x2b7 // 11 bits -+ -+#define MAX_SIZE 8*1024 -+ -+typedef struct AACConfig -+{ -+ uint8_t extra[64]; // should be way enough -+ int extrasize; -+ -+ int audioObjectType; -+ int samplingFrequencyIndex; -+ int samplingFrequency; -+ int channelConfiguration; -+ int channels; -+} AACConfig; -+ -+typedef struct AACParser -+{ -+ AACConfig config; -+ uint8_t frameLengthType; -+ uint16_t muxSlotLengthBytes; -+ -+ uint8_t audio_mux_version; -+ uint8_t audio_mux_version_A; -+ int taraFullness; -+ uint8_t config_crc; -+ int64_t other_data_bits; -+ -+ int mode; -+ int offset; // byte offset in "buf" buffer -+ uint8_t buf[MAX_SIZE]; // allocated buffer -+ int count; // number of bytes written in buffer -+} AACParser; -+ -+typedef struct AACDecoder -+{ -+ AACParser *parser; -+ faacDecHandle aac_decoder; -+ int open; -+ uint32_t in_samplerate; -+ uint8_t in_channels; -+} AACDecoder; -+ -+typedef struct { -+ AACDecoder* decoder; -+} FAACContext; -+ -+static inline int64_t latm_get_value(GetBitContext *b) -+{ -+ uint8_t bytesForValue = get_bits(b, 2); -+ int64_t value = 0; -+ int i; -+ for (i=0; i<=bytesForValue; i++) { -+ value <<= 8; -+ value |= get_bits(b, 8); -+ } -+ return value; -+} -+ -+static void readGASpecificConfig(struct AACConfig *cfg, GetBitContext *b, PutBitContext *o) -+{ -+ int framelen_flag = get_bits(b, 1); -+ put_bits(o, 1, framelen_flag); -+ int dependsOnCoder = get_bits(b, 1); -+ put_bits(o, 1, dependsOnCoder); -+ int ext_flag; -+ int delay; -+ int layerNr; -+ -+ if (dependsOnCoder) { -+ delay = get_bits(b, 14); -+ put_bits(o, 14, delay); -+ } -+ ext_flag = get_bits(b, 1); -+ put_bits(o, 1, ext_flag); -+ if (!cfg->channelConfiguration) { -+ // program config element -+ // TODO: -+ } -+ -+ if (cfg->audioObjectType == 6 || cfg->audioObjectType == 20) { -+ layerNr = get_bits(b, 3); -+ put_bits(o, 3, layerNr); -+ } -+ if (ext_flag) { -+ if (cfg->audioObjectType == 22) { -+ skip_bits(b, 5); // numOfSubFrame -+ skip_bits(b, 11); // layer_length -+ -+ put_bits(o, 16, 0); -+ } -+ if (cfg->audioObjectType == 17 || -+ cfg->audioObjectType == 19 || -+ cfg->audioObjectType == 20 || -+ cfg->audioObjectType == 23) { -+ -+ skip_bits(b, 3); // stuff -+ put_bits(o, 3, 0); -+ } -+ -+ skip_bits(b, 1); // extflag3 -+ put_bits(o, 1, 0); -+ } -+} -+ -+static int readAudioSpecificConfig(struct AACConfig *cfg, GetBitContext *b) -+{ -+ PutBitContext o; -+ init_put_bits(&o, cfg->extra, sizeof(cfg->extra)); -+ -+ // returns the number of bits read -+ int ret = 0; -+ int sbr_present = -1; -+ -+ // object -+ cfg->audioObjectType = get_bits(b, 5); -+ put_bits(&o, 5, cfg->audioObjectType); -+ if (cfg->audioObjectType == 31) { -+ uint8_t n = get_bits(b, 6); -+ put_bits(&o, 6, n); -+ cfg->audioObjectType = 32 + n; -+ } -+ -+ cfg->samplingFrequencyIndex = get_bits(b, 4); -+ cfg->samplingFrequency = ff_mpeg4audio_sample_rates[cfg->samplingFrequencyIndex]; -+ put_bits(&o, 4, cfg->samplingFrequencyIndex); -+ if (cfg->samplingFrequencyIndex == 0x0f) { -+ uint32_t f = get_bits_long(b, 24); -+ put_bits(&o, 24, f); -+ cfg->samplingFrequency = f; -+ } -+ cfg->channelConfiguration = get_bits(b, 4); -+ put_bits(&o, 4, cfg->channelConfiguration); -+ cfg->channels = ff_mpeg4audio_channels[cfg->channelConfiguration]; -+ -+ if (cfg->audioObjectType == 5) { -+ sbr_present = 1; -+ -+ // TODO: parsing !!!!!!!!!!!!!!!! -+ } -+ -+ switch (cfg->audioObjectType) { -+ case 1: -+ case 2: -+ case 3: -+ case 4: -+ case 6: -+ case 7: -+ case 17: -+ case 19: -+ case 20: -+ case 21: -+ case 22: -+ case 23: -+ readGASpecificConfig(cfg, b, &o); -+ break; -+ } -+ -+ if (sbr_present == -1) { -+ if (cfg->samplingFrequency <= 24000) { -+ cfg->samplingFrequency *= 2; -+ } -+ } -+ -+ // count the extradata -+ ret = put_bits_count(&o); -+ align_put_bits(&o); -+ flush_put_bits(&o); -+ cfg->extrasize = (ret + 7) >> 3; -+ return ret; -+} -+ -+static void readStreamMuxConfig(struct AACParser *parser, GetBitContext *b) -+{ -+ parser->audio_mux_version_A = 0; -+ parser->audio_mux_version = get_bits(b, 1); -+ if (parser->audio_mux_version == 1) { // audioMuxVersion -+ parser->audio_mux_version_A = get_bits(b, 1); -+ } -+ -+ if (parser->audio_mux_version_A == 0) { -+ if (parser->audio_mux_version == 1) { -+ parser->taraFullness = latm_get_value(b); -+ } -+ get_bits(b, 1); // allStreamSameTimeFraming = 1 -+ get_bits(b, 6); // numSubFrames = 0 -+ get_bits(b, 4); // numPrograms = 0 -+ -+ // for each program -+ get_bits(b, 3); // numLayer = 0 -+ -+ // for each layer -+ if (parser->audio_mux_version == 0) { -+ // audio specific config. -+ readAudioSpecificConfig(&parser->config, b); -+ } else { -+ int ascLen = latm_get_value(b); -+ ascLen -= readAudioSpecificConfig(&parser->config, b); -+ -+ // fill bits -+ while (ascLen > 16) { -+ skip_bits(b, 16); -+ ascLen -= 16; -+ } -+ skip_bits(b, ascLen); -+ } -+ -+ // these are not needed... perhaps -+ int frame_length_type = get_bits(b, 3); -+ parser->frameLengthType = frame_length_type; -+ if (frame_length_type == 0) { -+ get_bits(b, 8); -+ } else if (frame_length_type == 1) { -+ get_bits(b, 9); -+ } else if (frame_length_type == 3 || -+ frame_length_type == 4 || -+ frame_length_type == 5) { -+ int celp_table_index = get_bits(b, 6); -+ } else if (frame_length_type == 6 || -+ frame_length_type == 7) { -+ int hvxc_table_index = get_bits(b, 1); -+ } -+ -+ // other data -+ parser->other_data_bits = 0; -+ if (get_bits(b, 1)) { -+ // other data present -+ if (parser->audio_mux_version == 1) { -+ parser->other_data_bits = latm_get_value(b); -+ } else { -+ // other data not present -+ parser->other_data_bits = 0; -+ int esc, tmp; -+ do { -+ parser->other_data_bits <<= 8; -+ esc = get_bits(b, 1); -+ tmp = get_bits(b, 8); -+ parser->other_data_bits |= tmp; -+ } while (esc); -+ } -+ } -+ -+ // CRC -+ if (get_bits(b, 1)) { -+ parser->config_crc = get_bits(b, 8); -+ } -+ } else { -+ // tbd -+ } -+} -+ -+static void readPayloadLengthInfo(struct AACParser *parser, GetBitContext *b) -+{ -+ uint8_t tmp; -+ if (parser->frameLengthType == 0) { -+ parser->muxSlotLengthBytes = 0; -+ do { -+ tmp = get_bits(b, 8); -+ parser->muxSlotLengthBytes += tmp; -+ } while (tmp == 255); -+ } else { -+ if (parser->frameLengthType == 5 || -+ parser->frameLengthType == 7 || -+ parser->frameLengthType == 3) { -+ get_bits(b, 2); -+ } -+ } -+} -+ -+static void readAudioMuxElement(struct AACParser *parser, GetBitContext *b, uint8_t *payload, int *payloadsize) -+{ -+ uint8_t use_same_mux = get_bits(b, 1); -+ if (!use_same_mux) { -+ readStreamMuxConfig(parser, b); -+ } -+ -+ if (parser->audio_mux_version_A == 0) { -+ int j; -+ -+ readPayloadLengthInfo(parser, b); -+ -+ // copy data -+ for (j=0; jmuxSlotLengthBytes; j++) { -+ *payload++ = get_bits(b, 8); -+ } -+ *payloadsize = parser->muxSlotLengthBytes; -+ -+ // ignore otherdata -+ } else { -+ // TBD -+ } -+} -+ -+static int readAudioSyncStream(struct AACParser *parser, GetBitContext *b, int size, uint8_t *payload, int *payloadsize) -+{ -+ // ISO/IEC 14496-3 Table 1.28 - Syntax of AudioMuxElement() -+ if (get_bits(b, 11) != 0x2b7) return -1; // not LATM -+ int muxlength = get_bits(b, 13); -+ -+ if (3+muxlength > size) return 0; // not enough data -+ -+ readAudioMuxElement(parser, b, payload, payloadsize); -+ -+ // we don't parse anything else here... -+ return (3+muxlength); -+} -+ -+ -+static void flush_buf(struct AACParser *parser, int offset) { -+ int bytes_to_flush = min(parser->count, offset); -+ int left = (parser->count - bytes_to_flush); -+ -+ if (bytes_to_flush > 0) { -+ if (left > 0) { -+ memcpy(parser->buf, parser->buf+bytes_to_flush, left); -+ parser->count = left; -+ } else { -+ parser->count = 0; -+ } -+ } -+} -+ -+static struct AACParser *latm_create_parser() -+{ -+ struct AACParser *parser = (struct AACParser *)av_malloc(sizeof(struct AACParser)); -+ memset(parser, 0, sizeof(struct AACParser)); -+ return parser; -+} -+ -+static void latm_destroy_parser(struct AACParser *parser) -+{ -+ av_free(parser); -+} -+ -+static void latm_flush(struct AACParser *parser) -+{ -+ parser->offset = 0; -+ parser->count = 0; -+} -+ -+static void latm_write_data(struct AACParser *parser, uint8_t *data, int len) -+{ -+ // buffer overflow check... just ignore the data before -+ if (parser->count + len > MAX_SIZE) { -+ flush_buf(parser, parser->offset); -+ parser->offset = 0; -+ if (parser->count + len > MAX_SIZE) { -+ int to_flush = (parser->count+len) - MAX_SIZE; -+ flush_buf(parser, to_flush); -+ } -+ } -+ -+ // append data -+ memcpy(parser->buf+parser->count, data, len); -+ parser->count += len; -+} -+ -+static int latm_parse_packet(struct AACParser *parser, uint8_t *data, int maxsize) -+{ -+ /* -+ Return value is either number of bytes parsed or -+ -1 when failed. -+ 0 = need more data. -+ */ -+ -+ uint8_t *start = parser->buf + parser->offset; -+ int bytes = parser->count - parser->offset; -+ GetBitContext b; -+ init_get_bits(&b, start, bytes); -+ -+ if (parser->mode == AAC_LATM) { -+ int outsize = 0; -+ int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize); -+ -+ if (ret < 0) return -1; -+ if (ret == 0) return 0; -+ -+ // update the offset -+ parser->offset += ret; -+ return outsize; -+ } -+ -+ // check for syncwords -+ while (bytes > 2) { -+ if (show_bits(&b, 11) == SYNC_LATM) { -+ // we must parse config first... -+ int outsize = 0; -+ -+ // check if there is a complete packet available... -+ int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize); -+ if (ret < 0) return -1; -+ if (ret == 0) return 0; -+ parser->offset += ret; -+ -+ parser->mode = AAC_LATM; -+ return outsize; -+ } -+ skip_bits(&b, 8); -+ parser->offset++; -+ bytes--; -+ } -+ return 0; -+} -+ -+static void aac_filter_close(AACDecoder *decoder) -+{ -+ if (decoder->aac_decoder) { -+ NeAACDecClose(decoder->aac_decoder); -+ decoder->aac_decoder = NULL; -+ } -+ decoder->open = 0; -+} -+ -+static int aac_decoder_open(AACDecoder *decoder) -+{ -+ if (decoder->aac_decoder) return 0; -+ -+ decoder->aac_decoder = NeAACDecOpen(); -+ if (!decoder->aac_decoder) return -1; -+ -+ // are we going to initialize from decoder specific info ? -+ if (decoder->parser->config.extrasize > 0) { -+ char ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &decoder->in_samplerate, &decoder->in_channels); -+ if (ret < 0) { -+ aac_filter_close(decoder); // gone wrong ? -+ return -1; -+ } -+ decoder->open = 1; -+ } else { -+ // we'll open the decoder later... -+ decoder->open = 0; -+ } -+ return 0; -+} -+ -+AACDecoder *aac_filter_create() -+{ -+ AACDecoder *decoder = (AACDecoder *)av_malloc(sizeof(AACDecoder)); -+ decoder->parser = latm_create_parser(); -+ decoder->aac_decoder = NULL; -+ decoder->open = 0; -+ return (void *)decoder; -+} -+ -+void aac_filter_destroy(AACDecoder *decoder) -+{ -+ aac_filter_close(decoder); -+ latm_destroy_parser(decoder->parser); -+ av_free(decoder); -+} -+ -+int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size) -+{ -+ uint8_t tempbuf[32*1024]; -+ int ret; -+ int consumed = size; -+ int decoded; -+ int max_size = *out_size; -+ -+ *out_size = 0; -+ -+ //------------------------------------------------------------------------- -+ // Multiplex Parsing -+ //------------------------------------------------------------------------- -+ -+ latm_write_data(decoder->parser, data, size); -+ -+ do { -+ ret = latm_parse_packet(decoder->parser, tempbuf, sizeof(tempbuf)); -+ if (ret < 0) { -+ latm_flush(decoder->parser); -+ return consumed; -+ } -+ if (ret == 0) return consumed; -+ -+ data = tempbuf; -+ size = ret; -+ -+ //------------------------------------------------------------------------- -+ // Initialize decoder (if necessary) -+ //------------------------------------------------------------------------- -+ if (!decoder->open) { -+ aac_filter_close(decoder); -+ if (decoder->parser->mode == AAC_LATM) { -+ ret = aac_decoder_open(decoder); -+ if (ret < 0) return consumed; -+ } -+ -+ if(!decoder->open) return consumed; -+ } -+ -+ //------------------------------------------------------------------------- -+ // Decode samples -+ //------------------------------------------------------------------------- -+ NeAACDecFrameInfo info; -+ void *buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size); -+ -+ if (buf) { -+ decoder->in_samplerate = info.samplerate; -+ decoder->in_channels = info.channels; -+ -+ //--------------------------------------------------------------------- -+ // Deliver decoded samples -+ //--------------------------------------------------------------------- -+ -+ // kram dekoduje 16-bit. my vypustame 16-bit. takze by to malo byt okej -+ decoded = info.samples * sizeof(short); -+ -+ // napraskame tam sample -+ *out_size += decoded; -+ if(*out_size > max_size) { -+ av_log(NULL, AV_LOG_ERROR, "overflow!\n"); -+ } else { -+ memcpy(out, buf, decoded); -+ out = (unsigned char *)out + decoded; -+ } -+ } else { -+ // need more data -+ break; -+ } -+ -+ } while (1); // decode all packets -+ return consumed; -+} -+ -+void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels) -+{ -+ if(!decoder->open) return; -+ *sample_rate = decoder->in_samplerate; -+ *channels = decoder->in_channels; -+} -+ -+static int faac_decode_init(AVCodecContext *avctx) -+{ -+ FAACContext *s = avctx->priv_data; -+ avctx->frame_size = 360; -+ avctx->sample_rate = 48000; -+ avctx->channels = 2; -+ avctx->bit_rate = 8192 * 8 * avctx->sample_rate / avctx->frame_size; -+ s->decoder = aac_filter_create(); -+ return 0; -+} -+ -+static int faac_decode_frame(AVCodecContext *avctx, -+ void *data, int *data_size, -+ uint8_t *buf, int buf_size) -+{ -+ FAACContext *s = avctx->priv_data; -+ int ret; -+ -+ if (s->decoder == NULL) faac_decode_init(avctx); -+ ret = aac_filter_receive(s->decoder, data, data_size, buf, buf_size); -+ aac_filter_getinfo(s->decoder, &(avctx->sample_rate), &(avctx->channels)); -+ return ret; -+} -+ -+static int faac_decode_end(AVCodecContext *avctx) -+{ -+ FAACContext *s = avctx->priv_data; -+ if(s->decoder != NULL) { -+ aac_filter_destroy(s->decoder); -+ } -+ return 0; -+} -+ -+AVCodec libfaad2_decoder = { -+ .name = "AAC_LATM", -+ .type = CODEC_TYPE_AUDIO, -+ .id = CODEC_ID_AAC_LATM, -+ .priv_data_size = sizeof (FAACContext), -+ .init = faac_decode_init, -+ .close = faac_decode_end, -+ .decode = faac_decode_frame, -+ .long_name = "AAC over LATM", -+}; -+ -Index: libavcodec/latm_parser.c -=================================================================== ---- libavcodec/latm_parser.c (revision 0) -+++ libavcodec/latm_parser.c (revision 0) -@@ -0,0 +1,128 @@ -+/* -+ * LATM parser -+ * Copyright (c) 2008 Paul Kendall -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file latm_parser.c -+ * LATM parser -+ */ -+ -+#include "parser.h" -+ -+#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits) -+#define LATM_MASK 0xFFE000 // top 11 bits -+#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits -+ -+typedef struct LATMParseContext{ -+ ParseContext pc; -+ int count; -+} LATMParseContext; -+ -+/** -+ * finds the end of the current frame in the bitstream. -+ * @return the position of the first byte of the next frame, or -1 -+ */ -+static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf, -+ int buf_size) { -+ LATMParseContext *s = s1->priv_data; -+ ParseContext *pc = &s->pc; -+ int pic_found, i; -+ uint32_t state; -+ -+ pic_found = pc->frame_start_found; -+ state = pc->state; -+ -+ i = 0; -+ if(!pic_found){ -+ for(i=0; icount = - i; -+ pic_found=1; -+ break; -+ } -+ } -+ } -+ -+ if(pic_found){ -+ /* EOF considered as end of frame */ -+ if (buf_size == 0) -+ return 0; -+ if((state & LATM_SIZE_MASK) - s->count <= buf_size) { -+ pc->frame_start_found = 0; -+ pc->state = -1; -+ return (state & LATM_SIZE_MASK) - s->count; -+ } -+ } -+ -+ s->count += buf_size; -+ pc->frame_start_found = pic_found; -+ pc->state = state; -+ return END_NOT_FOUND; -+} -+ -+static int latm_parse(AVCodecParserContext *s1, -+ AVCodecContext *avctx, -+ const uint8_t **poutbuf, int *poutbuf_size, -+ const uint8_t *buf, int buf_size) -+{ -+ LATMParseContext *s = s1->priv_data; -+ ParseContext *pc = &s->pc; -+ int next; -+ -+ if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){ -+ next = buf_size; -+ }else{ -+ next = latm_find_frame_end(s1, buf, buf_size); -+ -+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { -+ *poutbuf = NULL; -+ *poutbuf_size = 0; -+ return buf_size; -+ } -+ } -+ *poutbuf = buf; -+ *poutbuf_size = buf_size; -+ return next; -+} -+ -+static int latm_split(AVCodecContext *avctx, -+ const uint8_t *buf, int buf_size) -+{ -+ int i; -+ uint32_t state= -1; -+ -+ for(i=0; iheader[3] | 0x100; - if (!((code >= 0x1c0 && code <= 0x1df) || - (code >= 0x1e0 && code <= 0x1ef) || -- (code == 0x1bd) || (code == 0x1fd))) -+ (code == 0x1bd) || (code == 0x1fa) || (code == 0x1fd))) - goto skip; - if (!pes->st) { - /* allocate stream */ -@@ -948,6 +949,10 @@ - codec_type = CODEC_TYPE_AUDIO; - codec_id = CODEC_ID_AAC; - break; -+ case STREAM_TYPE_AUDIO_AAC_LATM: -+ codec_type = CODEC_TYPE_AUDIO; -+ codec_id = CODEC_ID_AAC_LATM; -+ break; - case STREAM_TYPE_AUDIO_AC3: - codec_type = CODEC_TYPE_AUDIO; - codec_id = CODEC_ID_AC3; -Index: libavformat/mpegts.h -=================================================================== ---- libavformat/mpegts.h (revision 14016) -+++ libavformat/mpegts.h (working copy) -@@ -50,6 +50,7 @@ - #define STREAM_TYPE_PRIVATE_DATA 0x06 - #define STREAM_TYPE_AUDIO_AAC 0x0f - #define STREAM_TYPE_VIDEO_MPEG4 0x10 -+#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 - #define STREAM_TYPE_VIDEO_H264 0x1b - #define STREAM_TYPE_VIDEO_VC1 0xea - -Index: libavformat/mpeg.c -=================================================================== ---- libavformat/mpeg.c (revision 14016) -+++ libavformat/mpeg.c (working copy) -@@ -281,7 +281,7 @@ - /* find matching stream */ - if (!((startcode >= 0x1c0 && startcode <= 0x1df) || - (startcode >= 0x1e0 && startcode <= 0x1ef) || -- (startcode == 0x1bd) || (startcode == 0x1fd))) -+ (startcode == 0x1bd) || (startcode == 0x1fa) || (startcode == 0x1fd))) - goto redo; - if (ppos) { - *ppos = url_ftell(s->pb) - 4; -@@ -439,6 +439,9 @@ - } else if(es_type == STREAM_TYPE_AUDIO_AAC){ - codec_id = CODEC_ID_AAC; - type = CODEC_TYPE_AUDIO; -+ } else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){ -+ codec_id = CODEC_ID_AAC_LATM; -+ type = CODEC_TYPE_AUDIO; - } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){ - codec_id = CODEC_ID_MPEG4; - type = CODEC_TYPE_VIDEO; -Index: libavformat/mpeg.h -=================================================================== ---- libavformat/mpeg.h (revision 14016) -+++ libavformat/mpeg.h (working copy) -@@ -53,6 +53,7 @@ - #define STREAM_TYPE_PRIVATE_DATA 0x06 - #define STREAM_TYPE_AUDIO_AAC 0x0f - #define STREAM_TYPE_VIDEO_MPEG4 0x10 -+#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 - #define STREAM_TYPE_VIDEO_H264 0x1b - - #define STREAM_TYPE_AUDIO_AC3 0x81 diff --git a/contrib/patch-ffmpeg-mpegleak.patch b/contrib/patch-ffmpeg-mpegleak.patch deleted file mode 100644 index 74907258b..000000000 --- a/contrib/patch-ffmpeg-mpegleak.patch +++ /dev/null @@ -1,58 +0,0 @@ -Index: libavcodec/h264.c -=================================================================== ---- libavcodec/h264.c (revision 14820) -+++ libavcodec/h264.c (working copy) -@@ -3355,7 +3355,7 @@ - * stream. Need to discard one frame. Prevents overrun of the - * short_ref and long_ref buffers. - */ -- av_log(h->s.avctx, AV_LOG_ERROR, -+ av_log(h->s.avctx, AV_LOG_DEBUG, - "number of reference frames exceeds max (probably " - "corrupt input), discarding one\n"); - -@@ -7557,7 +7557,7 @@ - - if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){ - if (avctx->skip_frame >= AVDISCARD_NONREF || s->hurry_up) return 0; -- av_log(avctx, AV_LOG_ERROR, "no frame!\n"); -+ av_log(avctx, AV_LOG_DEBUG, "no frame!\n"); - return -1; - } - -Index: libavcodec/mpegvideo.c -=================================================================== ---- libavcodec/mpegvideo.c (revision 14820) -+++ libavcodec/mpegvideo.c (working copy) -@@ -779,19 +779,18 @@ - } - - av_log(s->avctx, AV_LOG_FATAL, "Internal error, picture buffer overflow\n"); -- /* We could return -1, but the codec would crash trying to draw into a -- * non-existing frame anyway. This is safer than waiting for a random crash. -- * Also the return of this is never useful, an encoder must only allocate -- * as much as allowed in the specification. This has no relationship to how -- * much libavcodec could allocate (and MAX_PICTURE_COUNT is always large -- * enough for such valid streams). -- * Plus, a decoder has to check stream validity and remove frames if too -- * many reference frames are around. Waiting for "OOM" is not correct at -- * all. Similarly, missing reference frames have to be replaced by -- * interpolated/MC frames, anything else is a bug in the codec ... -- */ -- abort(); -- return -1; -+ /* XXX there seems to be a leak caused by h264 in mpeg transport -+ * streams: Over-the-air streams have a lot of errors. A picture -+ * may be marked as referenced but the actual references get lost -+ * so it never gets released. We take care of that here by releasing -+ * the oldest we have & reusing its slot. */ -+ int oldest=0; -+ for(i=0; ipicture[i].coded_picture_number < s->picture[oldest].coded_picture_number) -+ oldest = i; -+ } -+ s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[oldest]); -+ return oldest; - } - - static void update_noise_reduction(MpegEncContext *s){ diff --git a/contrib/patch-ffmpeg-solaris.patch b/contrib/patch-ffmpeg-solaris.patch deleted file mode 100644 index f5cd7d726..000000000 --- a/contrib/patch-ffmpeg-solaris.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- ffmpeg/configure Sat Jun 7 03:19:09 2008 -+++ ffmpeg.solaris/configure Thu Jun 19 12:10:48 2008 -@@ -50,6 +50,9 @@ - exit 1 - fi - -+# Solaris must use the xpg4 version of grep -+PATH=/usr/xpg4/bin:$PATH -+ - show_help(){ - echo "Usage: configure [options]" - echo "Options: [defaults in brackets after descriptions]" -@@ -1585,8 +1588,11 @@ - check_cc <fd = fd; - return 0; diff --git a/contrib/patch-libdca.patch b/contrib/patch-libdca.patch deleted file mode 100644 index cab8db266..000000000 --- a/contrib/patch-libdca.patch +++ /dev/null @@ -1,834 +0,0 @@ -diff -Naur libdca/include/audio_out.h libdca_patched/include/audio_out.h ---- libdca/include/audio_out.h 2007-05-02 10:05:03.000000000 +0100 -+++ libdca_patched/include/audio_out.h 2007-05-02 10:09:42.000000000 +0100 -@@ -26,8 +26,8 @@ - - struct ao_instance_s { - int (* setup) (ao_instance_t * instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias); -- int (* play) (ao_instance_t * instance, int flags, sample_t * samples); -+ dca_level_t * level, dca_sample_t * bias); -+ int (* play) (ao_instance_t * instance, int flags, dca_sample_t * samples); - void (* close) (ao_instance_t * instance); - }; - -diff -Naur libdca/include/dca.h libdca_patched/include/dca.h ---- libdca/include/dca.h 2007-05-02 10:05:03.000000000 +0100 -+++ libdca_patched/include/dca.h 2007-05-02 10:09:36.000000000 +0100 -@@ -32,14 +32,14 @@ - uint32_t mm_accel (void); - - #if defined(LIBDCA_FIXED) --typedef int32_t sample_t; --typedef int32_t level_t; -+typedef int32_t dca_sample_t; -+typedef int32_t dca_level_t; - #elif defined(LIBDCA_DOUBLE) --typedef double sample_t; --typedef double level_t; -+typedef double dca_sample_t; -+typedef double dca_level_t; - #else --typedef float sample_t; --typedef float level_t; -+typedef float dca_sample_t; -+typedef float dca_level_t; - #endif - - typedef struct dca_state_s dca_state_t; -@@ -65,21 +65,24 @@ - #define DCA_LFE 0x80 - #define DCA_ADJUST_LEVEL 0x100 - -+#define DCA_OUT_DPLI 0x200 -+#define DCA_OUT_DPLII 0x400 -+ - dca_state_t * dca_init (uint32_t mm_accel); - - int dca_syncinfo (dca_state_t *state, uint8_t * buf, int * flags, - int * sample_rate, int * bit_rate, int *frame_length); - - int dca_frame (dca_state_t * state, uint8_t * buf, int * flags, -- level_t * level, sample_t bias); -+ dca_level_t * level, dca_sample_t bias); - - void dca_dynrng (dca_state_t * state, -- level_t (* call) (level_t, void *), void * data); -+ dca_level_t (* call) (dca_level_t, void *), void * data); - - int dca_blocks_num (dca_state_t * state); - int dca_block (dca_state_t * state); - --sample_t * dca_samples (dca_state_t * state); -+dca_sample_t * dca_samples (dca_state_t * state); - - void dca_free (dca_state_t * state); - -diff -Naur libdca/libao/audio_out_aif.c libdca_patched/libao/audio_out_aif.c ---- libdca/libao/audio_out_aif.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_aif.c 2007-05-02 10:09:41.000000000 +0100 -@@ -49,7 +49,7 @@ - }; - - static int aif_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - aif_instance_t * instance = (aif_instance_t *) _instance; - -@@ -78,7 +78,7 @@ - buf[1] = value; - } - --static int aif_play (ao_instance_t * _instance, int flags, sample_t * _samples) -+static int aif_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) - { - aif_instance_t * instance = (aif_instance_t *) _instance; - int16_t int16_samples[256*2]; -diff -Naur libdca/libao/audio_out_al.c libdca_patched/libao/audio_out_al.c ---- libdca/libao/audio_out_al.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_al.c 2007-05-02 10:09:41.000000000 +0100 -@@ -44,7 +44,7 @@ - } al_instance_t; - - static int al_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - al_instance_t * instance = (al_instance_t *) _instance; - -@@ -59,7 +59,7 @@ - return 0; - } - --static int al_play (ao_instance_t * _instance, int flags, sample_t * _samples) -+static int al_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) - { - al_instance_t * instance = (al_instance_t *) _instance; - int16_t int16_samples[256*6]; -diff -Naur libdca/libao/audio_out_float.c libdca_patched/libao/audio_out_float.c ---- libdca/libao/audio_out_float.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_float.c 2007-05-02 10:09:40.000000000 +0100 -@@ -32,7 +32,7 @@ - #include "audio_out_internal.h" - - static int float_setup (ao_instance_t * instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - (void)instance; - (void)sample_rate; -@@ -44,7 +44,7 @@ - } - - static int float_play (ao_instance_t * instance, int flags, -- sample_t * _samples) -+ dca_sample_t * _samples) - { - #if defined(LIBDCA_FIXED) - float samples[256 * 2]; -diff -Naur libdca/libao/audio_out_internal.h libdca_patched/libao/audio_out_internal.h ---- libdca/libao/audio_out_internal.h 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_internal.h 2007-05-02 10:09:40.000000000 +0100 -@@ -25,7 +25,7 @@ - #ifdef LIBDCA_DOUBLE - typedef float convert_t; - #else --typedef sample_t convert_t; -+typedef dca_sample_t convert_t; - #endif - - #ifdef LIBDCA_FIXED -diff -Naur libdca/libao/audio_out_null.c libdca_patched/libao/audio_out_null.c ---- libdca/libao/audio_out_null.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_null.c 2007-05-02 10:09:39.000000000 +0100 -@@ -36,7 +36,7 @@ - } null_instance_t; - - static int null_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - null_instance_t * instance = (null_instance_t *) _instance; - -@@ -48,7 +48,7 @@ - return 0; - } - --static int null_play (ao_instance_t * instance, int flags, sample_t * samples) -+static int null_play (ao_instance_t * instance, int flags, dca_sample_t * samples) - { - (void)instance; (void)flags; (void)samples; - return 0; -diff -Naur libdca/libao/audio_out_oss.c libdca_patched/libao/audio_out_oss.c ---- libdca/libao/audio_out_oss.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_oss.c 2007-05-02 10:09:38.000000000 +0100 -@@ -68,7 +68,7 @@ - } oss_instance_t; - - static int oss_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - oss_instance_t * instance = (oss_instance_t *) _instance; - -@@ -83,7 +83,7 @@ - return 0; - } - --static int oss_play (ao_instance_t * _instance, int flags, sample_t * _samples) -+static int oss_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) - { - oss_instance_t * instance = (oss_instance_t *) _instance; - int16_t int16_samples[256*6]; -diff -Naur libdca/libao/audio_out_peak.c libdca_patched/libao/audio_out_peak.c ---- libdca/libao/audio_out_peak.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_peak.c 2007-05-02 10:09:38.000000000 +0100 -@@ -16,7 +16,7 @@ - } peak_instance_t; - - static int peak_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - peak_instance_t * instance = (peak_instance_t *) _instance; - -@@ -29,7 +29,7 @@ - return 0; - } - --static int peak_play (ao_instance_t * _instance, int flags, sample_t * samples) -+static int peak_play (ao_instance_t * _instance, int flags, dca_sample_t * samples) - { - peak_instance_t * instance = (peak_instance_t *) _instance; - int i; -diff -Naur libdca/libao/audio_out_solaris.c libdca_patched/libao/audio_out_solaris.c ---- libdca/libao/audio_out_solaris.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_solaris.c 2007-05-02 10:09:37.000000000 +0100 -@@ -47,7 +47,7 @@ - } solaris_instance_t; - - static int solaris_setup (ao_instance_t * _instance, int sample_rate, -- int * flags, level_t * level, sample_t * bias) -+ int * flags, dca_level_t * level, dca_sample_t * bias) - { - solaris_instance_t * instance = (solaris_instance_t *) _instance; - -@@ -63,7 +63,7 @@ - } - - static int solaris_play (ao_instance_t * _instance, int flags, -- sample_t * _samples) -+ dca_sample_t * _samples) - { - solaris_instance_t * instance = (solaris_instance_t *) _instance; - int16_t int16_samples[256*2]; -diff -Naur libdca/libao/audio_out_wav.c libdca_patched/libao/audio_out_wav.c ---- libdca/libao/audio_out_wav.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_wav.c 2007-05-02 10:09:37.000000000 +0100 -@@ -87,7 +87,7 @@ - }; - - static int wav_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - wav_instance_t * instance = (wav_instance_t *) _instance; - -@@ -157,7 +157,7 @@ - - #include - --static int wav_play (ao_instance_t * _instance, int flags, sample_t * _samples) -+static int wav_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) - { - wav_instance_t * instance = (wav_instance_t *) _instance; - union -diff -Naur libdca/libao/audio_out_win.c libdca_patched/libao/audio_out_win.c ---- libdca/libao/audio_out_win.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/libao/audio_out_win.c 2007-05-02 10:09:36.000000000 +0100 -@@ -55,7 +55,7 @@ - } win_instance_t; - - static int win_setup (ao_instance_t * _instance, int sample_rate, int * flags, -- level_t * level, sample_t * bias) -+ dca_level_t * level, dca_sample_t * bias) - { - win_instance_t * instance = (win_instance_t *) _instance; - -@@ -70,7 +70,7 @@ - return 0; - } - --static int win_play (ao_instance_t * _instance, int flags, sample_t * _samples) -+static int win_play (ao_instance_t * _instance, int flags, dca_sample_t * _samples) - { - win_instance_t * instance = (win_instance_t *) _instance; - int current_buffer; -diff -Naur libdca/libdca/dca_internal.h libdca_patched/libdca/dca_internal.h ---- libdca/libdca/dca_internal.h 2007-05-02 10:05:05.000000000 +0100 -+++ libdca_patched/libdca/dca_internal.h 2007-05-02 10:09:35.000000000 +0100 -@@ -116,20 +116,20 @@ - double subband_fir_noidea[DCA_PRIM_CHANNELS_MAX][64]; - - /* Audio output */ -- level_t clev; /* centre channel mix level */ -- level_t slev; /* surround channels mix level */ -+ dca_level_t clev; /* centre channel mix level */ -+ dca_level_t slev; /* surround channels mix level */ - - int output; /* type of output */ -- level_t level; /* output level */ -- sample_t bias; /* output bias */ -+ dca_level_t level; /* output level */ -+ dca_sample_t bias; /* output bias */ - -- sample_t * samples; /* pointer to the internal audio samples buffer */ -+ dca_sample_t * samples; /* pointer to the internal audio samples buffer */ - int downmixed; - - int dynrnge; /* apply dynamic range */ -- level_t dynrng; /* dynamic range */ -+ dca_level_t dynrng; /* dynamic range */ - void * dynrngdata; /* dynamic range callback funtion and data */ -- level_t (* dynrngcall) (level_t range, void * dynrngdata); -+ dca_level_t (* dynrngcall) (dca_level_t range, void * dynrngdata); - - /* Bitstream handling */ - uint32_t * buffer_start; -@@ -155,19 +155,23 @@ - #define LEVEL_45DB 0.5946035575013605 - #define LEVEL_6DB 0.5 - --int dca_downmix_init (int input, int flags, level_t * level, -- level_t clev, level_t slev); --int dca_downmix_coeff (level_t * coeff, int acmod, int output, level_t level, -- level_t clev, level_t slev); --void dca_downmix (sample_t * samples, int acmod, int output, sample_t bias, -- level_t clev, level_t slev); --void dca_upmix (sample_t * samples, int acmod, int output); -+// these next two constants are used for DPL matrix encoding in downmix.c -+#define LEVEL_SQRT_1_2 0.5 -+#define LEVEL_SQRT_3_4 0.8660254037844386 -+ -+int dca_downmix_init (int input, int flags, dca_level_t * level, -+ dca_level_t clev, dca_level_t slev); -+int dca_downmix_coeff (dca_level_t * coeff, int acmod, int output, dca_level_t level, -+ dca_level_t clev, dca_level_t slev); -+void dca_downmix (dca_sample_t * samples, int acmod, int output, dca_sample_t bias, -+ dca_level_t clev, dca_level_t slev); -+void dca_upmix (dca_sample_t * samples, int acmod, int output); - - #define ROUND(x) ((int)((x) + ((x) > 0 ? 0.5 : -0.5))) - - #ifndef LIBDCA_FIXED - --typedef sample_t quantizer_t; -+typedef dca_sample_t quantizer_t; - #define SAMPLE(x) (x) - #define LEVEL(x) (x) - #define MUL(a,b) ((a) * (b)) -@@ -179,8 +183,8 @@ - #else /* LIBDCA_FIXED */ - - typedef int16_t quantizer_t; --#define SAMPLE(x) (sample_t)((x) * (1 << 30)) --#define LEVEL(x) (level_t)((x) * (1 << 26)) -+#define SAMPLE(x) (dca_sample_t)((x) * (1 << 30)) -+#define LEVEL(x) (dca_level_t)((x) * (1 << 26)) - - #if 0 - #define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30)) -diff -Naur libdca/libdca/downmix.c libdca_patched/libdca/downmix.c ---- libdca/libdca/downmix.c 2007-05-02 10:05:05.000000000 +0100 -+++ libdca_patched/libdca/downmix.c 2007-05-06 19:45:54.000000000 +0100 -@@ -33,8 +33,8 @@ - - #define CONVERT(acmod,output) (((output) << DCA_CHANNEL_BITS) + (acmod)) - --int dca_downmix_init (int input, int flags, level_t * level, -- level_t clev, level_t slev) -+int dca_downmix_init (int input, int flags, dca_level_t * level, -+ dca_level_t clev, dca_level_t slev) - { - static uint8_t table[11][10] = { - /* DCA_MONO */ -@@ -96,7 +96,7 @@ - output = DCA_DOLBY; - - if (flags & DCA_ADJUST_LEVEL) { -- level_t adjust; -+ dca_level_t adjust; - - switch (CONVERT (input & 7, output)) { - -@@ -181,13 +181,16 @@ - *level = MUL_L (*level, adjust); - } - -+ // add the DPLI/DPLII flag back into the output if one was passed in -+ output = output | (flags & DCA_OUT_DPLI) | (flags & DCA_OUT_DPLII); -+ - return output; - } - --int dca_downmix_coeff (level_t * coeff, int acmod, int output, level_t level, -- level_t clev, level_t slev) -+int dca_downmix_coeff (dca_level_t * coeff, int acmod, int output, dca_level_t level, -+ dca_level_t clev, dca_level_t slev) - { -- level_t level_3db; -+ dca_level_t level_3db; - - level_3db = MUL_C (level, LEVEL_3DB); - -@@ -344,7 +347,7 @@ - return -1; /* NOTREACHED */ - } - --static void mix2to1 (sample_t * dest, sample_t * src, sample_t bias) -+static void mix2to1 (dca_sample_t * dest, dca_sample_t * src, dca_sample_t bias) - { - int i; - -@@ -352,7 +355,7 @@ - dest[i] += BIAS (src[i]); - } - --static void mix3to1 (sample_t * samples, sample_t bias) -+static void mix3to1 (dca_sample_t * samples, dca_sample_t bias) - { - int i; - -@@ -360,7 +363,7 @@ - samples[i] += BIAS (samples[i + 256] + samples[i + 512]); - } - --static void mix4to1 (sample_t * samples, sample_t bias) -+static void mix4to1 (dca_sample_t * samples, dca_sample_t bias) - { - int i; - -@@ -369,7 +372,7 @@ - samples[i + 768]); - } - --static void mix5to1 (sample_t * samples, sample_t bias) -+static void mix5to1 (dca_sample_t * samples, dca_sample_t bias) - { - int i; - -@@ -378,10 +381,10 @@ - samples[i + 768] + samples[i + 1024]); - } - --static void mix3to2 (sample_t * samples, sample_t bias) -+static void mix3to2 (dca_sample_t * samples, dca_sample_t bias) - { - int i; -- sample_t common; -+ dca_sample_t common; - - for (i = 0; i < 256; i++) { - common = BIAS (samples[i]); -@@ -390,10 +393,10 @@ - } - } - --static void mix21to2 (sample_t * left, sample_t * right, sample_t bias) -+static void mix21to2 (dca_sample_t * left, dca_sample_t * right, dca_sample_t bias) - { - int i; -- sample_t common; -+ dca_sample_t common; - - for (i = 0; i < 256; i++) { - common = BIAS (right[i + 256]); -@@ -402,10 +405,10 @@ - } - } - --static void mix21toS (sample_t * samples, sample_t bias) -+static void mix21toS (dca_sample_t * samples, dca_sample_t bias) - { - int i; -- sample_t surround; -+ dca_sample_t surround; - - for (i = 0; i < 256; i++) { - surround = samples[i + 512]; -@@ -414,10 +417,10 @@ - } - } - --static void mix31to2 (sample_t * samples, sample_t bias) -+static void mix31to2 (dca_sample_t * samples, dca_sample_t bias) - { - int i; -- sample_t common; -+ dca_sample_t common; - - for (i = 0; i < 256; i++) { - common = BIAS (samples[i] + samples[i + 768]); -@@ -426,23 +429,32 @@ - } - } - --static void mix31toS (sample_t * samples, sample_t bias) -+static void mix31toS (dca_sample_t * samples, dca_sample_t bias) - { -- int i; -- sample_t common, surround; - -- for (i = 0; i < 256; i++) { -- common = BIAS (samples[i]); -- surround = samples[i + 768]; -- samples[i] = samples[i + 256] + common - surround; -- samples[i + 256] = samples[i + 512] + common + surround; -- } -+ int i; -+ dca_sample_t cc, surround, Lt, Rt; -+ -+ for (i = 0; i < 256; i++) { -+ -+ cc = samples[i] * LEVEL_3DB; -+ -+ surround = samples[i + 768]; -+ -+ Lt = samples[i + 256] + cc; -+ Rt = samples[i + 512] + cc; -+ -+ samples[i] = Lt - surround; -+ samples[i + 256] = Rt + surround; -+ -+ } -+ - } - --static void mix22toS (sample_t * samples, sample_t bias) -+static void mix22toS (dca_sample_t * samples, dca_sample_t bias) - { - int i; -- sample_t surround; -+ dca_sample_t surround; - - for (i = 0; i < 256; i++) { - surround = samples[i + 512] + samples[i + 768]; -@@ -451,10 +463,10 @@ - } - } - --static void mix32to2 (sample_t * samples, sample_t bias) -+static void mix32to2 (dca_sample_t * samples, dca_sample_t bias) - { - int i; -- sample_t common; -+ dca_sample_t common; - - for (i = 0; i < 256; i++) { - common = BIAS (samples[i]); -@@ -463,20 +475,55 @@ - } - } - --static void mix32toS (sample_t * samples, sample_t bias) -+static void mix32toS (dca_sample_t * samples, dca_sample_t bias, int use_dpl2) - { -- int i; -- sample_t common, surround; - -- for (i = 0; i < 256; i++) { -- common = BIAS (samples[i]); -- surround = samples[i + 768] + samples[i + 1024]; -- samples[i] = samples[i + 256] + common - surround; -- samples[i + 256] = samples[i + 512] + common + surround; -- } --} -+ if (use_dpl2 == 1) { - --static void move2to1 (sample_t * src, sample_t * dest, sample_t bias) -+ int i; -+ dca_sample_t cc, Lt, Rt, Ls, Rs, Lss, Rss; -+ -+ for (i = 0; i < 256; i++) { -+ -+ cc = samples[i] * LEVEL_3DB; -+ -+ Lt = samples[i + 256] + cc; -+ Rt = samples[i + 512] + cc; -+ -+ Ls = samples[i + 768]; -+ Rs = samples[i + 1024]; -+ -+ Lss = (LEVEL_SQRT_3_4 * Ls) - (LEVEL_SQRT_1_2 * Rs); -+ Rss = -(LEVEL_SQRT_1_2 * Ls) + (LEVEL_SQRT_3_4 * Rs); -+ -+ samples[i] = Lt + Lss; -+ samples[i + 256] = Rt + Rss; -+ -+ } -+ -+ } else { -+ -+ int i; -+ dca_sample_t cc, surround, Lt, Rt; -+ -+ for (i = 0; i < 256; i++) { -+ -+ cc = samples[i] * LEVEL_3DB; -+ -+ surround = samples[i + 768] + samples[i + 1024]; -+ -+ Lt = samples[i + 256] + cc; -+ Rt = samples[i + 512] + cc; -+ -+ samples[i] = Lt - surround; -+ samples[i + 256] = Rt + surround; -+ -+ } -+ -+ } -+ -+} -+static void move2to1 (dca_sample_t * src, dca_sample_t * dest, dca_sample_t bias) - { - int i; - -@@ -484,7 +531,7 @@ - dest[i] = BIAS (src[i] + src[i + 256]); - } - --static void zero (sample_t * samples) -+static void zero (dca_sample_t * samples) - { - int i; - -@@ -492,8 +539,8 @@ - samples[i] = 0; - } - --void dca_downmix (sample_t * samples, int acmod, int output, sample_t bias, -- level_t clev, level_t slev) -+void dca_downmix (dca_sample_t * samples, int acmod, int output, dca_sample_t bias, -+ dca_level_t clev, dca_level_t slev) - { - (void)clev; - -@@ -529,7 +576,7 @@ - break; - - case CONVERT (DCA_MONO, DCA_DOLBY): -- memcpy (samples + 256, samples, 256 * sizeof (sample_t)); -+ memcpy (samples + 256, samples, 256 * sizeof (dca_sample_t)); - break; - - case CONVERT (DCA_3F, DCA_STEREO): -@@ -576,7 +623,7 @@ - break; - - case CONVERT (DCA_3F2R, DCA_DOLBY): -- mix32toS (samples, bias); -+ mix32toS (samples, bias, 0); - break; - - case CONVERT (DCA_3F1R, DCA_3F): -@@ -594,7 +641,7 @@ - - case CONVERT (DCA_3F1R, DCA_2F1R): - mix3to2 (samples, bias); -- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); -+ memcpy (samples + 512, samples + 768, 256 * sizeof (dca_sample_t)); - break; - - case CONVERT (DCA_2F2R, DCA_2F1R): -@@ -608,30 +655,52 @@ - - case CONVERT (DCA_3F2R, DCA_3F1R): - mix2to1 (samples + 768, samples + 1024, bias); -+ /* deal with the special-case 5.0 to 4.0 DPL mix */ -+ if (output & DCA_OUT_DPLI) -+ { -+ mix31toS (samples, bias); -+ } - break; - - case CONVERT (DCA_2F1R, DCA_2F2R): -- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); -+ memcpy (samples + 768, samples + 512, 256 * sizeof (dca_sample_t)); - break; - - case CONVERT (DCA_3F1R, DCA_2F2R): - mix3to2 (samples, bias); -- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); -+ memcpy (samples + 512, samples + 768, 256 * sizeof (dca_sample_t)); - break; - - case CONVERT (DCA_3F2R, DCA_2F2R): - mix3to2 (samples, bias); -- memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t)); -- memcpy (samples + 768, samples + 1024, 256 * sizeof (sample_t)); -+ memcpy (samples + 512, samples + 768, 256 * sizeof (dca_sample_t)); -+ memcpy (samples + 768, samples + 1024, 256 * sizeof (dca_sample_t)); - break; - - case CONVERT (DCA_3F1R, DCA_3F2R): -- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); -+ memcpy (samples + 1024, samples + 768, 256 * sizeof (dca_sample_t)); -+ break; -+ -+ /* deal with the special-case DPL mixes */ -+ -+ case CONVERT (DCA_3F1R, DCA_3F1R): -+ if (output & DCA_OUT_DPLI) -+ { -+ mix31toS (samples, bias); -+ } - break; -+ -+ case CONVERT (DCA_3F2R, DCA_3F2R): -+ if (output & DCA_OUT_DPLII) -+ { -+ mix32toS (samples, bias, 1); -+ } -+ break; -+ - } - } - --void dca_upmix (sample_t * samples, int acmod, int output) -+void dca_upmix (dca_sample_t * samples, int acmod, int output) - { - switch (CONVERT (acmod, output & DCA_CHANNEL_MASK)) { - -@@ -657,7 +726,7 @@ - case CONVERT (DCA_3F, DCA_STEREO): - case CONVERT (DCA_3F, DCA_DOLBY): - mix_3to2: -- memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t)); -+ memcpy (samples + 512, samples + 256, 256 * sizeof (dca_sample_t)); - zero (samples + 256); - break; - -@@ -684,11 +753,11 @@ - zero (samples + 1024); - case CONVERT (DCA_3F1R, DCA_2F1R): - mix_31to21: -- memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t)); -+ memcpy (samples + 768, samples + 512, 256 * sizeof (dca_sample_t)); - goto mix_3to2; - - case CONVERT (DCA_3F2R, DCA_2F2R): -- memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); -+ memcpy (samples + 1024, samples + 768, 256 * sizeof (dca_sample_t)); - goto mix_31to21; - } - } -diff -Naur libdca/libdca/parse.c libdca_patched/libdca/parse.c ---- libdca/libdca/parse.c 2007-05-02 10:05:05.000000000 +0100 -+++ libdca_patched/libdca/parse.c 2007-05-02 10:09:33.000000000 +0100 -@@ -59,12 +59,12 @@ - static int decode_blockcode (int code, int levels, int *values); - - static void qmf_32_subbands (dca_state_t * state, int chans, -- double samples_in[32][8], sample_t *samples_out, -- double rScale, sample_t bias); -+ double samples_in[32][8], dca_sample_t *samples_out, -+ double rScale, dca_sample_t bias); - - static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample, -- double *samples_in, sample_t *samples_out, -- double rScale, sample_t bias ); -+ double *samples_in, dca_sample_t *samples_out, -+ double rScale, dca_sample_t bias ); - - static void pre_calc_cosmod( dca_state_t * state ); - -@@ -80,7 +80,7 @@ - - memset (state, 0, sizeof(dca_state_t)); - -- state->samples = (sample_t *) memalign (16, 256 * 12 * sizeof (sample_t)); -+ state->samples = (dca_sample_t *) memalign (16, 256 * 12 * sizeof (dca_sample_t)); - if (state->samples == NULL) { - free (state); - return NULL; -@@ -97,7 +97,7 @@ - return state; - } - --sample_t * dca_samples (dca_state_t * state) -+dca_sample_t * dca_samples (dca_state_t * state) - { - return state->samples; - } -@@ -207,7 +207,7 @@ - } - - int dca_frame (dca_state_t * state, uint8_t * buf, int * flags, -- level_t * level, sample_t bias) -+ dca_level_t * level, dca_sample_t bias) - { - int i, j; - static float adj_table[] = { 1.0, 1.1250, 1.2500, 1.4375 }; -@@ -996,7 +996,7 @@ - { - dca_upmix (state->samples, state->amode, state->output); - } else -- if (state->prim_channels > dca_channels[state->output & DCA_CHANNEL_MASK]) -+ if (state->prim_channels >= dca_channels[state->output & DCA_CHANNEL_MASK]) - { - dca_downmix (state->samples, state->amode, state->output, state->bias, - state->clev, state->slev); -@@ -1142,8 +1142,8 @@ - } - - static void qmf_32_subbands (dca_state_t * state, int chans, -- double samples_in[32][8], sample_t *samples_out, -- double scale, sample_t bias) -+ double samples_in[32][8], dca_sample_t *samples_out, -+ double scale, dca_sample_t bias) - { - double *prCoeff; - int i, j, k; -@@ -1224,8 +1224,8 @@ - } - - static void lfe_interpolation_fir (int nDecimationSelect, int nNumDeciSample, -- double *samples_in, sample_t *samples_out, -- double scale, sample_t bias) -+ double *samples_in, dca_sample_t *samples_out, -+ double scale, dca_sample_t bias) - { - /* samples_in: An array holding decimated samples. - * Samples in current subframe starts from samples_in[0], -@@ -1275,7 +1275,7 @@ - } - - void dca_dynrng (dca_state_t * state, -- level_t (* call) (level_t, void *), void * data) -+ dca_level_t (* call) (dca_level_t, void *), void * data) - { - state->dynrange = 0; - if (call) { -diff -Naur libdca/src/dcadec.c libdca_patched/src/dcadec.c ---- libdca/src/dcadec.c 2007-05-02 10:05:04.000000000 +0100 -+++ libdca_patched/src/dcadec.c 2007-05-02 10:09:35.000000000 +0100 -@@ -280,15 +280,15 @@ - } - bufpos = buf + length; - } else { -- level_t level; -- sample_t bias; -+ dca_level_t level; -+ dca_sample_t bias; - int i; - - if (output->setup (output, sample_rate, &flags, &level, &bias)) - goto error; - if (!disable_adjust) - flags |= DCA_ADJUST_LEVEL; -- level = (level_t) (level * gain); -+ level = (dca_level_t) (level * gain); - if (dca_frame (state, buf, &flags, &level, bias)) - goto error; - if (disable_dynrng) diff --git a/contrib/patch-libdvdread-css-vlc-dylib.patch b/contrib/patch-libdvdread-css-vlc-dylib.patch deleted file mode 100644 index 70c5bab9c..000000000 --- a/contrib/patch-libdvdread-css-vlc-dylib.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- dvdread/dvd_input.c 2005-09-19 09:43:08.000000000 -0400 -+++ dvdread/patched-dvd_input.c 2008-03-19 12:47:16.000000000 -0400 -@@ -332,7 +332,7 @@ - - #else - -- dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY); -+ dvdcss_library = dlopen("/Applications/VLC.app/Contents/MacOS/lib/libdvdcss.2.dylib", RTLD_LAZY); - - if(dvdcss_library != NULL) { - #if defined(__OpenBSD__) && !defined(__ELF__) diff --git a/contrib/patch-libdvdread-cygwin.patch b/contrib/patch-libdvdread-cygwin.patch deleted file mode 100644 index fbb1f12d3..000000000 --- a/contrib/patch-libdvdread-cygwin.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -Naur libdvdread/configure libdvdread/configure ---- libdvdread/configure 2006-10-06 04:14:24.000000000 -0400 -+++ libdvdread/configure 2008-10-04 08:51:17.153181000 -0400 -@@ -3550,9 +3550,6 @@ - _ACEOF - - ;; -- x*mingw32* | x*cygwin*) -- CFLAGS="${CFLAGS} -Dssize_t=long" -- ;; - x*) - ;; - esac -diff -Naur libdvdread/configure.in libdvdread/configure.in ---- libdvdread/configure.in 2006-10-06 04:12:31.000000000 -0400 -+++ libdvdread/configure.in 2008-10-04 08:51:26.356306000 -0400 -@@ -15,9 +15,6 @@ - CFLAGS="${CFLAGS} -no-cpp-precomp" - AC_DEFINE(__DARWIN__, 1, Have a Mac OS X system) - ;; -- x*mingw32* | x*cygwin*) -- CFLAGS="${CFLAGS} -Dssize_t=long" -- ;; - x*) - ;; - esac \ No newline at end of file diff --git a/contrib/patch-libmpeg2.patch b/contrib/patch-libmpeg2.patch deleted file mode 100644 index d5ab5bf65..000000000 --- a/contrib/patch-libmpeg2.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -ur orig/header.c mpeg2dec/libmpeg2/header.c ---- orig/header.c 2003-12-22 12:24:02.000000000 +0100 -+++ mpeg2dec/libmpeg2/header.c 2004-08-02 18:07:50.000000000 +0200 -@@ -100,6 +100,9 @@ - mpeg2dec->decoder.convert = NULL; - mpeg2dec->decoder.convert_id = NULL; - mpeg2dec->picture = mpeg2dec->pictures; -+ memset(&mpeg2dec->fbuf_alloc[0].fbuf, 0, sizeof(mpeg2_fbuf_t)); -+ memset(&mpeg2dec->fbuf_alloc[1].fbuf, 0, sizeof(mpeg2_fbuf_t)); -+ memset(&mpeg2dec->fbuf_alloc[2].fbuf, 0, sizeof(mpeg2_fbuf_t)); - mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf; - mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf; - mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf; -@@ -551,6 +554,7 @@ - if (!(mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) { - picture->nb_fields = (buffer[3] & 2) ? 3 : 2; - flags |= (buffer[3] & 128) ? PIC_FLAG_TOP_FIELD_FIRST : 0; -+ flags |= (buffer[3] & 2) ? PIC_FLAG_REPEAT_FIRST_FIELD : 0; - } else - picture->nb_fields = (buffer[3]&2) ? ((buffer[3]&128) ? 6 : 4) : 2; - break; -diff -ur orig/mpeg2.h mpeg2dec/include/mpeg2.h ---- orig/mpeg2.h 2003-12-22 13:13:35.000000000 +0100 -+++ mpeg2dec/include/mpeg2.h 2004-02-18 13:50:13.000000000 +0100 -@@ -82,6 +82,7 @@ - #define PIC_FLAG_COMPOSITE_DISPLAY 32 - #define PIC_FLAG_SKIP 64 - #define PIC_FLAG_TAGS 128 -+#define PIC_FLAG_REPEAT_FIRST_FIELD 256 - #define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000 - - typedef struct mpeg2_picture_s { - diff --git a/contrib/patch-x264-cygwin.patch b/contrib/patch-x264-cygwin.patch deleted file mode 100644 index f2e375d69..000000000 --- a/contrib/patch-x264-cygwin.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- x264/configure2 2008-04-12 21:45:07.000000000 +0100 -+++ x264/configure 2008-04-14 18:44:33.890625000 +0100 -@@ -210,8 +210,8 @@ - ;; - cygwin*) - SYS="MINGW" -- CFLAGS="$CFLAGS -mno-cygwin" -- LDFLAGS="$LDFLAGS -mno-cygwin" -+ #CFLAGS="$CFLAGS -mno-cygwin" -+ #LDFLAGS="$LDFLAGS -mno-cygwin" - EXE=".exe" - DEVNULL="NUL" - ;; diff --git a/contrib/patch-x264-idr.patch b/contrib/patch-x264-idr.patch deleted file mode 100644 index df4294f12..000000000 --- a/contrib/patch-x264-idr.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: encoder/slicetype.c -=================================================================== ---- encoder/slicetype.c (revision 665) -+++ encoder/slicetype.c (working copy) -@@ -379,7 +379,12 @@ - return; - frames[0] = h->frames.last_nonb; - for( j = 0; h->frames.next[j]; j++ ) -+ { -+ // if the app wants an IDR, give it to them -+ if ( h->frames.next[j]->i_type == X264_TYPE_IDR ) -+ return; - frames[j+1] = h->frames.next[j]; -+ } - keyint_limit = h->param.i_keyint_max - frames[0]->i_frame + h->frames.i_last_idr - 1; - num_frames = X264_MIN( j, keyint_limit ); - if( num_frames == 0 ) diff --git a/contrib/patch-x264-linux.patch b/contrib/patch-x264-linux.patch deleted file mode 100644 index 3f1752d4c..000000000 --- a/contrib/patch-x264-linux.patch +++ /dev/null @@ -1,194 +0,0 @@ -Index: /common/ppc/quant.c -=================================================================== ---- /common/ppc/quant.c (revision 601) -+++ /common/ppc/quant.c (revision 621) -@@ -18,8 +18,4 @@ - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ -- --#ifdef HAVE_ALTIVEC_H --#include --#endif - - #include "common/common.h" -@@ -54,29 +50,29 @@ - temp2v = vec_xor(temp2v, mskB); \ - temp1v = vec_adds(temp1v, vec_and(mskA, one)); \ --vec_st(temp1v, (dct0), dct); \ -+vec_st(temp1v, (dct0), (int16_t*)dct); \ - temp2v = vec_adds(temp2v, vec_and(mskB, one)); \ --vec_st(temp2v, (dct1), dct); -+vec_st(temp2v, (dct1), (int16_t*)dct); - - void x264_quant_4x4_altivec( int16_t dct[4][4], int quant_mf[4][4], int const i_qbits, int const f ) { - vector bool short mskA; -- vec_s32_t i_qbitsv; -+ vec_u32_t i_qbitsv; - vec_u16_t coefvA; - vec_u32_t multEvenvA, multOddvA; -- vec_u32_t mfvA; -+ vec_u16_t mfvA; - vec_s16_t zerov, one; -- vec_s32_t fV; -+ vec_u32_t fV; - - vector bool short mskB; - vec_u16_t coefvB; - vec_u32_t multEvenvB, multOddvB; -- vec_u32_t mfvB; -+ vec_u16_t mfvB; - - vec_s16_t temp1v, temp2v; - -- vect_sint_u qbits_u; -+ vect_int_u qbits_u; - qbits_u.s[0]=i_qbits; - i_qbitsv = vec_splat(qbits_u.v, 0); - -- vect_sint_u f_u; -+ vect_int_u f_u; - f_u.s[0]=f; - -@@ -114,16 +110,16 @@ - temp2v = vec_xor(temp2v, mskB); \ - temp1v = vec_add(temp1v, vec_and(mskA, one)); \ --vec_st(temp1v, (dct0), dct); \ -+vec_st(temp1v, (dct0), (int16_t*)dct); \ - temp2v = vec_add(temp2v, vec_and(mskB, one)); \ --vec_st(temp2v, (dct1), dct); -+vec_st(temp2v, (dct1), (int16_t*)dct); - - - void x264_quant_4x4_dc_altivec( int16_t dct[4][4], int i_quant_mf, int const i_qbits, int const f ) { - vector bool short mskA; -- vec_s32_t i_qbitsv; -+ vec_u32_t i_qbitsv; - vec_u16_t coefvA; - vec_u32_t multEvenvA, multOddvA; - vec_s16_t zerov, one; -- vec_s32_t fV; -+ vec_u32_t fV; - - vector bool short mskB; -@@ -133,15 +129,14 @@ - vec_s16_t temp1v, temp2v; - -- vec_u32_t mfv; -- vect_int_u mf_u; -+ vec_u16_t mfv; -+ vect_ushort_u mf_u; - mf_u.s[0]=i_quant_mf; - mfv = vec_splat( mf_u.v, 0 ); -- mfv = vec_packs( mfv, mfv); - -- vect_sint_u qbits_u; -+ vect_int_u qbits_u; - qbits_u.s[0]=i_qbits; - i_qbitsv = vec_splat(qbits_u.v, 0); - -- vect_sint_u f_u; -+ vect_int_u f_u; - f_u.s[0]=f; - fV = vec_splat(f_u.v, 0); -@@ -156,13 +151,15 @@ - void x264_quant_8x8_altivec( int16_t dct[8][8], int quant_mf[8][8], int const i_qbits, int const f ) { - vector bool short mskA; -- vec_s32_t i_qbitsv; -+ vec_u32_t i_qbitsv; - vec_u16_t coefvA; -- vec_s32_t multEvenvA, multOddvA, mfvA; -+ vec_u32_t multEvenvA, multOddvA; -+ vec_u16_t mfvA; - vec_s16_t zerov, one; -- vec_s32_t fV; -+ vec_u32_t fV; - - vector bool short mskB; - vec_u16_t coefvB; -- vec_u32_t multEvenvB, multOddvB, mfvB; -+ vec_u32_t multEvenvB, multOddvB; -+ vec_u16_t mfvB; - - vec_s16_t temp1v, temp2v; -@@ -172,5 +169,5 @@ - i_qbitsv = vec_splat(qbits_u.v, 0); - -- vect_sint_u f_u; -+ vect_int_u f_u; - f_u.s[0]=f; - fV = vec_splat(f_u.v, 0); -Index: /common/ppc/dct.c -=================================================================== ---- /common/ppc/dct.c (revision 604) -+++ /common/ppc/dct.c (revision 621) -@@ -61,6 +61,6 @@ - VEC_DCT( dct0v, dct1v, dct2v, dct3v, tmp0v, tmp1v, tmp2v, tmp3v ); - -- vec_st(vec_perm(tmp0v, tmp1v, permHighv), 0, dct); -- vec_st(vec_perm(tmp2v, tmp3v, permHighv), 16, dct); -+ vec_st(vec_perm(tmp0v, tmp1v, permHighv), 0, (int16_t*)dct); -+ vec_st(vec_perm(tmp2v, tmp3v, permHighv), 16, (int16_t*)dct); - } - -@@ -95,12 +95,12 @@ - VEC_DCT( dct4v, dct5v, dct6v, dct7v, tmp4v, tmp5v, tmp6v, tmp7v ); - -- vec_st(vec_perm(tmp0v, tmp1v, permHighv), 0, dct); -- vec_st(vec_perm(tmp2v, tmp3v, permHighv), 16, dct); -- vec_st(vec_perm(tmp4v, tmp5v, permHighv), 32, dct); -- vec_st(vec_perm(tmp6v, tmp7v, permHighv), 48, dct); -- vec_st(vec_perm(tmp0v, tmp1v, permLowv), 64, dct); -- vec_st(vec_perm(tmp2v, tmp3v, permLowv), 80, dct); -- vec_st(vec_perm(tmp4v, tmp5v, permLowv), 96, dct); -- vec_st(vec_perm(tmp6v, tmp7v, permLowv), 112, dct); -+ vec_st(vec_perm(tmp0v, tmp1v, permHighv), 0, (int16_t*)dct); -+ vec_st(vec_perm(tmp2v, tmp3v, permHighv), 16, (int16_t*)dct); -+ vec_st(vec_perm(tmp4v, tmp5v, permHighv), 32, (int16_t*)dct); -+ vec_st(vec_perm(tmp6v, tmp7v, permHighv), 48, (int16_t*)dct); -+ vec_st(vec_perm(tmp0v, tmp1v, permLowv), 64, (int16_t*)dct); -+ vec_st(vec_perm(tmp2v, tmp3v, permLowv), 80, (int16_t*)dct); -+ vec_st(vec_perm(tmp4v, tmp5v, permLowv), 96, (int16_t*)dct); -+ vec_st(vec_perm(tmp6v, tmp7v, permLowv), 112, (int16_t*)dct); - } - -@@ -312,6 +312,6 @@ - void x264_add8x8_idct8_altivec( uint8_t *dst, int16_t dct[8][8] ) - { -- vec_s16_t onev = vec_splat_s16(1); -- vec_s16_t twov = vec_splat_s16(2); -+ vec_u16_t onev = vec_splat_s16(1); -+ vec_u16_t twov = vec_splat_s16(2); - - dct[0][0] += 32; // rounding for the >>6 at the end -@@ -342,5 +342,5 @@ - vec_u8_t perm_ldv = vec_lvsl(0, dst); - vec_u8_t perm_stv = vec_lvsr(8, dst); -- vec_s16_t sixv = vec_splat_s16(6); -+ vec_u16_t sixv = vec_splat_s16(6); - const vec_u8_t sel = (vec_u8_t) CV(0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1); - LOAD_ZERO; -Index: /common/ppc/quant.h -=================================================================== ---- /common/ppc/quant.h (revision 601) -+++ /common/ppc/quant.h (revision 621) -@@ -19,4 +19,8 @@ - *****************************************************************************/ - -+#ifdef SYS_LINUX -+#include -+#endif -+ - #ifndef _PPC_QUANT_H - #define _PPC_QUANT_H 1 -@@ -28,8 +32,7 @@ - - typedef union { -- signed int s[4]; -- vector signed int v; --} vect_sint_u; -- -+ unsigned short s[8]; -+ vector unsigned short v; -+} vect_ushort_u; - - void x264_quant_4x4_altivec( int16_t dct[4][4], int quant_mf[4][4], int const i_qbits, int const f ); diff --git a/contrib/patch-x264-solaris.patch b/contrib/patch-x264-solaris.patch deleted file mode 100644 index 24d629ff9..000000000 --- a/contrib/patch-x264-solaris.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -ru x264/Makefile x264.solaris/Makefile ---- x264/Makefile Mon Jun 9 01:36:08 2008 -+++ x264.solaris/Makefile Thu Jun 19 11:54:53 2008 -@@ -150,8 +150,10 @@ - $(MAKE) -C gtk distclean - - install: x264$(EXE) $(SONAME) -- install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) -- install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig -+ install -d $(DESTDIR)$(bindir) -+ install -d $(DESTDIR)$(includedir) -+ install -d $(DESTDIR)$(libdir) -+ install -d $(DESTDIR)$(libdir)/pkgconfig - install -m 644 x264.h $(DESTDIR)$(includedir) - install -m 644 libx264.a $(DESTDIR)$(libdir) - install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig -diff -ru x264/configure x264.solaris/configure ---- x264/configure Tue Aug 12 03:26:58 2008 -+++ x264.modified/configure Tue Aug 19 16:09:32 2008 -@@ -1,4 +1,4 @@ --#! /bin/sh -+#! /usr/xpg4/bin/sh - - if test x"$1" = x"-h" -o x"$1" = x"--help" ; then - -@@ -75,7 +75,7 @@ - # check whether 'echo -n' works as expected, otherwise try printf - if [ "x`echo -n houba`" = xhouba ] - then -- ECHON="echo -n" -+ ECHON="/usr/ucb/echo -n" - elif [ "x`printf houba`" = xhouba ] - then - ECHON="printf" -@@ -321,8 +321,6 @@ - echo "If you really want to compile without asm, configure with --disable-asm." - exit 1 - fi --else -- AS="" - fi - - CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS" -@@ -329,8 +327,10 @@ - - echo "unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';" > conftest.c - $CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed" --grep -q BIGE conftest.o && CFLAGS="$CFLAGS -DWORDS_BIGENDIAN" -+/usr/bin/tr -cd "BIGE" < conftest.o | /usr/xpg4/bin/grep -q BIGE && CFLAGS="$CFLAGS -DWORDS_BIGENDIAN" - -+echo $CFLAGS -+ - # autodetect options that weren't forced nor disabled - - libpthread="" -diff -ru x264/version.sh x264.solaris/version.sh ---- x264/version.sh Mon Jun 9 01:36:08 2008 -+++ x264.solaris/version.sh Thu Jun 19 11:56:19 2008 -@@ -1,7 +1,7 @@ - #!/bin/sh - git-rev-list HEAD | sort > config.git-hash - LOCALVER=`wc -l config.git-hash | awk '{print $1}'` --if [ $LOCALVER \> 1 ] ; then -+if [ $LOCALVER -gt 1 ] ; then - VER=`git-rev-list origin/master | sort | join config.git-hash - | wc -l | awk '{print $1}'` - if [ $VER != $LOCALVER ] ; then - VER="$VER+$(($LOCALVER-$VER))" diff --git a/contrib/patch-xvidcore-cygwin.patch b/contrib/patch-xvidcore-cygwin.patch deleted file mode 100644 index 7b60510d0..000000000 --- a/contrib/patch-xvidcore-cygwin.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -Naur xvidcore/build/generic/configure xvidcore-patched/build/generic/configure ---- xvidcore/build/generic/configure 2005-12-30 09:45:30.000000000 -0500 -+++ xvidcore-patched/build/generic/configure 2007-01-01 18:43:27.953125000 -0500 -@@ -3844,10 +3844,9 @@ - [cC][yY][gG][wW][iI][nN]*|mingw32*|mks*) - echo "$as_me:$LINENO: result: ok" >&5 - echo "${ECHO_T}ok" >&6 -- STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" -- SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" -- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" -- SPECIFIC_CFLAGS="-mno-cygwin" -+ STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" -+ SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" -+ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" - ;; - darwin*|raphsody*) - STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" -diff -Naur xvidcore/build/generic/configure.in xvidcore-patched/build/generic/configure.in ---- xvidcore/build/generic/configure.in 2005-12-30 09:45:30.000000000 -0500 -+++ xvidcore-patched/build/generic/configure.in 2007-01-01 18:43:11.453125000 -0500 -@@ -281,10 +281,9 @@ - ;; - [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*) - AC_MSG_RESULT([ok]) -- STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" -- SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" -- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" -- SPECIFIC_CFLAGS="-mno-cygwin" -+ STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" -+ SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" -+ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" - ;; - darwin*|raphsody*) - STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" diff --git a/contrib/patch-xvidcore-fdct.patch b/contrib/patch-xvidcore-fdct.patch deleted file mode 100644 index 1fc90b689..000000000 --- a/contrib/patch-xvidcore-fdct.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm.orig 2008-02-22 10:28:13.000000000 -0800 -+++ xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm 2008-02-22 11:08:52.000000000 -0800 -@@ -620,3 +620,5 @@ - ret - .endfunc - -+ALIGN 16 -+ times 8 dw 0 diff --git a/contrib/patch-xvidcore-macosx.patch b/contrib/patch-xvidcore-macosx.patch deleted file mode 100644 index 51cb94c6d..000000000 --- a/contrib/patch-xvidcore-macosx.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -ru xvidcore-1.1.0/build/generic/configure xvidcore-1.1.0-patched/build/generic/configure ---- xvidcore-1.1.0/build/generic/configure 2005-12-30 15:45:30.000000000 +0100 -+++ xvidcore-1.1.0-patched/build/generic/configure 2006-01-16 22:06:10.000000000 +0100 -@@ -4052,6 +4071,12 @@ - PREFIX="-DPREFIX" - MARK_FUNCS="" - ;; -+ *darwin*) -+ echo "$as_me:$LINENO: result: macho" >&5 -+echo "${ECHO_T}macho" >&6 -+ NASM_FORMAT="macho" -+ PREFIX="-DPREFIX" -+ MARK_FUNCS="" - esac - - AS="$chosen_asm_prog" -diff -ru xvidcore-1.1.0/build/generic/configure.in xvidcore-1.1.0-patched/build/generic/configure.in ---- xvidcore-1.1.0/build/generic/configure.in 2005-12-30 15:45:30.000000000 +0100 -+++ xvidcore-1.1.0-patched/build/generic/configure.in 2006-01-16 22:06:04.000000000 +0100 -@@ -397,6 +397,11 @@ - PREFIX="-DPREFIX" - MARK_FUNCS="" - ;; -+ *darwin*) -+ AC_MSG_RESULT([macho]) -+ NASM_FORMAT="macho" -+ PREFIX="-DPREFIX" -+ MARK_FUNCS="" - esac - - AS="$chosen_asm_prog" diff --git a/contrib/patch-xvidcore-nasm-2.00-configure.patch b/contrib/patch-xvidcore-nasm-2.00-configure.patch deleted file mode 100644 index 44242ace4..000000000 --- a/contrib/patch-xvidcore-nasm-2.00-configure.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ruN xvidcore-orig/build/generic/configure xvidcore/build/generic/configure ---- xvidcore-orig/build/generic/configure 2006-11-01 03:39:36.000000000 -0700 -+++ xvidcore/build/generic/configure 2008-01-30 20:19:48.000000000 -0700 -@@ -4016,7 +4016,7 @@ - if test "$ac_nasm" = "yes" ; then - echo "$as_me:$LINENO: checking for nasm patch version" >&5 - echo $ECHO_N "checking for nasm patch version... $ECHO_C" >&6 -- nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1` -+ nasm_patch=`($nasm_prog -r || $nasm_prog -v) | cut -d '.' -f 3 | cut -d ' ' -f 1` - if test -z $nasm_patch ; then -- nasm_patch=-1 -+ nasm_patch=45 - fi diff --git a/contrib/patch_mpeg4ip_cygwin.patch b/contrib/patch_mpeg4ip_cygwin.patch deleted file mode 100644 index 0bc19cda6..000000000 --- a/contrib/patch_mpeg4ip_cygwin.patch +++ /dev/null @@ -1,262 +0,0 @@ -diff -Naur mpeg4ip/lib/mp4v2/mp4.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.cpp ---- mpeg4ip/lib/mp4v2/mp4.cpp 2005-03-30 20:41:58.000000000 +0200 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.cpp 2007-02-09 22:39:28.000000000 +0100 -@@ -1678,9 +1678,9 @@ - extern "C" bool MP4GetTrackH264SeqPictHeaders (MP4FileHandle hFile, - MP4TrackId trackId, - uint8_t ***pSeqHeader, -- uint32_t **pSeqHeaderSize, -+ u_int32_t **pSeqHeaderSize, - uint8_t ***pPictHeader, -- uint32_t **pPictHeaderSize) -+ u_int32_t **pPictHeaderSize) - { - if (MP4_IS_VALID_FILE_HANDLE(hFile)) { - try { -diff -Naur mpeg4ip/lib/mp4v2/mp4.h /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.h ---- mpeg4ip/lib/mp4v2/mp4.h 2005-03-30 20:41:58.000000000 +0200 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.h 2007-02-09 22:39:42.000000000 +0100 -@@ -631,9 +631,9 @@ - - bool MP4GetTrackVideoMetadata(MP4FileHandle hFile, - MP4TrackId trackId, -- uint8_t **ppConfig, -- uint32_t *pConfigSize); -- -+ u_int8_t **ppConfig, -+ u_int32_t *pConfigSize); -+ - bool MP4GetTrackESConfiguration( - MP4FileHandle hFile, - MP4TrackId trackId, -@@ -654,9 +654,9 @@ - bool MP4GetTrackH264SeqPictHeaders(MP4FileHandle hFile, - MP4TrackId trackId, - uint8_t ***pSeqHeaders, -- uint32_t **pSeqHeaderSize, -+ u_int32_t **pSeqHeaderSize, - uint8_t ***pPictHeader, -- uint32_t **pPictHeaderSize); -+ u_int32_t **pPictHeaderSize); - bool MP4GetTrackH264LengthSize(MP4FileHandle hFile, - MP4TrackId trackId, - uint32_t *pLength); -diff -Naur mpeg4ip/lib/mp4v2/mp4container.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.cpp ---- mpeg4ip/lib/mp4v2/mp4container.cpp 2001-11-19 18:06:58.000000000 +0100 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.cpp 2007-02-09 22:10:23.000000000 +0100 -@@ -207,7 +207,7 @@ - u_int32_t numProperties = m_pProperties.Size(); - - if (numProperties == 0) { -- WARNING(numProperties == 0); -+ //WARNING(numProperties == 0); - return; - } - -diff -Naur mpeg4ip/lib/mp4v2/mp4container.h /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.h ---- mpeg4ip/lib/mp4v2/mp4container.h 2001-11-19 18:06:58.000000000 +0100 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.h 2007-02-09 22:06:42.000000000 +0100 -@@ -1,24 +1,3 @@ --/* -- * The contents of this file are subject to the Mozilla Public -- * License Version 1.1 (the "License"); you may not use this file -- * except in compliance with the License. You may obtain a copy of -- * the License at http://www.mozilla.org/MPL/ -- * -- * Software distributed under the License is distributed on an "AS -- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -- * implied. See the License for the specific language governing -- * rights and limitations under the License. -- * -- * The Original Code is MPEG4IP. -- * -- * The Initial Developer of the Original Code is Cisco Systems Inc. -- * Portions created by Cisco Systems Inc. are -- * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. -- * -- * Contributor(s): -- * Dave Mackie dmackie@cisco.com -- */ -- - #ifndef __MP4_CONTAINER_INCLUDED__ - #define __MP4_CONTAINER_INCLUDED__ - -diff -Naur mpeg4ip/lib/mp4v2/mp4descriptor.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4descriptor.cpp ---- mpeg4ip/lib/mp4v2/mp4descriptor.cpp 2004-02-12 03:06:02.000000000 +0100 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4descriptor.cpp 2007-02-09 22:24:17.000000000 +0100 -@@ -149,7 +149,7 @@ - u_int32_t numProperties = m_pProperties.Size(); - - if (numProperties == 0) { -- WARNING(numProperties == 0); -+ //WARNING(numProperties == 0); - return; - } - -@@ -194,7 +194,7 @@ - u_int32_t numProperties = m_pProperties.Size(); - - if (numProperties == 0) { -- WARNING(numProperties == 0); -+ //WARNING(numProperties == 0); - return; - } - for (u_int32_t i = 0; i < numProperties; i++) { -diff -Naur mpeg4ip/lib/mp4v2/mp4file.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.cpp ---- mpeg4ip/lib/mp4v2/mp4file.cpp 2005-03-30 20:41:58.000000000 +0200 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.cpp 2007-02-09 22:44:08.000000000 +0100 -@@ -1431,7 +1431,7 @@ - return trackId; - } - --MP4TrackId MP4File::AddCntlTrackDefault (uint32_t timeScale, -+MP4TrackId MP4File::AddCntlTrackDefault (u_int32_t timeScale, - MP4Duration sampleDuration, - const char *type) - { -@@ -1682,7 +1682,7 @@ - (MP4Property **)&pLength) == false) || - (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetNALUnit", - (MP4Property **)&pUnit) == false)) { -- VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties")); -+ //VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties")); - return false; - } - uint32_t count = pCount->GetValue(); -@@ -1692,7 +1692,7 @@ - for (uint32_t index = 0; index < count; index++) { - if (pLength->GetValue(index) == sequenceLen) { - uint8_t *seq; -- uint32_t seqlen; -+ u_int32_t seqlen; - pUnit->GetValue(&seq, &seqlen, index); - if (memcmp(seq, pSequence, sequenceLen) == 0) { - free(seq); -@@ -1724,8 +1724,8 @@ - (MP4Property **)&pLength) == false) || - (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetNALUnit", - (MP4Property **)&pUnit) == false)) { -- VERBOSE_ERROR(m_verbosity, -- WARNING("Could not find avcC picture table properties")); -+ //VERBOSE_ERROR(m_verbosity, -+ //WARNING("Could not find avcC picture table properties")); - return false; - } - uint32_t count = pCount->GetValue(); -@@ -1735,7 +1735,7 @@ - for (uint32_t index = 0; index < count; index++) { - if (pLength->GetValue(index) == pictLen) { - uint8_t *seq; -- uint32_t seqlen; -+ u_int32_t seqlen; - pUnit->GetValue(&seq, &seqlen, index); - if (memcmp(seq, pPict, pictLen) == 0) { - VERBOSE_WRITE(m_verbosity, -@@ -2472,9 +2472,9 @@ - - bool MP4File::GetTrackH264SeqPictHeaders (MP4TrackId trackId, - uint8_t ***pppSeqHeader, -- uint32_t **ppSeqHeaderSize, -+ u_int32_t **ppSeqHeaderSize, - uint8_t ***pppPictHeader, -- uint32_t **ppPictHeaderSize) -+ u_int32_t **ppPictHeaderSize) - { - uint32_t count; - -@@ -2490,15 +2490,15 @@ - (MP4Property **)&pSeqLen) == false) || - (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetNALUnit", - (MP4Property **)&pSeqVal) == false)) { -- VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties")); -+ //VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties")); - return false; - } - uint8_t **ppSeqHeader = - (uint8_t **)malloc((pSeqCount->GetValue() + 1) * sizeof(uint8_t *)); - *pppSeqHeader = ppSeqHeader; - -- uint32_t *pSeqHeaderSize = -- (uint32_t *)malloc((pSeqCount->GetValue() + 1) * sizeof(uint32_t *)); -+ u_int32_t *pSeqHeaderSize = -+ (u_int32_t *)malloc((pSeqCount->GetValue() + 1) * sizeof(u_int32_t *)); - - *ppSeqHeaderSize = pSeqHeaderSize; - for (count = 0; count < pSeqCount->GetValue(); count++) { -@@ -2513,15 +2513,15 @@ - (MP4Property **)&pPictLen) == false) || - (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetNALUnit", - (MP4Property **)&pPictVal) == false)) { -- VERBOSE_ERROR(m_verbosity, -- WARNING("Could not find avcC picture table properties")); -+ //VERBOSE_ERROR(m_verbosity, -+ //WARNING("Could not find avcC picture table properties")); - return false; - } - uint8_t - **ppPictHeader = - (uint8_t **)malloc((pPictCount->GetValue() + 1) * sizeof(uint8_t *)); -- uint32_t *pPictHeaderSize = -- (uint32_t *)malloc((pPictCount->GetValue() + 1)* sizeof(uint32_t *)); -+ u_int32_t *pPictHeaderSize = -+ (u_int32_t *)malloc((pPictCount->GetValue() + 1)* sizeof(u_int32_t *)); - *pppPictHeader = ppPictHeader; - *ppPictHeaderSize = pPictHeaderSize; - -diff -Naur mpeg4ip/lib/mp4v2/mp4file.h /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.h ---- mpeg4ip/lib/mp4v2/mp4file.h 2005-03-30 20:41:58.000000000 +0200 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.h 2007-02-09 22:35:21.000000000 +0100 -@@ -329,9 +329,9 @@ - uint8_t *pLevel); - bool GetTrackH264SeqPictHeaders(MP4TrackId trackId, - uint8_t ***pSeqHeader, -- uint32_t **pSeqHeaderSize, -+ u_int32_t **pSeqHeaderSize, - uint8_t ***pPictHeader, -- uint32_t **pPictHeaderSize); -+ u_int32_t **pPictHeaderSize); - void GetTrackH264LengthSize(MP4TrackId, - uint32_t *pLength); - const char* GetHintTrackSdp(MP4TrackId hintTrackId); -diff -Naur mpeg4ip/lib/mp4v2/mp4file_io.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file_io.cpp ---- mpeg4ip/lib/mp4v2/mp4file_io.cpp 2004-07-15 20:09:48.000000000 +0200 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file_io.cpp 2007-02-09 22:44:47.000000000 +0100 -@@ -86,7 +86,7 @@ - } - - ASSERT(pBytes); -- WARNING(m_numReadBits > 0); -+ //WARNING(m_numReadBits > 0); - - if (pFile == NULL) { - pFile = m_pFile; -diff -Naur mpeg4ip/lib/mp4v2/mp4property.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4property.cpp ---- mpeg4ip/lib/mp4v2/mp4property.cpp 2004-08-23 20:28:21.000000000 +0200 -+++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4property.cpp 2007-02-09 22:47:04.000000000 +0100 -@@ -636,7 +636,7 @@ - u_int32_t numProperties = m_pProperties.Size(); - - if (numProperties == 0) { -- WARNING(numProperties == 0); -+ //WARNING(numProperties == 0); - return; - } - -@@ -670,7 +670,7 @@ - u_int32_t numProperties = m_pProperties.Size(); - - if (numProperties == 0) { -- WARNING(numProperties == 0); -+ //WARNING(numProperties == 0); - return; - } - -@@ -709,7 +709,7 @@ - u_int32_t numProperties = m_pProperties.Size(); - - if (numProperties == 0) { -- WARNING(numProperties == 0); -+ //WARNING(numProperties == 0); - return; - } - diff --git a/contrib/version_a52dec.txt b/contrib/version_a52dec.txt deleted file mode 100644 index 86617fd36..000000000 --- a/contrib/version_a52dec.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/a52dec-0.7.4.tar.gz diff --git a/contrib/version_bzip2.txt b/contrib/version_bzip2.txt deleted file mode 100644 index 7a90c8411..000000000 --- a/contrib/version_bzip2.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/bzip2-1.0.5.tar.gz diff --git a/contrib/version_faac.txt b/contrib/version_faac.txt deleted file mode 100644 index b53bcc4dd..000000000 --- a/contrib/version_faac.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/faac-1.26.tar.gz diff --git a/contrib/version_faad2.txt b/contrib/version_faad2.txt deleted file mode 100644 index ad74c36cd..000000000 --- a/contrib/version_faad2.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/faad2-2.6.1.tar.gz diff --git a/contrib/version_ffmpeg.txt b/contrib/version_ffmpeg.txt deleted file mode 100644 index 8ca79d702..000000000 --- a/contrib/version_ffmpeg.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/ffmpeg-r15974.tar.gz diff --git a/contrib/version_lame.txt b/contrib/version_lame.txt deleted file mode 100644 index 6790bfb7d..000000000 --- a/contrib/version_lame.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/lame-3.98.tar.gz diff --git a/contrib/version_libdca.txt b/contrib/version_libdca.txt deleted file mode 100644 index dfa4de6a0..000000000 --- a/contrib/version_libdca.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libdca-r81-strapped.tar.gz diff --git a/contrib/version_libdvdcss.txt b/contrib/version_libdvdcss.txt deleted file mode 100644 index 4821730fd..000000000 --- a/contrib/version_libdvdcss.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.videolan.org/pub/libdvdcss/1.2.9/libdvdcss-1.2.9.tar.gz \ No newline at end of file diff --git a/contrib/version_libdvdread.txt b/contrib/version_libdvdread.txt deleted file mode 100644 index ef686d667..000000000 --- a/contrib/version_libdvdread.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libdvdread-0.9.7.tar.gz diff --git a/contrib/version_libmkv.txt b/contrib/version_libmkv.txt deleted file mode 100644 index b5f851c78..000000000 --- a/contrib/version_libmkv.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libmkv-0.6.3.1.tar.gz diff --git a/contrib/version_libmp4v2.txt b/contrib/version_libmp4v2.txt deleted file mode 100644 index 33509b29b..000000000 --- a/contrib/version_libmp4v2.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libmp4v2-2.0-r224.tar.gz diff --git a/contrib/version_libogg.txt b/contrib/version_libogg.txt deleted file mode 100644 index 25bcb92ce..000000000 --- a/contrib/version_libogg.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libogg-1.1.3.tar.gz diff --git a/contrib/version_libsamplerate.txt b/contrib/version_libsamplerate.txt deleted file mode 100644 index 038fcbb1f..000000000 --- a/contrib/version_libsamplerate.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libsamplerate-0.1.4.tar.gz diff --git a/contrib/version_libtheora.txt b/contrib/version_libtheora.txt deleted file mode 100644 index 8595fe999..000000000 --- a/contrib/version_libtheora.txt +++ /dev/null @@ -1,2 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libtheora-1.0.tar.gz - diff --git a/contrib/version_libvorbis.txt b/contrib/version_libvorbis.txt deleted file mode 100644 index ad9df271e..000000000 --- a/contrib/version_libvorbis.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libvorbis-aotuv_b5.tar.gz diff --git a/contrib/version_mpeg2dec.txt b/contrib/version_mpeg2dec.txt deleted file mode 100644 index 248ce7bfa..000000000 --- a/contrib/version_mpeg2dec.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/mpeg2dec-0.5.1.tar.gz diff --git a/contrib/version_mpeg4ip.txt b/contrib/version_mpeg4ip.txt deleted file mode 100644 index f60e5972a..000000000 --- a/contrib/version_mpeg4ip.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/mpeg4ip-1.3.tar.gz diff --git a/contrib/version_qt.txt b/contrib/version_qt.txt deleted file mode 100644 index 5f679e32c..000000000 --- a/contrib/version_qt.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/libquicktime-0.9.10.tar.gz diff --git a/contrib/version_x264.txt b/contrib/version_x264.txt deleted file mode 100644 index beb28f14b..000000000 --- a/contrib/version_x264.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/x264-r1109-75b495f.tar.gz \ No newline at end of file diff --git a/contrib/version_xvidcore.txt b/contrib/version_xvidcore.txt deleted file mode 100644 index 5d8c19719..000000000 --- a/contrib/version_xvidcore.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/xvidcore-1.1.3.tar.gz diff --git a/contrib/version_zlib.txt b/contrib/version_zlib.txt deleted file mode 100644 index bbb84c298..000000000 --- a/contrib/version_zlib.txt +++ /dev/null @@ -1 +0,0 @@ -http://download.m0k.org/handbrake/contrib/zlib-1.2.3.tar.gz diff --git a/contrib/x264/P00-cygwin.patch b/contrib/x264/P00-cygwin.patch new file mode 100644 index 000000000..f2e375d69 --- /dev/null +++ b/contrib/x264/P00-cygwin.patch @@ -0,0 +1,13 @@ +--- x264/configure2 2008-04-12 21:45:07.000000000 +0100 ++++ x264/configure 2008-04-14 18:44:33.890625000 +0100 +@@ -210,8 +210,8 @@ + ;; + cygwin*) + SYS="MINGW" +- CFLAGS="$CFLAGS -mno-cygwin" +- LDFLAGS="$LDFLAGS -mno-cygwin" ++ #CFLAGS="$CFLAGS -mno-cygwin" ++ #LDFLAGS="$LDFLAGS -mno-cygwin" + EXE=".exe" + DEVNULL="NUL" + ;; diff --git a/contrib/x264/P01-sunos.patch b/contrib/x264/P01-sunos.patch new file mode 100644 index 000000000..24d629ff9 --- /dev/null +++ b/contrib/x264/P01-sunos.patch @@ -0,0 +1,67 @@ +diff -ru x264/Makefile x264.solaris/Makefile +--- x264/Makefile Mon Jun 9 01:36:08 2008 ++++ x264.solaris/Makefile Thu Jun 19 11:54:53 2008 +@@ -150,8 +150,10 @@ + $(MAKE) -C gtk distclean + + install: x264$(EXE) $(SONAME) +- install -d $(DESTDIR)$(bindir) $(DESTDIR)$(includedir) +- install -d $(DESTDIR)$(libdir) $(DESTDIR)$(libdir)/pkgconfig ++ install -d $(DESTDIR)$(bindir) ++ install -d $(DESTDIR)$(includedir) ++ install -d $(DESTDIR)$(libdir) ++ install -d $(DESTDIR)$(libdir)/pkgconfig + install -m 644 x264.h $(DESTDIR)$(includedir) + install -m 644 libx264.a $(DESTDIR)$(libdir) + install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig +diff -ru x264/configure x264.solaris/configure +--- x264/configure Tue Aug 12 03:26:58 2008 ++++ x264.modified/configure Tue Aug 19 16:09:32 2008 +@@ -1,4 +1,4 @@ +-#! /bin/sh ++#! /usr/xpg4/bin/sh + + if test x"$1" = x"-h" -o x"$1" = x"--help" ; then + +@@ -75,7 +75,7 @@ + # check whether 'echo -n' works as expected, otherwise try printf + if [ "x`echo -n houba`" = xhouba ] + then +- ECHON="echo -n" ++ ECHON="/usr/ucb/echo -n" + elif [ "x`printf houba`" = xhouba ] + then + ECHON="printf" +@@ -321,8 +321,6 @@ + echo "If you really want to compile without asm, configure with --disable-asm." + exit 1 + fi +-else +- AS="" + fi + + CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS" +@@ -329,8 +327,10 @@ + + echo "unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';" > conftest.c + $CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed" +-grep -q BIGE conftest.o && CFLAGS="$CFLAGS -DWORDS_BIGENDIAN" ++/usr/bin/tr -cd "BIGE" < conftest.o | /usr/xpg4/bin/grep -q BIGE && CFLAGS="$CFLAGS -DWORDS_BIGENDIAN" + ++echo $CFLAGS ++ + # autodetect options that weren't forced nor disabled + + libpthread="" +diff -ru x264/version.sh x264.solaris/version.sh +--- x264/version.sh Mon Jun 9 01:36:08 2008 ++++ x264.solaris/version.sh Thu Jun 19 11:56:19 2008 +@@ -1,7 +1,7 @@ + #!/bin/sh + git-rev-list HEAD | sort > config.git-hash + LOCALVER=`wc -l config.git-hash | awk '{print $1}'` +-if [ $LOCALVER \> 1 ] ; then ++if [ $LOCALVER -gt 1 ] ; then + VER=`git-rev-list origin/master | sort | join config.git-hash - | wc -l | awk '{print $1}'` + if [ $VER != $LOCALVER ] ; then + VER="$VER+$(($LOCALVER-$VER))" diff --git a/contrib/x264/module.defs b/contrib/x264/module.defs new file mode 100644 index 000000000..6476d19fb --- /dev/null +++ b/contrib/x264/module.defs @@ -0,0 +1,11 @@ +$(eval $(call import.MODULE.defs,X264,x264)) +$(eval $(call import.CONTRIB.defs,X264)) + +X264.FETCH.url = http://download.m0k.org/handbrake/contrib/x264-r1109-75b495f.tar.gz +X264.EXTRACT.tarbase = x264 + +X264.CONFIGURE.deps = +X264.CONFIGURE.shared = +X264.CONFIGURE.static = + +X264.CONFIGURE.extra = --enable-pthread diff --git a/contrib/x264/module.rules b/contrib/x264/module.rules new file mode 100644 index 000000000..182ede881 --- /dev/null +++ b/contrib/x264/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,X264)) +$(eval $(call import.CONTRIB.rules,X264)) diff --git a/contrib/xvidcore/A00-nasm.patch b/contrib/xvidcore/A00-nasm.patch new file mode 100644 index 000000000..44242ace4 --- /dev/null +++ b/contrib/xvidcore/A00-nasm.patch @@ -0,0 +1,13 @@ +diff -ruN xvidcore-orig/build/generic/configure xvidcore/build/generic/configure +--- xvidcore-orig/build/generic/configure 2006-11-01 03:39:36.000000000 -0700 ++++ xvidcore/build/generic/configure 2008-01-30 20:19:48.000000000 -0700 +@@ -4016,7 +4016,7 @@ + if test "$ac_nasm" = "yes" ; then + echo "$as_me:$LINENO: checking for nasm patch version" >&5 + echo $ECHO_N "checking for nasm patch version... $ECHO_C" >&6 +- nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1` ++ nasm_patch=`($nasm_prog -r || $nasm_prog -v) | cut -d '.' -f 3 | cut -d ' ' -f 1` + if test -z $nasm_patch ; then +- nasm_patch=-1 ++ nasm_patch=45 + fi diff --git a/contrib/xvidcore/A01-fdct.patch b/contrib/xvidcore/A01-fdct.patch new file mode 100644 index 000000000..1fc90b689 --- /dev/null +++ b/contrib/xvidcore/A01-fdct.patch @@ -0,0 +1,8 @@ +--- xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm.orig 2008-02-22 10:28:13.000000000 -0800 ++++ xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm 2008-02-22 11:08:52.000000000 -0800 +@@ -620,3 +620,5 @@ + ret + .endfunc + ++ALIGN 16 ++ times 8 dw 0 diff --git a/contrib/xvidcore/P00-darwin.patch b/contrib/xvidcore/P00-darwin.patch new file mode 100644 index 000000000..51cb94c6d --- /dev/null +++ b/contrib/xvidcore/P00-darwin.patch @@ -0,0 +1,31 @@ +diff -ru xvidcore-1.1.0/build/generic/configure xvidcore-1.1.0-patched/build/generic/configure +--- xvidcore-1.1.0/build/generic/configure 2005-12-30 15:45:30.000000000 +0100 ++++ xvidcore-1.1.0-patched/build/generic/configure 2006-01-16 22:06:10.000000000 +0100 +@@ -4052,6 +4071,12 @@ + PREFIX="-DPREFIX" + MARK_FUNCS="" + ;; ++ *darwin*) ++ echo "$as_me:$LINENO: result: macho" >&5 ++echo "${ECHO_T}macho" >&6 ++ NASM_FORMAT="macho" ++ PREFIX="-DPREFIX" ++ MARK_FUNCS="" + esac + + AS="$chosen_asm_prog" +diff -ru xvidcore-1.1.0/build/generic/configure.in xvidcore-1.1.0-patched/build/generic/configure.in +--- xvidcore-1.1.0/build/generic/configure.in 2005-12-30 15:45:30.000000000 +0100 ++++ xvidcore-1.1.0-patched/build/generic/configure.in 2006-01-16 22:06:04.000000000 +0100 +@@ -397,6 +397,11 @@ + PREFIX="-DPREFIX" + MARK_FUNCS="" + ;; ++ *darwin*) ++ AC_MSG_RESULT([macho]) ++ NASM_FORMAT="macho" ++ PREFIX="-DPREFIX" ++ MARK_FUNCS="" + esac + + AS="$chosen_asm_prog" diff --git a/contrib/xvidcore/P01-cygwin.patch b/contrib/xvidcore/P01-cygwin.patch new file mode 100644 index 000000000..7b60510d0 --- /dev/null +++ b/contrib/xvidcore/P01-cygwin.patch @@ -0,0 +1,34 @@ +diff -Naur xvidcore/build/generic/configure xvidcore-patched/build/generic/configure +--- xvidcore/build/generic/configure 2005-12-30 09:45:30.000000000 -0500 ++++ xvidcore-patched/build/generic/configure 2007-01-01 18:43:27.953125000 -0500 +@@ -3844,10 +3844,9 @@ + [cC][yY][gG][wW][iI][nN]*|mingw32*|mks*) + echo "$as_me:$LINENO: result: ok" >&5 + echo "${ECHO_T}ok" >&6 +- STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" +- SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" +- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" +- SPECIFIC_CFLAGS="-mno-cygwin" ++ STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" ++ SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" ++ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" + ;; + darwin*|raphsody*) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" +diff -Naur xvidcore/build/generic/configure.in xvidcore-patched/build/generic/configure.in +--- xvidcore/build/generic/configure.in 2005-12-30 09:45:30.000000000 -0500 ++++ xvidcore-patched/build/generic/configure.in 2007-01-01 18:43:11.453125000 -0500 +@@ -281,10 +281,9 @@ + ;; + [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*) + AC_MSG_RESULT([ok]) +- STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" +- SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" +- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" +- SPECIFIC_CFLAGS="-mno-cygwin" ++ STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" ++ SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" ++ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" + ;; + darwin*|raphsody*) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" diff --git a/contrib/xvidcore/module.defs b/contrib/xvidcore/module.defs new file mode 100644 index 000000000..0ec291a24 --- /dev/null +++ b/contrib/xvidcore/module.defs @@ -0,0 +1,20 @@ +$(eval $(call import.MODULE.defs,XVIDCORE,xvidcore)) +$(eval $(call import.CONTRIB.defs,XVIDCORE)) + +XVIDCORE.FETCH.url = http://download.m0k.org/handbrake/contrib/xvidcore-1.1.3.tar.gz +XVIDCORE.EXTRACT.tarbase = xvidcore + +XVIDCORE.CONFIGURE.dir = $(XVIDCORE.EXTRACT.target/)build/generic/ + +XVIDCORE.BUILD.dir = $(XVIDCORE.EXTRACT.target/)build/generic/ +XVIDCORE.BUILD.ntargets = libxvidcore.a + +define XVIDCORE.INSTALL + cp $(XVIDCORE.EXTRACT.target/)build/generic/=build/libxvidcore.a $(CONTRIB.build/)lib/ + cp $(XVIDCORE.EXTRACT.target/)src/xvid.h $(CONTRIB.build/)include/ +endef + +define XVIDCORE.UNINSTALL + rm $(CONTRIB.build/)lib/libxvidcore.a + rm $(CONTRIB.build/)include/xvid.h +endef diff --git a/contrib/xvidcore/module.rules b/contrib/xvidcore/module.rules new file mode 100644 index 000000000..76600608e --- /dev/null +++ b/contrib/xvidcore/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,XVIDCORE)) +$(eval $(call import.CONTRIB.rules,XVIDCORE)) diff --git a/contrib/zlib/module.defs b/contrib/zlib/module.defs new file mode 100644 index 000000000..66db2f491 --- /dev/null +++ b/contrib/zlib/module.defs @@ -0,0 +1,6 @@ +$(eval $(call import.MODULE.defs,ZLIB,zlib)) +$(eval $(call import.CONTRIB.defs,ZLIB)) + +ZLIB.FETCH.url = http://download.m0k.org/handbrake/contrib/zlib-1.2.3.tar.gz +ZLIB.EXTRACT.tarbase = zlib +ZLIB.CONFIGURE.args = !sete @dir !env !exe @prefix !extra diff --git a/contrib/zlib/module.rules b/contrib/zlib/module.rules new file mode 100644 index 000000000..5767ee682 --- /dev/null +++ b/contrib/zlib/module.rules @@ -0,0 +1,2 @@ +$(eval $(call import.MODULE.rules,ZLIB)) +$(eval $(call import.CONTRIB.rules,ZLIB)) -- cgit v1.2.3